dto_generator:
  entities:
    logic:
      XCart\Logic\Entity\Storefront\Address:
        doctrineEntity: XLite\Model\Address
        generate_get_one: true
        generate_create_one: true
        generate_delete_one: true
        generate_update_one: true
        generate_get_collection: true
        use_doctrine_get_one: true
        use_doctrine_delete_one: true
        use_doctrine_create_one: true
        use_doctrine_update_one: true
        use_doctrine_get_collection: true
        fields:
          isBilling:
            type: bool
            nullable: true
          isShipping:
            type: bool
            nullable: true
          cartId:
            type: string
            nullable: true
          profileId:
            type: integer
          fields:
            type: XCart\Logic\Entity\Storefront\AddressFieldValue[]

      XCart\Logic\Entity\Storefront\AddressField:
        doctrineEntity: XLite\Model\AddressField
        generate_get_one: true
        generate_get_collection: true
        use_doctrine_get_one: true
        use_doctrine_get_collection: true
        fields:
          serviceName:
            type: string
          label:
            type: string
          required:
            type: bool
          values:
            type: XCart\Logic\Entity\Storefront\AddressFieldSelectorOption[]
            nullable: true

    dto:
      XCart\Logic\Action\Storefront\Address\GetList\DTO\Request\Filter:
        type: logic_request_get_list_filter
        fields:
          profile:
            type: IntegerValue
            nullable: true

      XCart\DTO\Doctrine\Storefront\Address\Filter:
        type: doctrine_entity_filter
        fields:
          profile:
            type: IntegerValue
            nullable: true

      XCart\Logic\Action\Storefront\AddressField\GetList\DTO\Request\OrderRule:
        type: logic_request_get_list_order_rule
        fields:
          pos:
            type: string
            nullable: true

      XCart\DTO\Doctrine\Storefront\AddressField\OrderRule:
        type: doctrine_entity_order_rule
        fields:
          position:
            type: string
            nullable: true

      XCart\Logic\Action\Storefront\AddressField\GetList\DTO\Request\Filter:
        type: logic_request_get_list_filter
        fields:
          enabled:
            type: BooleanValue
            nullable: true
          serviceName:
            type: StringValue
            nullable: true

      XCart\DTO\Doctrine\Storefront\AddressField\Filter:
        type: doctrine_entity_filter
        fields:
          enabled:
            type: BooleanValue
            nullable: true
          serviceName:
            type: StringValue
            nullable: true

    logic_request:
      XCart\Logic\Action\Storefront\Address\GetList\DTO\Request:
        type: get_collection
        entity: XCart\Logic\Entity\Storefront\Address
        interfaces:
          - XCart\Logic\DTO\Request\CartRequestInterface
        traits:
          - XCart\Logic\DTO\Request\CartRequestTrait

      XCart\Logic\Action\Storefront\Address\GetOne\DTO\Request:
        type: get_one
        entity: XCart\Logic\Entity\Storefront\Address
        interfaces:
          - XCart\Logic\DTO\Request\CartRequestInterface
          - XCart\Logic\DTO\Request\ProfileRequestInterface
        traits:
          - XCart\Logic\DTO\Request\CartRequestTrait
          - XCart\Logic\DTO\Request\ProfileRequestTrait

      XCart\Logic\Action\Storefront\Address\CreateOne\DTO\Request:
        type: create_one
        entity: XCart\Logic\Entity\Storefront\NewAddress
        interfaces:
          - XCart\Logic\DTO\Request\CartRequestInterface
        traits:
          - XCart\Logic\DTO\Request\CartRequestTrait

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

  transformers:
    # User addresses
    - from: XLite\Model\Address
      to: XCart\Logic\Entity\Storefront\Address
      pattern: predefined
    - from: XLite\Model\Address
      to: XCart\Logic\Entity\Storefront\NewAddress
      pattern: predefined
    - from: XCart\Logic\Entity\Storefront\Address
      to: XLite\Model\Address
      pattern: predefined
    - from: XCart\Logic\Entity\Storefront\NewAddress
      to: XLite\Model\Address
      pattern: predefined

    # Address fields
    - from: XLite\Model\AddressField
      to: XCart\Logic\Entity\Storefront\AddressField
      pattern: predefined
