dto_generator:
  entities:
    api:
      XCart\API\Entity\Storefront\Payment\Action:
        name: Payment
        logicEntity: XCart\Logic\Entity\Storefront\Payment\Action
        path: /storefront/carts/{cart_id}/payment
        idType: manual
        register_get_one: true
        register_update_one: true
        # item operations defined to set id requirement
        itemOperations:
          get:
            method: GET
            path: '/storefront/carts/{cart_id}/payment/{id}.{_format}'
            identifiers: [id]
            requirements:
              id: '.+'
            normalization_context:
              groups: [read]
            openapi_context:
              summary: 'Retrieve an entity by id'
              parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
          patch:
            method: PATCH
            path: '/storefront/carts/{cart_id}/payment/{id}.{_format}'
            identifiers: [id]
            requirements:
              id: '.+'
            normalization_context:
              groups: [read]
            denormalization_context:
              groups: [update]
            openapi_context:
              summary: 'Partially change an entity by id'
              parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string

        interfaces:
          - \XCart\Bundle\CommonBundle\DTO\Id\IdOwnerInterface
        fields:
          id:
            id: true
            type: string
            nullable: true
            groups: [read]
          cartId:
            type: string
            nullable: true
            groups: [empty]
          # Transaction
          status:
            type: string
            nullable: true
            groups: [read]
          value:
            type: float
            nullable: true
            groups: [read]
          type:
            type: string
            nullable: true
            groups: [read]
          data:
            type: XCart\API\Entity\Storefront\Payment\Action\TransactionData[]
            nullable: true
            groups: [read]
          backendTransactions:
            type: XCart\API\Entity\Storefront\Payment\Action\BackendTransaction[]
            nullable: true
            groups: [read]

          processor:
            type: string
            nullable: true
            groups: [read]

          action:
            type: string
            nullable: true
            groups: [read, update]
            annotations:
              Assert\NotBlank: ~
          actionData:
            type: XCart\API\Entity\Storefront\Payment\Action\ActionData[]
            nullable: true
            groups: [read, update]
          actionMetaData:
            type: XCart\API\Entity\Storefront\Payment\Action\ActionMetaData[]
            nullable: true
            groups: [read, update]

    dto:
      XCart\API\Entity\Storefront\Payment\Action\TransactionData:
        fields:
          name:
            type: string
            nullable: true
          value:
            type: string
            nullable: true

      XCart\API\Entity\Storefront\Payment\Action\BackendTransaction:
        fields:
          status:
            type: string
            nullable: true
          value:
            type: float
            nullable: true
          type:
            type: string
            nullable: true
          data:
            type: XCart\API\Entity\Storefront\Payment\Action\TransactionData[]
            nullable: true

      XCart\API\Entity\Storefront\Payment\Action\ActionData:
        fields:
          name:
            type: string
            nullable: true
          value:
            type: string
            nullable: true

      XCart\API\Entity\Storefront\Payment\Action\ActionMetaData:
        fields:
          name:
            type: string
            nullable: true
          value:
            type: string
            nullable: true
