"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toAdminOrderDetail = exports.toAdminOrderListItem = exports.toPublicOrder = exports.toPublicOrderItem = void 0;
const toPublicOrderItem = (item) => ({
    id: item.id,
    productId: item.productId,
    productName: item.productName,
    sku: item.sku,
    quantity: item.quantity,
    unitPrice: item.unitPrice,
    discountAmount: item.discountAmount,
    lineTotal: item.lineTotal,
    lensChoice: item.lensChoice,
    prescriptionUrl: item.prescriptionUrl,
});
exports.toPublicOrderItem = toPublicOrderItem;
const toPublicOrder = (order, items) => ({
    id: order.id,
    orderNumber: order.orderNumber,
    status: order.status,
    fulfillmentMethod: order.fulfillmentMethod,
    contactPhone: order.contactPhone,
    deliveryAddress: order.deliveryAddress,
    subtotal: order.subtotal,
    totalDiscount: order.totalDiscount,
    totalAmount: order.totalAmount,
    paymentMethod: order.paymentMethod,
    paymentStatus: order.paymentStatus,
    customerNotes: order.customerNotes,
    createdAt: order.createdAt,
    updatedAt: order.updatedAt,
    items,
});
exports.toPublicOrder = toPublicOrder;
const toAdminOrderListItem = (order, customer, managedByStaff, itemCount) => ({
    id: order.id,
    orderNumber: order.orderNumber,
    status: order.status,
    fulfillmentMethod: order.fulfillmentMethod,
    contactPhone: order.contactPhone,
    deliveryAddress: order.deliveryAddress,
    subtotal: order.subtotal,
    totalDiscount: order.totalDiscount,
    totalAmount: order.totalAmount,
    paymentMethod: order.paymentMethod,
    paymentStatus: order.paymentStatus,
    customerNotes: order.customerNotes,
    createdAt: order.createdAt,
    updatedAt: order.updatedAt,
    customer,
    managedByStaff,
    itemCount,
});
exports.toAdminOrderListItem = toAdminOrderListItem;
const toAdminOrderDetail = (listItem, items, staffNotes) => ({
    ...listItem,
    items,
    staffNotes,
});
exports.toAdminOrderDetail = toAdminOrderDetail;
//# sourceMappingURL=orderSerializers.js.map