Add customerSubscriptions to Customer entity
This commit is contained in:
commit
068a9d0e0b
@ -369,6 +369,14 @@ class Customer implements CustomerInterface
|
|||||||
*/
|
*/
|
||||||
public $subscribed;
|
public $subscribed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \RetailCrm\Api\Model\Entity\Customers\CustomerSubscription[]
|
||||||
|
*
|
||||||
|
* @JMS\Type("array<RetailCrm\Api\Model\Entity\Customers\CustomerSubscription>")
|
||||||
|
* @JMS\SerializedName("customerSubscriptions")
|
||||||
|
*/
|
||||||
|
public $customerSubscriptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \RetailCrm\Api\Model\Entity\Customers\MGCustomer[]
|
* @var \RetailCrm\Api\Model\Entity\Customers\MGCustomer[]
|
||||||
*
|
*
|
||||||
|
46
src/Model/Entity/Customers/CustomerSubscription.php
Normal file
46
src/Model/Entity/Customers/CustomerSubscription.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category CustomerSubscription
|
||||||
|
* @package RetailCrm\Api\Model\Entity\Customers
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Entity\Customers;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class CustomerSubscription
|
||||||
|
*
|
||||||
|
* @category CustomerSubscription
|
||||||
|
* @package RetailCrm\Api\Model\Entity\Customers
|
||||||
|
*/
|
||||||
|
class CustomerSubscription
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var \RetailCrm\Api\Model\Entity\Customers\SubscriptionCategory
|
||||||
|
*
|
||||||
|
* @JMS\Type("RetailCrm\Api\Model\Entity\Customers\SubscriptionCategory")
|
||||||
|
* @JMS\SerializedName("subscription")
|
||||||
|
*/
|
||||||
|
public $subscription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @JMS\Type("bool")
|
||||||
|
* @JMS\SerializedName("subscribed")
|
||||||
|
*/
|
||||||
|
public $subscribed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var DateTime
|
||||||
|
*
|
||||||
|
* @JMS\Type("DateTime<'Y-m-d H:i:s'>")
|
||||||
|
* @JMS\SerializedName("changedAt")
|
||||||
|
*/
|
||||||
|
public $changedAt;
|
||||||
|
}
|
77
src/Model/Entity/Customers/SubscriptionCategory.php
Normal file
77
src/Model/Entity/Customers/SubscriptionCategory.php
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category SubscriptionCategory
|
||||||
|
* @package RetailCrm\Api\Model\Entity\Customers
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Entity\Customers;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class SubscriptionCategory
|
||||||
|
*
|
||||||
|
* @category SubscriptionCategory
|
||||||
|
* @package RetailCrm\Api\Model\Entity\Customers
|
||||||
|
*/
|
||||||
|
class SubscriptionCategory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*
|
||||||
|
* @JMS\Type("int")
|
||||||
|
* @JMS\SerializedName("id")
|
||||||
|
*/
|
||||||
|
public $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("channel")
|
||||||
|
*/
|
||||||
|
public $channel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("name")
|
||||||
|
*/
|
||||||
|
public $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("code")
|
||||||
|
*/
|
||||||
|
public $code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @JMS\Type("bool")
|
||||||
|
* @JMS\SerializedName("active")
|
||||||
|
*/
|
||||||
|
public $active;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @JMS\Type("bool")
|
||||||
|
* @JMS\SerializedName("autoSubscribe")
|
||||||
|
*/
|
||||||
|
public $autoSubscribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*
|
||||||
|
* @JMS\Type("int")
|
||||||
|
* @JMS\SerializedName("ordering")
|
||||||
|
*/
|
||||||
|
public $ordering;
|
||||||
|
}
|
@ -494,4 +494,12 @@ class CustomerFilter
|
|||||||
* @Form\SerializedName("attachedTags")
|
* @Form\SerializedName("attachedTags")
|
||||||
*/
|
*/
|
||||||
public $attachedTags;
|
public $attachedTags;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \RetailCrm\Api\Model\Filter\Customers\CustomerSubscriptionFilter[]
|
||||||
|
*
|
||||||
|
* @Form\Type("array<RetailCrm\Api\Model\Filter\Customers\CustomerSubscriptionFilter>")
|
||||||
|
* @Form\SerializedName("subscriptions")
|
||||||
|
*/
|
||||||
|
public $subscriptions;
|
||||||
}
|
}
|
||||||
|
45
src/Model/Filter/Customers/CustomerSubscriptionFilter.php
Normal file
45
src/Model/Filter/Customers/CustomerSubscriptionFilter.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category CustomerSubscriptionFilter
|
||||||
|
* @package RetailCrm\Api\Model\Filter\Customers
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Filter\Customers;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Component\FormData\Mapping as Form;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class CustomerSubscriptionFilter
|
||||||
|
*
|
||||||
|
* @category CustomerSubscriptionFilter
|
||||||
|
* @package RetailCrm\Api\Model\Filter\Customers
|
||||||
|
*/
|
||||||
|
class CustomerSubscriptionFilter
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @Form\Type("string")
|
||||||
|
* @Form\SerializedName("channel")
|
||||||
|
*/
|
||||||
|
public $channel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @Form\Type("string")
|
||||||
|
* @Form\SerializedName("subscription")
|
||||||
|
*/
|
||||||
|
public $subscription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @Form\Type("bool")
|
||||||
|
* @Form\SerializedName("subscribed")
|
||||||
|
*/
|
||||||
|
public $subscribed;
|
||||||
|
}
|
@ -180,6 +180,33 @@ class CustomersTest extends AbstractApiResourceGroupTestCase
|
|||||||
"number": "89229112322"
|
"number": "89229112322"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"customerSubscriptions": [
|
||||||
|
{
|
||||||
|
"subscription": {
|
||||||
|
"id": 2,
|
||||||
|
"channel": "email",
|
||||||
|
"name": "Без тематики",
|
||||||
|
"code": "default_marketing",
|
||||||
|
"active": true,
|
||||||
|
"autoSubscribe": true,
|
||||||
|
"ordering": 1
|
||||||
|
},
|
||||||
|
"subscribed": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"subscription": {
|
||||||
|
"id": 4,
|
||||||
|
"channel": "waba",
|
||||||
|
"name": "Без тематики",
|
||||||
|
"code": "default_marketing",
|
||||||
|
"active": true,
|
||||||
|
"autoSubscribe": true,
|
||||||
|
"ordering": 1
|
||||||
|
},
|
||||||
|
"subscribed": false,
|
||||||
|
"changedAt": "2024-12-17 11:50:43"
|
||||||
|
}
|
||||||
|
],
|
||||||
"mgCustomers": [
|
"mgCustomers": [
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
@ -2670,6 +2697,33 @@ EOF;
|
|||||||
"number": "+79094055044"
|
"number": "+79094055044"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"customerSubscriptions": [
|
||||||
|
{
|
||||||
|
"subscription": {
|
||||||
|
"id": 2,
|
||||||
|
"channel": "email",
|
||||||
|
"name": "Без тематики",
|
||||||
|
"code": "default_marketing",
|
||||||
|
"active": true,
|
||||||
|
"autoSubscribe": true,
|
||||||
|
"ordering": 1
|
||||||
|
},
|
||||||
|
"subscribed": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"subscription": {
|
||||||
|
"id": 4,
|
||||||
|
"channel": "waba",
|
||||||
|
"name": "Без тематики",
|
||||||
|
"code": "default_marketing",
|
||||||
|
"active": true,
|
||||||
|
"autoSubscribe": true,
|
||||||
|
"ordering": 1
|
||||||
|
},
|
||||||
|
"subscribed": false,
|
||||||
|
"changedAt": "2024-12-17 11:50:43"
|
||||||
|
}
|
||||||
|
],
|
||||||
"mgCustomers": [
|
"mgCustomers": [
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user