diff --git a/features/request/Type/TypeUpdate.feature b/features/request/Type/TypeUpdate.feature index c0ff97a68c..342bf0cc23 100644 --- a/features/request/Type/TypeUpdate.feature +++ b/features/request/Type/TypeUpdate.feature @@ -249,19 +249,7 @@ Feature: I want to update a type """ { "action": "changeFieldDefinitionOrder", - "attributes": [ - { - "type": { - "name": "String" - }, - "name": "custom-string", - "label": { - "en": "Custom String" - }, - "isRequired": false, - "inputHint": "SingleLine" - } - ] + "fieldNames": ["field1", "field2"] } """ Then the path should be "types/id" @@ -273,19 +261,7 @@ Feature: I want to update a type "actions": [ { "action": "changeFieldDefinitionOrder", - "attributes": [ - { - "type": { - "name": "String" - }, - "name": "custom-string", - "label": { - "en": "Custom String" - }, - "isRequired": false, - "inputHint": "SingleLine" - } - ] + "fieldNames": ["field1", "field2"] } ] } @@ -299,10 +275,7 @@ Feature: I want to update a type { "action": "changeEnumValueOrder", "fieldName": "", - "values": [{ - "key": "enumkey", - "label": "Enum Label" - }] + "keys": [ "enumkey1", "enumkey2"] } """ Then the path should be "types/id" @@ -315,10 +288,7 @@ Feature: I want to update a type { "action": "changeEnumValueOrder", "fieldName": "", - "values": [{ - "key": "enumkey", - "label": "Enum Label" - }] + "keys": [ "enumkey1", "enumkey2"] } ] } @@ -332,12 +302,7 @@ Feature: I want to update a type { "action": "changeLocalizedEnumValueOrder", "fieldName": "", - "values": [{ - "key": "enumkey", - "label": { - "en": "Enum Label" - } - }] + "keys": [ "enumkey1", "enumkey2"] } """ Then the path should be "types/id" @@ -350,12 +315,7 @@ Feature: I want to update a type { "action": "changeLocalizedEnumValueOrder", "fieldName": "", - "values": [{ - "key": "enumkey", - "label": { - "en": "Enum Label" - } - }] + "keys": [ "enumkey1", "enumkey2"] } ] } diff --git a/src/Request/Types/Command/TypeChangeEnumValueOrderAction.php b/src/Request/Types/Command/TypeChangeEnumValueOrderAction.php index bd72e24cfa..775265259a 100644 --- a/src/Request/Types/Command/TypeChangeEnumValueOrderAction.php +++ b/src/Request/Types/Command/TypeChangeEnumValueOrderAction.php @@ -16,8 +16,8 @@ * @method TypeChangeEnumValueOrderAction setAction(string $action = null) * @method string getFieldName() * @method TypeChangeEnumValueOrderAction setFieldName(string $fieldName = null) - * @method EnumCollection getValues() - * @method TypeChangeEnumValueOrderAction setValues(EnumCollection $values = null) + * @method array getKeys() + * @method TypeChangeEnumValueOrderAction setKeys(array $keys = null) */ class TypeChangeEnumValueOrderAction extends AbstractAction { @@ -26,7 +26,7 @@ public function fieldDefinitions() return [ 'action' => [static::TYPE => 'string'], 'fieldName' => [static::TYPE => 'string'], - 'values' => [static::TYPE => '\Commercetools\Core\Model\Common\EnumCollection'] + 'keys' => [static::TYPE => 'array'] ]; } @@ -41,12 +41,12 @@ public function __construct(array $data = [], $context = null) } /** - * @param EnumCollection $enums + * @param array $keys * @param Context|callable $context * @return TypeChangeEnumValueOrderAction */ - public static function ofEnums(EnumCollection $enums, $context = null) + public static function ofEnums(array $keys, $context = null) { - return static::of($context)->setValues($enums); + return static::of($context)->setKeys($keys); } } diff --git a/src/Request/Types/Command/TypeChangeFieldDefinitionOrderAction.php b/src/Request/Types/Command/TypeChangeFieldDefinitionOrderAction.php index cbecd3413f..fa9bbb532c 100644 --- a/src/Request/Types/Command/TypeChangeFieldDefinitionOrderAction.php +++ b/src/Request/Types/Command/TypeChangeFieldDefinitionOrderAction.php @@ -14,8 +14,8 @@ * * @method string getAction() * @method TypeChangeFieldDefinitionOrderAction setAction(string $action = null) - * @method FieldDefinitionCollection getFieldDefinitions() - * @method TypeChangeFieldDefinitionOrderAction setFieldDefinitions(FieldDefinitionCollection $fieldDefinitions = null) + * @method array getFieldNames() + * @method TypeChangeFieldDefinitionOrderAction setFieldNames(array $fieldNames = null) */ class TypeChangeFieldDefinitionOrderAction extends AbstractAction { @@ -23,7 +23,7 @@ public function fieldDefinitions() { return [ 'action' => [static::TYPE => 'string'], - 'fieldDefinitions' => [static::TYPE => '\Commercetools\Core\Model\Type\FieldDefinitionCollection'], + 'fieldNames' => [static::TYPE => 'array'], ]; } @@ -42,8 +42,8 @@ public function __construct(array $data = [], $context = null) * @param Context|callable $context * @return TypeChangeFieldDefinitionOrderAction */ - public static function ofFieldDefinitions(FieldDefinitionCollection $fieldDefinitions, $context = null) + public static function ofFieldDefinitions(array $fieldNames, $context = null) { - return static::of($context)->setFieldDefinitions($fieldDefinitions); + return static::of($context)->setFieldNames($fieldNames); } } diff --git a/src/Request/Types/Command/TypeChangeLocalizedEnumValueOrderAction.php b/src/Request/Types/Command/TypeChangeLocalizedEnumValueOrderAction.php index afdac2d09a..3299a622f4 100644 --- a/src/Request/Types/Command/TypeChangeLocalizedEnumValueOrderAction.php +++ b/src/Request/Types/Command/TypeChangeLocalizedEnumValueOrderAction.php @@ -17,8 +17,8 @@ * @method TypeChangeLocalizedEnumValueOrderAction setAction(string $action = null) * @method string getFieldName() * @method TypeChangeLocalizedEnumValueOrderAction setFieldName(string $fieldName = null) - * @method LocalizedEnumCollection getValues() - * @method TypeChangeLocalizedEnumValueOrderAction setValues(LocalizedEnumCollection $values = null) + * @method array getKeys() + * @method TypeChangeLocalizedEnumValueOrderAction setKeys(array $keys = null) */ class TypeChangeLocalizedEnumValueOrderAction extends AbstractAction { @@ -27,7 +27,7 @@ public function fieldDefinitions() return [ 'action' => [static::TYPE => 'string'], 'fieldName' => [static::TYPE => 'string'], - 'values' => [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedEnumCollection'] + 'keys' => [static::TYPE => 'array'] ]; } @@ -42,12 +42,12 @@ public function __construct(array $data = [], $context = null) } /** - * @param LocalizedEnumCollection $enums + * @param array $keys * @param Context|callable $context * @return TypeChangeLocalizedEnumValueOrderAction */ - public static function ofEnums(LocalizedEnumCollection $enums, $context = null) + public static function ofEnums(array $keys, $context = null) { - return static::of($context)->setValues($enums); + return static::of($context)->setKeys($keys); } }