From 1881dd349914b7300500fcbc57fbf26d5e1ab6c4 Mon Sep 17 00:00:00 2001 From: Alex Komarichev Date: Wed, 18 Dec 2024 14:42:35 +0300 Subject: [PATCH] Add customerSubscriptions to Customer entity. Add subscriptions filter to CustomerFilter filter. --- src/Model/Entity/Customers/Customer.php | 8 ++ .../Entity/Customers/CustomerSubscription.php | 46 +++++++++++ .../Entity/Customers/SubscriptionCategory.php | 77 +++++++++++++++++++ src/Model/Filter/Customers/CustomerFilter.php | 8 ++ .../Customers/CustomerSubscriptionFilter.php | 45 +++++++++++ tests/src/ResourceGroup/CustomersTest.php | 54 +++++++++++++ 6 files changed, 238 insertions(+) create mode 100644 src/Model/Entity/Customers/CustomerSubscription.php create mode 100644 src/Model/Entity/Customers/SubscriptionCategory.php create mode 100644 src/Model/Filter/Customers/CustomerSubscriptionFilter.php diff --git a/src/Model/Entity/Customers/Customer.php b/src/Model/Entity/Customers/Customer.php index bad3cf38..67a333c5 100644 --- a/src/Model/Entity/Customers/Customer.php +++ b/src/Model/Entity/Customers/Customer.php @@ -369,6 +369,14 @@ class Customer implements CustomerInterface */ public $subscribed; + /** + * @var \RetailCrm\Api\Model\Entity\Customers\CustomerSubscription[] + * + * @JMS\Type("array") + * @JMS\SerializedName("customerSubscriptions") + */ + public $customerSubscriptions; + /** * @var \RetailCrm\Api\Model\Entity\Customers\MGCustomer[] * diff --git a/src/Model/Entity/Customers/CustomerSubscription.php b/src/Model/Entity/Customers/CustomerSubscription.php new file mode 100644 index 00000000..c8ce5d07 --- /dev/null +++ b/src/Model/Entity/Customers/CustomerSubscription.php @@ -0,0 +1,46 @@ +") + * @JMS\SerializedName("changedAt") + */ + public $changedAt; +} diff --git a/src/Model/Entity/Customers/SubscriptionCategory.php b/src/Model/Entity/Customers/SubscriptionCategory.php new file mode 100644 index 00000000..be4fe1e0 --- /dev/null +++ b/src/Model/Entity/Customers/SubscriptionCategory.php @@ -0,0 +1,77 @@ +") + * @Form\SerializedName("subscriptions") + */ + public $subscriptions; } diff --git a/src/Model/Filter/Customers/CustomerSubscriptionFilter.php b/src/Model/Filter/Customers/CustomerSubscriptionFilter.php new file mode 100644 index 00000000..22b8fa20 --- /dev/null +++ b/src/Model/Filter/Customers/CustomerSubscriptionFilter.php @@ -0,0 +1,45 @@ +