import { Resource } from "../resource"; import { SavedStoreOrder, StoreOrder, APIOrderRequest, APIOrderResponse, OrderStatus, Package, SavedStoreLineItem, StoreLineItem } from "./interfaces"; import { Response } from "../server"; export declare class Order extends Resource { /** * The user the order belongs to. */ userId?: string; /** * Whether or not the order has been paid for. */ paid?: boolean; /** * The order's status. */ status?: OrderStatus; /** * The channel the order was placed through. */ channel?: string; /** * The date and time the order was placed. */ createdAt?: string; /** * The coupon to apply to the order. */ coupon?: string; /** * The shipment method to use. */ shipmentMethod?: string; /** * The phone number for the customer */ phoneNumber: string; /** * Who the shipment is addressed to. */ shipToName: string; /** * The company to ship to. */ shipToCompany?: string; /** * The contact to ship the order to. */ shipToContact?: string; /** * The type of the order. */ orderType?: string; /** * Shipping address line 1. */ shipToAddress: string; /** * Shipping address line 2. */ shipToAddress1?: string; /** * Shipping address city. */ shipToCity: string; /** * The shipping address province or state. */ shipToState: string; /** * Shipping address postal code. */ shipToPostalCode: string; /** * Shipping address country. */ shipToCountry: string; /** * The order's items. */ lineItems: Array | Array; /** * The order's packages. */ packages?: Array; constructor(lineItems: Array | Array, shipToName: string, shipToAddress: string, shipToCity: string, shipToState: string, shipToPostalCode: string, shipToCountry: string, phoneNumber: string, shipToAddress1?: string, status?: OrderStatus, packages?: Array, coupon?: string, userId?: string, paid?: boolean, channel?: string, createdAt?: string, shipmentMethod?: string, shipToCompany?: string, shipToContact?: string, orderType?: string); /** * The name of the order resource on the API server. */ static get resourceName(): string; /** * The name of the service containing the order resource. */ static get serviceName(): string; /** * Convert the order into a JSON serializable object for the API server. */ serializeAPI(): APIOrderRequest; /** * Deserialize the data from the API server. * * @param data The order data from the API server. */ deserializeAPI(data: APIOrderResponse): void; /** * Serialize the order into a format for storing in the Redux store. */ serializeRedux(): SavedStoreOrder; /** * Handle any http errors. * * @param response The response. * * @returns `null`. */ protected static handleError(response: Response): null; /** * Create a order from the API server data. * * @param data Data from the api server. * * @returns The order object. */ static apiFactory(data: APIOrderResponse): Order; /** * Create a order from the Redux store data. * * @param data Data from the api server. * * @returns The order object. */ static reduxFactory(data: StoreOrder): Order; /** * Check that the line items are consistent with the store line items. */ private checkSavedStoreLineItem; }