export interface ProductsInOrderDetails {
    id: string;
    sku: string;
    type: string;
    name: string;
    additional: string;
    qtyOrdered: number;
    qtyShipped: number;
    qtyInvoiced: number;
    qtyCanceled: number;
    qtyRefunded: number;
    price: number;
    basePrice: number;
    total: number;
    baseTotal: number;
    discountPercent: number;
    discountAmount: number;
    baseDiscountAmount: number;
}

interface ItemsInOrderDetails { 
    edges: {
        node: ProductsInOrderDetails;
    }[];
}
export type OrderAddressType = "order_shipping" | "order_billing";
export interface AddressInOrderDetails { 
    id: string;
    _id: number;
    addressType: OrderAddressType;
    orderId: number;
    name: string;
    firstName: string;
    lastName: string;
    companyName: string;
    address: string;
    city: string;
    state: string;
    country: string;
    postcode: string;
    useForShipping: '0' | '1'; // '0' | '1'
    email: string;
    phone: string;
    defaultAddress: boolean;
    createdAt: string;
    updatedAt: string;
}

export interface AddressListInOrderDetails { 
    edges: {
        node: AddressInOrderDetails;
    }[];
}
interface OptionAttribute{
    value_id: number;
    option_id: number;
    value_code: string;
    option_code: string;
    value_label: string;
    option_label: string;
    attribute_name: string;
}
export interface ProductItemAdditional { 
    
    locale: string;
    cart_id: number;
    quantity: number;
    attributes: {
        [key: string]: OptionAttribute;  
    },
    is_buy_now: number;
    product_id: number;
    variant_id: number;
    variant_sku: string;
    variant_name: string | null;

}

export interface OrderDetails {
    incrementId: string;
    id: string;
    _id: number;
    status: string;
    channelName: string;
    customerEmail: string;
    customerFirstName: string;
    customerLastName: string;
    shippingMethod: string;
    shippingTitle: string;
    payment: {
        method: string;
        methodTitle: string;
    };
    couponCode: string | null;
    totalItemCount: number;
    totalQtyOrdered: number;
    grandTotal: number;
    baseGrandTotal: number;
    grandTotalInvoiced: number;
    grandTotalRefunded: number;
    subTotal: number;
    baseSubTotal: number;
    taxAmount: number;
    baseTaxAmount: number;
    discountAmount: number;
    baseDiscountAmount: number;
    shippingAmount: number;
    baseShippingAmount: number;
    baseCurrencyCode: string | null;
    channelCurrencyCode: string | null;
    orderCurrencyCode: string;
    items: ItemsInOrderDetails;
    addresses: AddressListInOrderDetails;
    createdAt: string;
    updatedAt: string;
  
}

export interface OrderDetailsData {
  customerOrder: OrderDetails;
}