diff --git a/src/Model/Entity/CustomFields/CustomField.php b/src/Model/Entity/CustomFields/CustomField.php index 08b69d2..c8c5f49 100644 --- a/src/Model/Entity/CustomFields/CustomField.php +++ b/src/Model/Entity/CustomFields/CustomField.php @@ -84,6 +84,7 @@ class CustomField public $entity; /** + * @deprecated Please use $defaultTyped instead. * @var string * * @JMS\Type("string") @@ -122,4 +123,12 @@ class CustomField * @JMS\SerializedName("dictionary") */ public $dictionary; + + /** + * @var mixed + * + * @JMS\Type("mixed") + * @JMS\SerializedName("defaultTyped") + */ + public $defaultTyped; } diff --git a/tests/src/ResourceGroup/CustomFieldsTest.php b/tests/src/ResourceGroup/CustomFieldsTest.php index 5d6d4ea..400ee37 100644 --- a/tests/src/ResourceGroup/CustomFieldsTest.php +++ b/tests/src/ResourceGroup/CustomFieldsTest.php @@ -58,6 +58,40 @@ class CustomFieldsTest extends AbstractApiResourceGroupTestCase "ordering": 50, "displayArea": "customer", "viewMode": "editable" + }, + { + "name": "мультисправочник", + "code": "multi-dictionary", + "required": false, + "inFilter": true, + "inList": true, + "inGroupActions": false, + "type": "multiselect_dictionary", + "entity": "order", + "ordering": 50, + "displayArea": "customer", + "viewMode": "editable", + "dictionary": "test_dictionary", + "defaultTyped": [ + "test1", + "test2" + ] + }, + { + "name": "справочник", + "code": "dictionary", + "required": false, + "inFilter": true, + "inList": true, + "inGroupActions": false, + "type": "dictionary", + "entity": "order", + "ordering": 50, + "displayArea": "customer", + "viewMode": "editable", + "dictionary": "test_dictionary", + "default": 1, + "defaultTyped": "test1" } ] } @@ -296,7 +330,8 @@ EOF; "default": "false", "ordering": 50, "displayArea": "customer", - "viewMode": "editable" + "viewMode": "editable", + "defaultTyped": false } } EOF; diff --git a/tests/src/ResourceGroup/CustomersTest.php b/tests/src/ResourceGroup/CustomersTest.php index 5eb5ab6..3b99ed9 100644 --- a/tests/src/ResourceGroup/CustomersTest.php +++ b/tests/src/ResourceGroup/CustomersTest.php @@ -191,7 +191,17 @@ class CustomersTest extends AbstractApiResourceGroupTestCase "allowedSendByPhone": false } } - ] + ], + "customFields": { + "bool_field": true, + "string_field": "my_string", + "float_field": 3.8, + "dictionary": "test1", + "multiselect_dictionary": [ + "test2", + "test3" + ] + } } ] } diff --git a/tests/src/ResourceGroup/OrdersTest.php b/tests/src/ResourceGroup/OrdersTest.php index 3fc7df2..22db5e1 100644 --- a/tests/src/ResourceGroup/OrdersTest.php +++ b/tests/src/ResourceGroup/OrdersTest.php @@ -450,7 +450,12 @@ class OrdersTest extends AbstractApiResourceGroupTestCase "galka": false, "test_number": 0, "otpravit_dozakaz": false, - "moyskladexternalid": "0f203a5f-7734-11eb-0a80-026b0001f435" + "moyskladexternalid": "0f203a5f-7734-11eb-0a80-026b0001f435", + "dictionary": "test2", + "multiselect": [ + "test1", + "test3" + ] } } ]