dto_generator:
  entities:
    logic:
      XCart\Logic\Entity\Storefront\Cart:
        doctrineEntity: XLite\Model\Cart
        generate_get_one: true
        generate_create_one: true
        generate_update_one: true
        generate_delete_one: true
        use_doctrine_get_one: true
        use_doctrine_create_one: true
        use_doctrine_update_one: true
        use_doctrine_delete_one: true
        fields:
          publicId:
            type: string
            nullable: true
          profileId:
            type: integer
            nullable: true
          email:
            type: string
          items:
            type: XCart\Logic\Entity\Storefront\Cart\Item[]
          subTotal:
            type: float
          total:
            type: float
          payment:
            type: XCart\Logic\Entity\Storefront\Cart\PaymentMethod
            nullable: true
          paymentTransaction:
            type: string
            nullable: true
          shipping:
            type: XCart\Logic\Entity\Storefront\Cart\ShippingMethod
            nullable: true
          surcharges:
            type: XCart\Logic\Entity\Storefront\Cart\Surcharge[]

      XCart\Logic\Entity\Storefront\Cart\Item:
        doctrineEntity: XLite\Model\OrderItem
        generate_get_one: true
        generate_get_collection: true
        generate_create_one: true
        generate_update_one: true
        generate_delete_one: true
        use_doctrine_get_one: true
        use_doctrine_get_collection: true
        use_doctrine_create_one: true
        use_doctrine_update_one: true
        use_doctrine_delete_one: true
        fields:
          cartId:
            type: integer
          productId:
            type: integer
          sku:
            type: string
            nullable: true
          name:
            type: string
            nullable: true
          cleanUrl:
            type: string
            nullable: true
          amount:
            type: float
          inStock:
            type: integer
            nullable: true
          price:
            type: float
            nullable: true
          clear_price:
            type: float
            nullable: true
          net_price:
            type: float
            nullable: true
          display_price:
            type: float
            nullable: true
          attributes:
            type: XCart\Logic\Entity\Storefront\Cart\Item\AttributeValue[]
          surcharges:
            type: XCart\Logic\Entity\Storefront\Cart\Item\Surcharge[]
          subtotal:
            type: float
          total:
            type: float
          images:
            type: XCart\Logic\Entity\Storefront\Image[]

      XCart\Logic\Entity\Storefront\Cart\PaymentMethod:
        generate_get_one: true
        generate_get_collection: true
        fields:
          cartId:
            type: string
          serviceName:
            type: string
          name:
            type: string
          title:
            type: string
          description:
            type: string
          instruction:
            type: string

      XCart\Logic\Entity\Storefront\Cart\CalculatedShippingRates:
        generate_create_one: true
        fields:
          cartId:
            type: integer
          rates:
            type: XCart\Logic\Entity\Storefront\Cart\ShippingRate[]

      XCart\Logic\Entity\Storefront\Cart\MergeRequest:
        generate_create_one: true
        idType: uuid4
        fields:
          anonymousCartId:
            type: string
          profileId:
            type: integer

      XCart\Logic\Entity\Storefront\Cart\ShippingMethodSelection:
        generate_create_one: true
        idType: uuid4
        fields:
          cartId:
            type: integer
          shippingMethodId:
            type: integer
            nullable: true

      XCart\Logic\Entity\Storefront\Cart\PaymentMethodSelection:
        generate_create_one: true
        idType: uuid4
        fields:
          cartId:
            type: integer
          paymentMethodId:
            type: integer
            nullable: true

      XCart\Logic\Entity\Storefront\Cart\EmailChanging:
        generate_create_one: true
        idType: uuid4
        fields:
          cartId:
            type: integer
          email:
            type: string

      XCart\Logic\Entity\Storefront\Order:
        generate_create_one: true
        fields:
          cartId:
            type: integer
          cartPublicId:
            type: string
          number:
            type: string

    dto:
      XCart\Logic\Action\Storefront\Cart\Item\GetList\DTO\Request\Filter:
        type: logic_request_get_list_filter
        fields:
          order:
            type: IntegerValue

      XCart\DTO\Doctrine\Storefront\Cart\Item\Filter:
        type: doctrine_entity_filter
        fields:
          order:
            type: IntegerValue

      XCart\Logic\Entity\Storefront\Cart\Item\AttributeValue:
        fields:
          name:
            type: string
            nullable: true
          attributeId:
            type: integer
            nullable: true
          attributeValueId:
            type: integer
            nullable: true
          attributeValue:
            type: string
            nullable: true

      XCart\Logic\Entity\Storefront\Cart\Surcharge:
        fields:
          type:
            type: string
          name:
            type: string
          value:
            type: float

      XCart\Logic\Entity\Storefront\Cart\Item\Surcharge:
        fields:
          type:
            type: string
          name:
            type: string
          value:
            type: float

      XCart\Logic\Entity\Storefront\Cart\ShippingMethod:
        fields:
          id:
            type: integer
          name:
            type: string

      XCart\Logic\Entity\Storefront\Cart\ShippingRate:
        fields:
          method:
            type: XCart\Logic\Entity\Storefront\Cart\ShippingMethod
          value:
            type: float
          preparedDeliveryTime:
            type: string
            nullable: true

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

      XCart\Logic\Action\Storefront\Cart\PaymentMethod\GetOne\DTO\Request:
        type: get_one
        entity: XCart\Logic\Entity\Storefront\Cart\PaymentMethod
        interfaces:
          - XCart\Logic\DTO\Request\CartRequestInterface
        traits:
          - XCart\Logic\DTO\Request\CartRequestTrait

  transformers:
    # cart
    - from: XCart\API\Entity\Storefront\Cart
      to: XCart\Logic\Entity\Storefront\Cart
      pattern: predefined
    - from: XCart\Logic\Entity\Storefront\Cart
      to: XCart\API\Entity\Storefront\Cart
      pattern: predefined

    - from: XCart\Logic\Entity\Storefront\NewCart
      to: XCart\API\Entity\Storefront\Cart
      pattern: predefined
    - from: XCart\API\Entity\Storefront\Cart
      to: XCart\Logic\Entity\Storefront\NewCart
      pattern: serialization

    - from: XCart\Logic\Entity\Storefront\NewCart
      to: XLite\Model\Cart
      pattern: predefined
    - from: XLite\Model\Cart
      to: XCart\Logic\Entity\Storefront\NewCart
      pattern: predefined

    - from: XCart\Logic\Entity\Storefront\Cart
      to: XLite\Model\Cart
      pattern: predefined
    - from: XLite\Model\Cart
      to: XCart\Logic\Entity\Storefront\Cart
      pattern: predefined

    # cart item
    - from: XCart\Logic\Entity\Storefront\Cart\NewItem
      to: XLite\Model\OrderItem
      pattern: predefined
    - from: XLite\Model\OrderItem
      to: XCart\Logic\Entity\Storefront\Cart\NewItem
      pattern: predefined

    - from: XCart\Logic\Entity\Storefront\Cart\Item
      to: XLite\Model\OrderItem
      pattern: predefined
    - from: XLite\Model\OrderItem
      to: XCart\Logic\Entity\Storefront\Cart\Item
      pattern: predefined

    # surcharges
    - from: XLite\Model\OrderItem\Surcharge
      to: XCart\Logic\Entity\Storefront\Cart\Item\Surcharge
      pattern: predefined
    - from: XLite\Model\Order\Surcharge
      to: XCart\Logic\Entity\Storefront\Cart\Surcharge
      pattern: predefined

    # attribute values
    - from: XLite\Model\OrderItem\AttributeValue
      to: XCart\Logic\Entity\Storefront\Cart\Item\AttributeValue
      pattern: predefined
