Skip to content

Commit

Permalink
Merge pull request #529 from DannyvdSluijs/Fix-query-parameter-string
Browse files Browse the repository at this point in the history
Fix query string
  • Loading branch information
stephangroen authored Feb 3, 2022
2 parents 1fd5da5 + cdfd6cd commit b319937
Show file tree
Hide file tree
Showing 48 changed files with 285 additions and 52 deletions.
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/AccountDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ class AccountDocument extends Model
'TypeDescription',
];

protected $url = 'read/crm/AccountDocuments?accountId={Edm.Guid}&searchText={Edm.String}&useFullTextSearch={Edm.Boolean}';
protected $url = 'read/crm/AccountDocuments';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/AccountDocumentCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ class AccountDocumentCount extends Model
protected $fillable = [
];

protected $url = 'read/crm/AccountDocumentsCount?accountId={Edm.Guid}&searchText={Edm.String}&useFullTextSearch={Edm.Boolean}';
protected $url = 'read/crm/AccountDocumentsCount';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/AccountDocumentFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ class AccountDocumentFolder extends Model
'SharePointID',
];

protected $url = 'read/crm/AccountDocumentFolders?accountId={Edm.Guid}';
protected $url = 'read/crm/AccountDocumentFolders';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/AgingOverviewByAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ class AgingOverviewByAccount extends Model
'CurrencyCode',
];

protected $url = 'read/financial/AgingOverviewByAccount?accountId={Edm.Guid}';
protected $url = 'read/financial/AgingOverviewByAccount';
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ class AgingPayablesListByAgeGroup extends Model
'TotalAmount',
];

protected $url = 'read/financial/AgingPayablesListByAgeGroup?ageGroup={Edm.Int32}';
protected $url = 'read/financial/AgingPayablesListByAgeGroup';
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ class AgingReceivablesListByAgeGroup extends Model
'TotalAmount',
];

protected $url = 'read/financial/AgingReceivablesListByAgeGroup?ageGroup={Edm.Int32}';
protected $url = 'read/financial/AgingReceivablesListByAgeGroup';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/CostEntryExpensesByProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class CostEntryExpensesByProject extends Model
'ParentDescription',
];

protected $url = 'read/project/CostEntryExpensesByProject?projectId={Edm.Guid}';
protected $url = 'read/project/CostEntryExpensesByProject';
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class CostEntryRecentAccountsByProject extends Model
'DateLastUsed',
];

protected $url = 'read/project/CostEntryRecentAccountsByProject?projectId={Edm.Guid}';
protected $url = 'read/project/CostEntryRecentAccountsByProject';
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class CostEntryRecentCostTypesByProject extends Model
'ItemDescription',
];

protected $url = 'read/project/CostEntryRecentCostTypesByProject?projectId={Edm.Guid}';
protected $url = 'read/project/CostEntryRecentCostTypesByProject';
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class CostEntryRecentExpensesByProject extends Model
'ParentDescription',
];

protected $url = 'read/project/CostEntryRecentExpensesByProject?projectId={Edm.Guid}';
protected $url = 'read/project/CostEntryRecentExpensesByProject';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/CostTypesByDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class CostTypesByDate extends Model
'ItemDescription',
];

protected $url = 'read/project/CostTypesByDate?checkDate={Edm.DateTime}';
protected $url = 'read/project/CostTypesByDate';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/CostTypesByProjectAndDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class CostTypesByProjectAndDate extends Model
'ItemDescription',
];

protected $url = 'read/project/CostTypesByProjectAndDate?projectId={Edm.Guid}&checkDate={Edm.DateTime}';
protected $url = 'read/project/CostTypesByProjectAndDate';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/CostsByDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ class CostsByDate extends Model
'WeekNumber',
];

protected $url = 'read/project/CostsByDate?checkDate={Edm.DateTime}';
protected $url = 'read/project/CostsByDate';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/CostsById.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ class CostsById extends Model
'WeekNumber',
];

protected $url = 'read/project/CostsById?entryId={Edm.Guid}';
protected $url = 'read/project/CostsById';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/DefaultAddressForAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,5 @@ class DefaultAddressForAccount extends Model
'WarehouseDescription',
];

protected $url = 'read/crm/DefaultAddressForAccount?accountId={Edm.Guid}&addressType={Edm.Int32}';
protected $url = 'read/crm/DefaultAddressForAccount';
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class HourEntryActivitiesByProject extends Model
'ParentDescription',
];

protected $url = 'read/project/HourEntryActivitiesByProject?projectId={Edm.Guid}';
protected $url = 'read/project/HourEntryActivitiesByProject';
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class HourEntryRecentAccountsByProject extends Model
'DateLastUsed',
];

protected $url = 'read/project/HourEntryRecentAccountsByProject?projectId={Edm.Guid}';
protected $url = 'read/project/HourEntryRecentAccountsByProject';
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class HourEntryRecentActivitiesByProject extends Model
'ParentDescription',
];

protected $url = 'read/project/HourEntryRecentActivitiesByProject?projectId={Edm.Guid}';
protected $url = 'read/project/HourEntryRecentActivitiesByProject';
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class HourEntryRecentHourTypesByProject extends Model
'ItemDescription',
];

protected $url = 'read/project/HourEntryRecentHourTypesByProject?projectId={Edm.Guid}';
protected $url = 'read/project/HourEntryRecentHourTypesByProject';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/HourTypesByDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class HourTypesByDate extends Model
'ItemDescription',
];

protected $url = 'read/project/HourTypesByDate?checkDate={Edm.DateTime}';
protected $url = 'read/project/HourTypesByDate';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/HourTypesByProjectAndDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class HourTypesByProjectAndDate extends Model
'ItemDescription',
];

protected $url = 'read/project/HourTypesByProjectAndDate?projectId={Edm.Guid}&checkDate={Edm.DateTime}';
protected $url = 'read/project/HourTypesByProjectAndDate';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/HoursByDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ class HoursByDate extends Model
'WeekNumber',
];

protected $url = 'read/project/HoursByDate?checkDate={Edm.DateTime}';
protected $url = 'read/project/HoursByDate';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/HoursById.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ class HoursById extends Model
'WeekNumber',
];

protected $url = 'read/project/HoursById?entryId={Edm.Guid}';
protected $url = 'read/project/HoursById';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/ItemDetailsByID.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ class ItemDetailsByID extends Model
'SalesPrice',
];

protected $url = 'read/logistics/ItemDetailsByID?itemId={Edm.Guid}';
protected $url = 'read/logistics/ItemDetailsByID';
}
6 changes: 1 addition & 5 deletions src/Picqer/Financials/Exact/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ public function attributes()
*
* @return string
*/
public function url($id = null)
public function url()
{
if (isset($id)) {
return str_replace('{Edm.Guid}', "guid'" . $id . "'", $this->url);
}

return $this->url;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/OpportunityDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ class OpportunityDocument extends Model
'TypeDescription',
];

protected $url = 'read/crm/OpportunityDocuments?opportunityId={Edm.Guid}&searchText={Edm.String}';
protected $url = 'read/crm/OpportunityDocuments';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/OpportunityDocumentsCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ class OpportunityDocumentsCount extends Model
protected $fillable = [
];

protected $url = 'read/crm/OpportunityDocumentsCount?opportunityId={Edm.Guid}&searchText={Edm.String}';
protected $url = 'read/crm/OpportunityDocumentsCount';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/PayablesListByAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ class PayablesListByAccount extends Model
'YourRef',
];

protected $url = 'read/financial/PayablesListByAccount?accountId={Edm.Guid}';
protected $url = 'read/financial/PayablesListByAccount';
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ class PayablesListByAccountAndAgeGroup extends Model
'YourRef',
];

protected $url = 'read/financial/PayablesListByAccountAndAgeGroup?accountId={Edm.Guid}&ageGroup={Edm.Int32}';
protected $url = 'read/financial/PayablesListByAccountAndAgeGroup';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/PayablesListByAgeGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ class PayablesListByAgeGroup extends Model
'YourRef',
];

protected $url = 'read/financial/PayablesListByAgeGroup?ageGroup={Edm.Int32}';
protected $url = 'read/financial/PayablesListByAgeGroup';
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ class PreferredMailboxForOperation extends Model
'ValidTo',
];

protected $url = 'read/mailbox/PreferredMailboxForOperation?operation={Edm.Int32}';
protected $url = 'read/mailbox/PreferredMailboxForOperation';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/ProjectWBSByProjectAndWBS.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ class ProjectWBSByProjectAndWBS extends Model
'Type',
];

protected $url = 'read/project/ProjectWBSByProjectAndWBS?projectId={Edm.Guid}&projectWBSId={Edm.Guid}&wbsType={Edm.Int16}';
protected $url = 'read/project/ProjectWBSByProjectAndWBS';
}
4 changes: 2 additions & 2 deletions src/Picqer/Financials/Exact/Query/Findable.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function find($id)
$filter = $this->primaryKey() . " eq $id";
}

$records = $this->connection()->get($this->url($id), [
$records = $this->connection()->get($this->url(), [
'$filter' => $filter,
'$top' => 1, // The result will always be 1 but on some entities Exact gives an error without it.
]);
Expand All @@ -44,7 +44,7 @@ public function find($id)
public function findWithSelect($id, $select = '')
{
//eg: $oAccounts->findWithSelect('5b7f4515-b7a0-4839-ac69-574968677d96', 'Code, Name');
$result = $this->connection()->get($this->url($id), [
$result = $this->connection()->get($this->url(), [
'$filter' => $this->primaryKey() . " eq guid'$id'",
'$select' => $select,
]);
Expand Down
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/ReceivablesListByAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ class ReceivablesListByAccount extends Model
'YourRef',
];

protected $url = 'read/financial/ReceivablesListByAccount?accountId={Edm.Guid}';
protected $url = 'read/financial/ReceivablesListByAccount';
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ class ReceivablesListByAccountAndAgeGroup extends Model
'YourRef',
];

protected $url = 'read/financial/ReceivablesListByAccountAndAgeGroup?accountId={Edm.Guid}&ageGroup={Edm.Int32}';
protected $url = 'read/financial/ReceivablesListByAccountAndAgeGroup';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/ReceivablesListByAgeGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ class ReceivablesListByAgeGroup extends Model
'YourRef',
];

protected $url = 'read/financial/ReceivablesListByAgeGroup?ageGroup={Edm.Int32}';
protected $url = 'read/financial/ReceivablesListByAgeGroup';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/RecentCostsByNumberOfWeeks.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ class RecentCostsByNumberOfWeeks extends Model
'WeekNumber',
];

protected $url = 'read/project/RecentCostsByNumberOfWeeks?numberOfWeeks={Edm.Int32}';
protected $url = 'read/project/RecentCostsByNumberOfWeeks';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/RevenueListByYear.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class RevenueListByYear extends Model
'Amount',
];

protected $url = 'read/financial/RevenueListByYear?year={Edm.Int32}';
protected $url = 'read/financial/RevenueListByYear';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/RevenueListByYearAndStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ class RevenueListByYearAndStatus extends Model
'Amount',
];

protected $url = 'read/financial/RevenueListByYearAndStatus?year={Edm.Int32}&afterEntry={Edm.Boolean}';
protected $url = 'read/financial/RevenueListByYearAndStatus';
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ class TimeAndBillingAccountDetailsByID extends Model
'Name',
];

protected $url = 'read/project/TimeAndBillingAccountDetailsByID?accountId={Edm.Guid}';
protected $url = 'read/project/TimeAndBillingAccountDetailsByID';
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class TimeAndBillingEntryAccountsByDate extends Model
'AccountName',
];

protected $url = 'read/project/TimeAndBillingEntryAccountsByDate?checkDate={Edm.DateTime}';
protected $url = 'read/project/TimeAndBillingEntryAccountsByDate';
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class TimeAndBillingEntryAccountsByProjectAndDate extends Model
'AccountName',
];

protected $url = 'read/project/TimeAndBillingEntryAccountsByProjectAndDate?projectId={Edm.Guid}&checkDate={Edm.DateTime}';
protected $url = 'read/project/TimeAndBillingEntryAccountsByProjectAndDate';
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class TimeAndBillingEntryProjectsByAccountAndDate extends Model
'ProjectDescription',
];

protected $url = 'read/project/TimeAndBillingEntryProjectsByAccountAndDate?accountId={Edm.Guid}&checkDate={Edm.DateTime}';
protected $url = 'read/project/TimeAndBillingEntryProjectsByAccountAndDate';
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class TimeAndBillingEntryProjectsByDate extends Model
'ProjectDescription',
];

protected $url = 'read/project/TimeAndBillingEntryProjectsByDate?checkDate={Edm.DateTime}';
protected $url = 'read/project/TimeAndBillingEntryProjectsByDate';
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ class TimeAndBillingItemDetailsByID extends Model
'SalesPrice',
];

protected $url = 'read/project/TimeAndBillingItemDetailsByID?itemId={Edm.Guid}';
protected $url = 'read/project/TimeAndBillingItemDetailsByID';
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ class TimeAndBillingProjectDetailsByID extends Model
'Type',
];

protected $url = 'read/project/TimeAndBillingProjectDetailsByID?projectId={Edm.Guid}';
protected $url = 'read/project/TimeAndBillingProjectDetailsByID';
}
2 changes: 1 addition & 1 deletion src/Picqer/Financials/Exact/UserHasRights.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ class UserHasRights extends Model
protected $fillable = [
];

protected $url = 'users/UserHasRights?endpoint={Edm.String}&action={Edm.String}';
protected $url = 'users/UserHasRights';
}
Loading

0 comments on commit b319937

Please sign in to comment.