Skip to content

Commit

Permalink
Merge branch 'develop' into release/4.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sta1r committed Oct 8, 2024
2 parents 47a5eb3 + 7f0c73b commit 87fedcb
Show file tree
Hide file tree
Showing 166 changed files with 6,536 additions and 2,145 deletions.
17 changes: 17 additions & 0 deletions Api/Model/Sync/Batch/BatchMergerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Batch;

interface BatchMergerInterface
{
/**
* Merge two batches of data.
*
* @param array $batch
* @param array $megaBatch
* @return array
*/
public function mergeBatch(array $batch, array $megaBatch);
}
18 changes: 18 additions & 0 deletions Api/Model/Sync/Batch/BatchProcessorInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Batch;

interface BatchProcessorInterface
{
/**
* Processes a batch of data for a specific import type and website.
*
* @param array $batch An array of data to be processed.
* @param int $websiteId The ID of the website the batch is associated with.
* @param string $importType The type of import, which determines the processing logic to be applied.
* @param string $bulkImportMode The type of import mode.
*/
public function process(array $batch, int $websiteId, string $importType, string $bulkImportMode);
}
16 changes: 16 additions & 0 deletions Api/Model/Sync/Batch/BatchStrategyFactoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Batch;

interface BatchStrategyFactoryInterface
{
/**
* Creates a batch strategy instance based on the specified import type.
*
* @param string $importType The type of import for which the strategy is created.
* @return BatchStrategyInterface
*/
public function create(string $importType): BatchStrategyInterface;
}
19 changes: 19 additions & 0 deletions Api/Model/Sync/Batch/BatchStrategyInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Batch;

interface BatchStrategyInterface
{
/**
* Processes the data set by setData method.
*
* This method is the core of the strategy, where the actual processing of the data happens.
* It should contain the logic specific to the strategy's purpose, such as sending emails,
* importing records, or any other task that the strategy is designed to perform.
*
* @return mixed
*/
public function process();
}
25 changes: 25 additions & 0 deletions Api/Model/Sync/Batch/Record/RecordImportedStrategyInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Batch\Record;

use Dotdigitalgroup\Email\Api\Model\Sync\Batch\BatchStrategyInterface;

interface RecordImportedStrategyInterface extends BatchStrategyInterface
{
/**
* Sets the data to be processed by the strategy.
*
* @param array $records
* @return RecordImportedStrategyInterface
*/
public function setRecords(array $records): RecordImportedStrategyInterface;

/**
* Processes a batch of records.
*
* @return void
*/
public function process(): void;
}
33 changes: 33 additions & 0 deletions Api/Model/Sync/Batch/Sender/SenderStrategyInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Batch\Sender;

use Dotdigitalgroup\Email\Api\Model\Sync\Batch\BatchStrategyInterface;

interface SenderStrategyInterface extends BatchStrategyInterface
{
/**
* Sets the batch of data to be processed.
*
* @param array $batch
* @return SenderStrategyInterface
*/
public function setBatch(array $batch): SenderStrategyInterface;

/**
* Sets the website ID associated with the data batch.
*
* @param int $websiteId
* @return SenderStrategyInterface
*/
public function setWebsiteId(int $websiteId): SenderStrategyInterface;

/**
* Processes a batch of records.
*
* @return string An import ID, or an empty string.
*/
public function process(): string;
}
45 changes: 45 additions & 0 deletions Api/Model/Sync/Export/ContactExporterInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Export;

use Exception;
use Magento\Framework\Exception\LocalizedException;
use Magento\Store\Api\Data\WebsiteInterface;

/**
* Interface ContactExporterInterface
*
* This interface extends the ExporterInterface and provides methods to export data and manage field mappings.
*/
interface ContactExporterInterface extends ExporterInterface
{
/**
* Export data.
*
* @param array $data
* @param WebsiteInterface $website
* @param int $listId
*
* @return array
* @throws LocalizedException|Exception
*/
public function export(array $data, WebsiteInterface $website, int $listId);

/**
* Set field mapping.
*
* @param WebsiteInterface $website
*
* @return void
*/
public function setFieldMapping(WebsiteInterface $website): void;

/**
* Get field mapping.
*
* @return array
*/
public function getFieldMapping(): array;
}
10 changes: 10 additions & 0 deletions Api/Model/Sync/Export/ExporterInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Export;

interface ExporterInterface
{

}
24 changes: 24 additions & 0 deletions Api/Model/Sync/Export/InsightDataExporterInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Export;

use Dotdigital\V3\Models\InsightData\Record;
use Magento\Store\Api\Data\WebsiteInterface;

/**
* Interface InsightDataExporterInterface
*
* This interface extends the ExporterInterface and provides a method to build a collection of insight data records.
*/
interface InsightDataExporterInterface extends ExporterInterface
{
/**
* Build a collection of insight data records.
*
* @param array $data
* @return array<string, Record>
*/
public function export(array $data): array;
}
28 changes: 28 additions & 0 deletions Api/Model/Sync/Export/SdkBuilderInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Export;

/**
* Interface SyncBuilderInterface
*
* This interface defines the methods required for building and exporting sync data.
*/
interface SdkBuilderInterface
{
/**
* Set the data to be built.
*
* @param mixed $data The data to be built.
* @return SdkBuilderInterface Returns the instance of the builder.
*/
public function setBuildableData($data): SdkBuilderInterface;

/**
* Build the data.
*
* @return mixed The built data.
*/
public function build();
}
17 changes: 17 additions & 0 deletions Api/Model/Sync/Export/SdkCollectionBuilderInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Export;

use Dotdigital\V3\Models\InsightData\RecordsCollection;

interface SdkCollectionBuilderInterface extends SdkBuilderInterface
{
/**
* Build a RecordsCollection.
*
* @return RecordsCollection
*/
public function build(): RecordsCollection;
}
18 changes: 18 additions & 0 deletions Api/Model/Sync/Importer/BulkSyncInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace Dotdigitalgroup\Email\Api\Model\Sync\Importer;

use Dotdigitalgroup\Email\Model\Importer as ImporterModel;

interface BulkSyncInterface
{
/**
* Process a single importer item.
*
* @param ImporterModel $item
* @return mixed
*/
public function process(ImporterModel $item);
}
3 changes: 3 additions & 0 deletions Block/Adminhtml/Dashboard/Information.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ public function getApiValid()
* Get the last successful execution for import.
*
* @return string
*
* @deprecated Use the DashboardInformationView view model instead.
* @see \Dotdigitalgroup\Email\ViewModel\Adminhtml\DashboardInformationView
*/
public function getCronLastExecution()
{
Expand Down
4 changes: 3 additions & 1 deletion Block/Adminhtml/LogViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

namespace Dotdigitalgroup\Email\Block\Adminhtml;

/**
* @api
*/
class LogViewer extends \Magento\Backend\Block\Widget\Container
{

/**
* @var string
*/
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# 4.27.0

### What's new
- Customers, subscribers and guests are now synced into the platform faster.
- Orders are now synced into the platform faster.
- System messages surface message queue problems in the Magento admin.

### Improvements
- Custom attributes mapped to data fields will now take their default attribute value as a fallback if no value is set. [External contribution](https://github.com/dotmailer/dotmailer-magento2-extension/pull/633)
- Subscribers are synced into Dotdigital via API v3, prior to automation enrolment.
- Queue topic names now use class constants.
- All observer code is wrapped in try/catch statements.
- We now use the `patchByIdentifier` method when sending dummy data to Dotdigital, to avoid an `identifierConflict` error.
- We added a new integration test for the OrderSaveAfter observer.
- We added new MFTF tests for placing orders with the module enabled.
- We removed an OrderSaveBefore observer.
- Data fields for most purchased category, most purchased brand, last purchased brand and first purchased brand are no longer auto-mapped by default.
- We added an `@api` annotation to the LogViewer block.

### Bug fixes
- The inline script for the dmPt tracking code has been moved to a UI component.
- We fixed a problem with list mapping for customers with more than 5000 lists in their account.

# 4.26.3

### Bug fixes
Expand Down
Loading

0 comments on commit 87fedcb

Please sign in to comment.