import { Order as IOrder, ORDER_STATUS, DraftItem as IDraftItem, SubItem as ISubItem, Product as IProduct, CreateOrderOption as ICreateOrderOption, PickupOptions as IPickupOptions, DineInOptions as IDineInOptions, BaseOrderOption as IBaseOrderOptions, AcceptOrderOption as IAcceptOrderOption, DeclineOrderOption as IDeclineOrderOption, OrderPayment as IOrderPayment, GetRestaurantSlotActiveBillsDto as IGetRestaurantSlotActiveBillsDto, GetRestaurantSlotBillEffectDto as IGetRestaurantSlotBillEffectDto, ORDER_TYPE, PAYMENT_TYPE, DeliveryOrderDto as IDeliveryOrderDto, OrderDto as IOrderDto, RefundDto as IRefundDto, NotifyPickupReadyDto as INotifyPickupReadyDto } from './order.interface'; import { Ref } from '@typegoose/typegoose'; import { Restaurant, PickupPoint, OfflinePaymentType } from '~backend/business/business.model'; import { Bill, VariantSelected as IVariantSelected } from '~core/modules/order/definitions'; import { Types } from 'mongoose'; import { DineroObject } from '~backend/utils/model'; import { PaymentTransaction } from '~backend/payment/payment.model'; import { Effect } from '~backend/marketing/marketing.model'; import { CreditTransaction } from '~backend/marketing/credit/credit.model'; import DineroFactory from 'dinero.js'; import { Address as IAddress, Coordinates as ICoordinates, DELIVERY_PROVIDER_TYPE, DELIVERY_STATUS, DeliveryOption as IDeliveryOption, BaseDeliveryOption as IBaseDeliveryOption, Product as IQuoteProduct, QuoteOption as IQuoteOption, QuoteDeliveryFee as IQuoteDeliveryFee, DELIVERY_TYPE } from './delivery/delivery.interface'; import { GrabExpressProvider, ManualProvider, PandaGoProvider, KosmoProvider } from './delivery/delivery.model'; export declare class Coordinates implements ICoordinates { lat: number; lng: number; } export declare class Address implements IAddress { addressLine: string; coordinates?: Coordinates; } export declare class QuoteProduct implements IQuoteProduct { name: string; quantity: number; price: DineroObject; } export declare class QuoteOption implements IQuoteOption { restaurantId: string; destination: Address; products?: QuoteProduct[]; } declare class QuoteDeliveryFee implements IQuoteDeliveryFee { providerType: DELIVERY_PROVIDER_TYPE; providerQuote: DineroObject; surcharge: DineroObject; get total(): DineroFactory.DineroObject; } export declare class BaseOrderOption implements IBaseOrderOptions { type: ORDER_TYPE; } export declare class DineInOptions extends BaseOrderOption implements IDineInOptions { type: ORDER_TYPE.DINE_IN; slot: string; session?: string; pax?: number; } export declare class PickupOptions extends BaseOrderOption implements IPickupOptions { type: ORDER_TYPE.PICKUP; contactNumber: string; pickupAt: string; remark?: string | null; pickupPoint?: PickupPoint; } declare class BaseDeliveryOption extends BaseOrderOption implements IBaseDeliveryOption { type: ORDER_TYPE.DELIVERY; addressLine: string; lat: number; lng: number; contactNumber: string; status: DELIVERY_STATUS; deliveryFee: DineroObject; quoteDeliveryFee: QuoteDeliveryFee; deliveryType?: DELIVERY_TYPE; remark?: string; deliveryAt: string; } declare class DeliveryOption extends BaseDeliveryOption implements IDeliveryOption { providers?: (GrabExpressProvider | PandaGoProvider | KosmoProvider | ManualProvider)[]; allocatingAt?: Date; get actualCost(): DineroObject; } export declare class VariantSelected implements IVariantSelected { name: string[]; combinationKey: string; } export declare class Product implements IProduct { name: string; price: DineroObject; } export declare class SubSubItem implements ISubItem { selection: string; price: DineroObject; name: string; quantity: number; variantSelected?: VariantSelected | null; } export declare class SubItem implements ISubItem { selection: string; price: DineroObject; name: string; quantity: number; variantSelected?: VariantSelected | null; subItems?: SubSubItem[]; } export declare class DraftItem implements IDraftItem { id?: string; productId: string; subItems: SubItem[]; quantity: number; remark: string | null; product: Product; variantSelected?: VariantSelected | null; is?: { takeaway: boolean; }; } export declare class OrderPayment implements IOrderPayment { type: PAYMENT_TYPE; offlinePaymentType?: OfflinePaymentType; transactions?: Ref[]; credits?: Ref[]; } export declare class Order implements IOrder { _id: Types.ObjectId; _bill?: Bill; get bill(): Bill; get id(): string; status: ORDER_STATUS; orderAt: Date; restaurant: Ref; userId: string; userName: string; option: DeliveryOption | DineInOptions | PickupOptions; billId: string | null; draft: DraftItem[]; payment: OrderPayment; rejectReason?: string; effects?: Effect[]; } export declare class CreateOrderOption implements ICreateOrderOption { restaurant: string; userId: string; userName: string; option: DeliveryOption | PickupOptions | DineInOptions; draft: DraftItem[]; payment?: OrderPayment; effects?: Effect[]; } export declare class AcceptOrderOption implements IAcceptOrderOption { billId: string; } export declare class DeclineOrderOption implements IDeclineOrderOption { reason?: string; } export declare class GetRestaurantSlotActiveBillsDto implements IGetRestaurantSlotActiveBillsDto { restaurantId: string; slot: string; } export declare class GetRestaurantSlotBillEffectDto implements IGetRestaurantSlotBillEffectDto { restaurantId: string; slot: string; } /** * @deprecated Use OrderDto instead */ export declare class DeliveryOrderDto implements IDeliveryOrderDto { skip?: number; limit?: number; deliveryType?: DELIVERY_PROVIDER_TYPE[]; userId?: string; restaurant?: string; orderStatus?: ORDER_STATUS[]; deliveryStatus?: DELIVERY_STATUS[]; excludeDeliveryStatus?: DELIVERY_STATUS[]; ascending?: number; } export declare class OrderDto implements IOrderDto { skip?: number; limit?: number; deliveryType?: DELIVERY_PROVIDER_TYPE[]; userId?: string; restaurant?: string; orderStatus?: ORDER_STATUS[]; deliveryStatus?: DELIVERY_STATUS[]; excludeDeliveryStatus?: DELIVERY_STATUS[]; ascending?: number; orderType: ORDER_TYPE[]; } export declare class RefundDto implements IRefundDto { orderId: string; reason?: string; } export declare class NotifyPickupReadyDto implements INotifyPickupReadyDto { orderNumber: string; customerName: string; phoneNumber: string; pickupPoint?: PickupPoint | null; } export {};