Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple updates #12

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function request(string $method, string $uri, array $options = [])
}

throw new KauflandException(
'Kaufland error: ' . $e->getResponse()->getReasonPhrase(),
'Kaufland error: ' . $e->getResponse()->getBody(),
$e->getResponse()->getStatusCode()
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function tree()
*/
public function list()
{
return $this->connection->request('GET', 'categories/', ['query' => $this->getQuery()]);
return $this->connection->request('GET', 'categories', ['query' => $this->getQuery()]);
}

/**
Expand All @@ -36,6 +36,6 @@ public function show($identifier, array $embedded = null)
*/
public function decide(array $attributes): array
{
return $this->connection->request('POST', "categories/decide/", ['body' => $attributes]);
return $this->connection->request('POST', "categories/decide", ['body' => $attributes]);
}
}
2 changes: 1 addition & 1 deletion src/Resources/ImportFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public function show($identifier)
*/
public function post(array $attributes): array
{
return $this->connection->request('POST', "import-files/", ['body' => $attributes]);
return $this->connection->request('POST', "import-files", ['body' => $attributes]);
}
}
2 changes: 1 addition & 1 deletion src/Resources/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Item extends Model
*/
public function list(string $ean = '', string $q = '')
{
return $this->connection->request('GET', 'items/', ['query' => $this->getQuery() + array_filter(['ean' => $ean, 'q' => $q])]);
return $this->connection->request('GET', 'items', ['query' => $this->getQuery() + array_filter(['ean' => $ean, 'q' => $q])]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/OrderInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function show($identifier): array
*/
public function create(array $attributes): array
{
return $this->connection->request('POST', "order-invoices/", ['body' => $attributes]);
return $this->connection->request('POST', "order-invoices", ['body' => $attributes]);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/OrderUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function show($identifier): array
*/
public function fulfil($identifier): array
{
return $this->connection->request('PATCH', "order-units/{$identifier}/fulfil/");
return $this->connection->request('PATCH', "order-units/{$identifier}/fulfil");
}

/**
Expand All @@ -38,7 +38,7 @@ public function fulfil($identifier): array
*/
public function cancel($identifier, array $attributes): array
{
return $this->connection->request('PATCH', "order-units/{$identifier}/cancel/", ['body' => $attributes]);
return $this->connection->request('PATCH', "order-units/{$identifier}/cancel", ['body' => $attributes]);
}

/**
Expand All @@ -48,7 +48,7 @@ public function cancel($identifier, array $attributes): array
*/
public function send($identifier, array $attributes): array
{
return $this->connection->request('PATCH', "order-units/{$identifier}/send/", ['body' => $attributes]);
return $this->connection->request('PATCH', "order-units/{$identifier}/send", ['body' => $attributes]);
}

/**
Expand All @@ -58,6 +58,6 @@ public function send($identifier, array $attributes): array
*/
public function refund($identifier, array $attributes): array
{
return $this->connection->request('PATCH', "order-units/{$identifier}/refund/", ['body' => $attributes]);
return $this->connection->request('PATCH', "order-units/{$identifier}/refund", ['body' => $attributes]);
}
}
22 changes: 11 additions & 11 deletions src/Resources/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,86 +26,86 @@ public function show($identifier)
*/
public function accountListing()
{
return $this->connection->request('POST', "reports/account-listing/");
return $this->connection->request('POST', "reports/account-listing");
}

/**
* @return array
*/
public function accountListingWithShopPrice()
{
return $this->connection->request('POST', "reports/account-listing-with-shop-price/");
return $this->connection->request('POST', "reports/account-listing-with-shop-price");
}

/**
* @return array
*/
public function bookings()
{
return $this->connection->request('POST', "reports/bookings/");
return $this->connection->request('POST', "reports/bookings");
}

/**
* @return array
*/
public function bookingsNew()
{
return $this->connection->request('POST', "reports/bookings-new/");
return $this->connection->request('POST', "reports/bookings-new");
}

/**
* @return array
*/
public function eansNotFound()
{
return $this->connection->request('POST', "reports/eans-not-found/");
return $this->connection->request('POST', "reports/eans-not-found");
}

/**
* @return array
*/
public function productDataChanges()
{
return $this->connection->request('POST', "reports/product-data-changes/");
return $this->connection->request('POST', "reports/product-data-changes");
}

/**
* @return array
*/
public function cancellations()
{
return $this->connection->request('POST', "reports/cancellations/");
return $this->connection->request('POST', "reports/cancellations");
}

/**
* @return array
*/
public function competitorsComparer()
{
return $this->connection->request('POST', "reports/competitors-comparer/");
return $this->connection->request('POST', "reports/competitors-comparer");
}

/**
* @return array
*/
public function sales()
{
return $this->connection->request('POST', "reports/sales/");
return $this->connection->request('POST', "reports/sales");
}

/**
* @return array
*/
public function salesNew()
{
return $this->connection->request('POST', "reports/sales-new/");
return $this->connection->request('POST', "reports/sales-new");
}

/**
* @return array
*/
public function productDataImportFileErrors()
{
return $this->connection->request('POST', "reports/product-data-import-file-errors/");
return $this->connection->request('POST', "reports/product-data-import-file-errors");
}
}
8 changes: 4 additions & 4 deletions src/Resources/ReturnUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function show($identifier): array
*/
public function accept($identifier): array
{
return $this->connection->request('PATCH', "return-units/{$identifier}/accept/");
return $this->connection->request('PATCH', "return-units/{$identifier}/accept");
}

/**
Expand All @@ -38,7 +38,7 @@ public function accept($identifier): array
*/
public function reject($identifier, array $attributes): array
{
return $this->connection->request('PATCH', "return-units/{$identifier}/reject/", ['body' => $attributes]);
return $this->connection->request('PATCH', "return-units/{$identifier}/reject", ['body' => $attributes]);
}

/**
Expand All @@ -47,7 +47,7 @@ public function reject($identifier, array $attributes): array
*/
public function repair($identifier): array
{
return $this->connection->request('PATCH', "return-units/{$identifier}/repair/");
return $this->connection->request('PATCH', "return-units/{$identifier}/repair");
}

/**
Expand All @@ -57,6 +57,6 @@ public function repair($identifier): array
*/
public function clarify($identifier, array $attributes): array
{
return $this->connection->request('PATCH', "return-units/{$identifier}/clarify/", ['body' => $attributes]);
return $this->connection->request('PATCH', "return-units/{$identifier}/clarify", ['body' => $attributes]);
}
}
2 changes: 1 addition & 1 deletion src/Resources/Returns.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function show($identifier)
*/
public function create(array $attributes): array
{
return $this->connection->request('POST', "returns/", ['body' => $attributes]);
return $this->connection->request('POST', "returns", ['body' => $attributes]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ class Shipment extends Model
*/
public function create(array $attributes): array
{
return $this->connection->request('POST', "shipments/", ['body' => $attributes]);
return $this->connection->request('POST', "shipments", ['body' => $attributes]);
}
}
2 changes: 1 addition & 1 deletion src/Resources/ShippingGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ class ShippingGroup extends Model
*/
public function list()
{
return $this->connection->request('GET', 'shipping-groups/', ['query' => $this->getQuery()]);
return $this->connection->request('GET', 'shipping-groups', ['query' => $this->getQuery()]);
}
}
2 changes: 1 addition & 1 deletion src/Resources/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ class Status extends Model
*/
public function ping()
{
return $this->connection->request('GET', "status/ping/");
return $this->connection->request('GET', "status/ping");
}
}
4 changes: 2 additions & 2 deletions src/Resources/TicketMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TicketMessage extends Model
*/
public function list()
{
return $this->connection->request('GET', 'ticket-messages/seller/', ['query' => $this->getQuery()]);
return $this->connection->request('GET', 'ticket-messages/seller', ['query' => $this->getQuery()]);
}

/**
Expand All @@ -27,6 +27,6 @@ public function show($identifier): array
*/
public function post(array $attributes): array
{
return $this->connection->request('POST', "ticket-messages/", ['body' => $attributes]);
return $this->connection->request('POST', "ticket-messages", ['body' => $attributes]);
}
}
2 changes: 1 addition & 1 deletion src/Resources/Warehouse.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Warehouse extends Model
*/
public function list()
{
return $this->connection->request('GET', 'warehouses/seller/', ['query' => $this->getQuery()]);
return $this->connection->request('GET', 'warehouses/seller', ['query' => $this->getQuery()]);
}

/**
Expand Down