"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkoutFields = void 0;
const addressFields_1 = require("../fields/addressFields");
const productsFields_1 = require("./productsFields");
exports.checkoutFields = {
    checkout: {
        label: 'Checkout',
        type: 'object',
        description: 'Checkout details',
        properties: {
            totalAmount: {
                label: 'Total Amount',
                type: 'number',
                description: 'Decimal money amount.',
                default: {
                    '@path': '$.properties.total'
                }
            },
            currencyCode: {
                label: 'Currency Code',
                type: 'string',
                description: 'The currency code of the money.',
                default: {
                    '@path': '$.properties.currency'
                }
            },
            orderId: {
                label: 'Order ID',
                type: 'string',
                description: 'The ID of the order associated with this checkout.',
                default: {
                    '@path': '$.properties.order_id'
                }
            },
            subtotalPriceAmount: {
                label: 'Subtotal Price Amount',
                type: 'number',
                description: 'A monetary value.',
                default: {
                    '@path': '$.properties.subtotal'
                }
            },
            totalTaxAmount: {
                label: 'Total Tax Amount',
                type: 'number',
                description: 'A monetary value with currency.',
                default: {
                    '@path': '$.properties.tax'
                }
            },
            shippingLinePriceAmount: {
                label: 'Shipping Line Price Amount',
                type: 'number',
                description: 'A monetary value.',
                default: {
                    '@path': '$.properties.shipping'
                }
            }
        }
    },
    checkoutLineItems: {
        ...productsFields_1.productsFields,
        label: 'Checkout Line Items',
        description: 'Checkout Line Item details',
        properties: {
            ...productsFields_1.productsFields.properties,
            quantity: {
                label: 'Quantity',
                type: 'number',
                description: 'Quantity of the item'
            },
            discountTitle: {
                label: 'Discount Title',
                type: 'string',
                description: 'The Discount Code applied to the item.'
            },
            discountValue: {
                label: 'Discount Value',
                type: 'number',
                description: 'The Discount value applied to the item.'
            }
        },
        default: {
            '@arrayPath': [
                '$.properties.products',
                {
                    ...productsFields_1.productsDefaultProperties,
                    quantity: {
                        '@path': '$.quantity'
                    },
                    discountTitle: {
                        '@path': '$.coupon'
                    },
                    discountValue: {
                        '@path': '$.discount'
                    }
                }
            ]
        }
    },
    checkoutBillingAddress: {
        type: 'object',
        label: 'Checkout Billing Address',
        description: 'The billing address associated with the checkout.',
        properties: addressFields_1.addressProperties,
        default: (0, addressFields_1.addressDefaultFields)('$.properties.billing_address')
    },
    checkoutShippingAddress: {
        type: 'object',
        label: 'Checkout Shipping Address',
        description: 'The address to which the order will be shipped.',
        properties: addressFields_1.addressProperties,
        default: (0, addressFields_1.addressDefaultFields)('$.properties.shipping_address')
    }
};
//# sourceMappingURL=checkoutFields.js.map