1
0
mirror of synced 2025-01-18 17:01:42 +03:00

Add customerSubscriptions to Customer entity

This commit is contained in:
Pavel 2024-12-20 16:34:11 +03:00 committed by GitHub
commit 068a9d0e0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 238 additions and 0 deletions

View File

@ -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[]
* *

View 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;
}

View 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;
}

View File

@ -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;
} }

View 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;
}

View File

@ -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,