Skip to content

Commit

Permalink
v3.0.5 (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellward authored Jun 27, 2024
1 parent 4dbd394 commit 75f2d9d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions SyneriseApi/Sender/Data/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
use Synerise\ApiClient\Api\DefaultApi;
use Synerise\ApiClient\ApiException;
use Synerise\Integration\Helper\Logger;
use Synerise\Integration\Helper\Tracking\UuidManagement;
use Synerise\Integration\Model\Config\Source\Debug\Exclude;
use Synerise\Integration\Model\Workspace\ConfigFactory as WorkspaceConfigFactory;
use Synerise\Integration\Observer\MergeUuids;
use Synerise\Integration\SyneriseApi\Mapper\Data\CustomerCRUD;
use Synerise\Integration\SyneriseApi\Sender\AbstractSender;
use Synerise\Integration\Model\Config\Source\Customers\Attributes;
Expand Down Expand Up @@ -122,7 +122,7 @@ function () use ($storeId, $payload) {
}
} catch (ApiException $e) {
$shouldLogException = true;
if ($eventName == UuidManagement::EVENT) {
if ($eventName == MergeUuids::EVENT) {
$shouldLogException = $this->loggerHelper->isExcludedFromLogging(
Exclude::EXCEPTION_CLIENT_MERGE_FAIL
);
Expand Down
10 changes: 6 additions & 4 deletions SyneriseApi/Sender/Data/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function sendItems($collection, int $storeId, ?int $websiteId = null, arr
}

if ($ids) {
$this->markItemsAsSent($ids);
$this->markItemsAsSent($ids, $storeId);
}
}

Expand Down Expand Up @@ -162,15 +162,17 @@ public function isSent(int $orderId): string
/**
* Mark orders as sent
*
* @param string[] $ids
* @param int[] $ids
* @param int $storeId
* @return void
*/
public function markItemsAsSent(array $ids)
public function markItemsAsSent(array $ids, int $storeId)
{
$data = [];
foreach ($ids as $id) {
$data[] = [
'order_id' => $id
'order_id' => $id,
'store_id' => $storeId
];
}
$this->resource->getConnection()->insertOnDuplicate(
Expand Down
8 changes: 5 additions & 3 deletions SyneriseApi/Sender/Data/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function sendItems($collection, int $storeId, ?int $websiteId = null, arr
$requests,
$storeId
);
$this->markSubscribersAsSent($ids);
$this->markSubscribersAsSent($ids, $storeId);
}
}

Expand Down Expand Up @@ -146,13 +146,15 @@ protected function getDefaultApiInstance(int $storeId): DefaultApi
* Mark subscribers as sent
*
* @param int[] $ids
* @param int $storeId
*/
public function markSubscribersAsSent($ids)
public function markSubscribersAsSent(array $ids, int $storeId)
{
$data = [];
foreach ($ids as $id) {
$data[] = [
'subscriber_id' => $id
'subscriber_id' => $id,
'store_id' => $storeId
];
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "synerise/magento2-integration",
"description": "Synerise Magento 2 integration module.",
"type": "magento2-module",
"version": "3.0.4",
"version": "3.0.5",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 2 additions & 0 deletions etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<table name="synerise_sync_order" resource="default" engine="innodb"
comment="Synerise Synchronization Order Status">
<column xsi:type="int" name="order_id" unsigned="true" nullable="false" comment="Order ID"/>
<column xsi:type="int" name="store_id" unsigned="true" nullable="true" comment="Store ID"/>
<column xsi:type="timestamp" name="synerise_updated_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Synerise Updated At"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="order_id"/>
Expand All @@ -61,6 +62,7 @@
<table name="synerise_sync_subscriber" resource="default" engine="innodb"
comment="Synerise Synchronization Subscriber Status">
<column xsi:type="int" name="subscriber_id" unsigned="true" nullable="false" comment="Subscriber ID"/>
<column xsi:type="int" name="store_id" unsigned="true" nullable="true" comment="Store ID"/>
<column xsi:type="timestamp" name="synerise_updated_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Synerise Updated At"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="subscriber_id"/>
Expand Down
6 changes: 4 additions & 2 deletions etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"synerise_sync_order": {
"column": {
"order_id": true,
"synerise_updated_at": true
"synerise_updated_at": true,
"store_id": true
},
"constraint": {
"PRIMARY": true
Expand All @@ -31,7 +32,8 @@
"synerise_sync_subscriber": {
"column": {
"subscriber_id": true,
"synerise_updated_at": true
"synerise_updated_at": true,
"store_id": true
},
"constraint": {
"PRIMARY": true
Expand Down

0 comments on commit 75f2d9d

Please sign in to comment.