dto_generator:
  entities:
    logic:
      XCart\Logic\Entity\Storefront\Payment\Action:
        doctrineEntity: XLite\Model\Payment\Transaction
        idType: manual
        generate_get_one: true
        generate_update_one: true
        use_doctrine_get_one: true
        use_doctrine_update_one: true
        fields:
          id:
            id: true
            type: string
            nullable: true
          cartId:
            type: string
            nullable: true
          status:
            type: string
            nullable: true
          value:
            type: float
            nullable: true
          note:
            type: string
            nullable: true
          type:
            type: string
            nullable: true
          data:
            type: XCart\Logic\Entity\Storefront\Payment\Action\TransactionData[]
            nullable: true
          backendTransactions:
            type: XCart\Logic\Entity\Storefront\Payment\Action\BackendTransaction[]
            nullable: true

          processor:
            type: string
            nullable: true

          action:
            type: string
          actionData:
            type: XCart\Logic\Entity\Storefront\Payment\Action\ActionData[]
            nullable: true
          actionMetaData:
            type: XCart\Logic\Entity\Storefront\Payment\Action\ActionMetaData[]
            nullable: true

          processorResult:
            type: string
            nullable: true

    logic_request:
      XCart\Logic\Action\Storefront\Payment\Action\GetOne\DTO\Request:
        type: get_one
        entity: XCart\Logic\Entity\Storefront\Payment\Action
        interfaces:
          - XCart\Logic\DTO\Request\CartRequestInterface
        traits:
          - XCart\Logic\DTO\Request\CartRequestTrait
        fields:
          id:
            type: string

      XCart\Logic\Action\Storefront\Payment\Action\UpdateOne\DTO\Request:
        type: update_one
        entity: XCart\Logic\Entity\Storefront\Payment\Action
        interfaces:
          - XCart\Logic\DTO\Request\CartRequestInterface
        traits:
          - XCart\Logic\DTO\Request\CartRequestTrait
        fields:
          payload:
            type: XCart\Logic\Entity\Storefront\Payment\Action

    dto:
      XCart\Logic\Action\Storefront\Payment\Action\GetList\DTO\Request\Filter:
        type: logic_request_get_list_filter
        fields:
          publicTxnId:
            type: StringValue
            nullable: true

      XCart\DTO\Doctrine\Storefront\Payment\Action\Filter:
        type: doctrine_entity_filter
        fields:
          publicTxnId:
            type: StringValue
            nullable: true

      XCart\Logic\Entity\Storefront\Payment\Action\TransactionData:
        fields:
          name:
            type: string
            nullable: true
          value:
            type: string
            nullable: true
          label:
            type: string
            nullable: true
          accessLevel:
            type: string
            nullable: true

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

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

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

      XCart\Event\Payment\PaymentActionEvent:
        extends: Symfony\Contracts\EventDispatcher\Event
        traits:
          - XCart\Event\Payment\PaymentActionEventTrait
        fields:
          input:
            type: XCart\Logic\Entity\Storefront\Payment\Action
          inputData:
            type: array
            nullable: true
          inputMetaData:
            type: array
            nullable: true
          transaction:
            type: XLite\Model\Payment\Transaction
          value:
            type: float
          outputData:
            type: array
          outputMetaData:
            type: array
          outputNote:
            type: string
            nullable: true
          outputTransactionData:
            type: XCart\Event\Payment\TransactionData[]
          outputBackendTransaction:
            type: XCart\Event\Payment\BackendTransaction
            nullable: true
          outputCode:
            type: string
            nullable: true

      XCart\Event\Payment\TransactionData:
        fields:
          name:
            type: string
          value:
            type: string
          label:
            type: string
            nullable: true
          accessLevel:
            type: string
            nullable: true

      XCart\Event\Payment\BackendTransaction:
        fields:
          status:
            type: string
          value:
            type: float
          type:
            type: string
          data:
            type: XCart\Event\Payment\TransactionData[]

  transformers:
    # transform from Model (Doctrine Entity) to Logic entity
    - from: XLite\Model\Payment\Transaction
      to: XCart\Logic\Entity\Storefront\Payment\Action
      pattern: predefined
    # transform from Logic entity to Model (Doctrine Entity)
    # need to be defined to allow adding/updating Transaction data and Transaction status
    - from: XCart\Logic\Entity\Storefront\Payment\Action
      to: XLite\Model\Payment\Transaction
      pattern: serialization

    - from: XCart\Event\Payment\TransactionData
      to: XCart\Logic\Entity\Storefront\Payment\Action\TransactionData
      pattern: direct
    - from: XCart\Event\Payment\BackendTransaction
      to: XCart\Logic\Entity\Storefront\Payment\Action\BackendTransaction
      pattern: predefined
