76 lines
1.7 KiB
TypeScript
76 lines
1.7 KiB
TypeScript
import { Product } from "src/modules/product/entities/product.entity"
|
|
import { Order } from "../entities/order.entity"
|
|
|
|
export enum OrderStatusEnum {
|
|
CREATED = 'created',
|
|
|
|
INVOICED = 'invoiced',
|
|
WAITING_to_CONFIRM_INVOICE = 'waiting_to_confirm_invoice',
|
|
|
|
|
|
DESIGN_INITIATED = 'design_initiated',
|
|
DESIGN_FINISHED = 'design_finished',
|
|
DESIGN_REVISION = 'design_revision',
|
|
|
|
READY_TO_PRINTING = 'ready_to_printing',
|
|
IN_PRINTING = 'in_printing',
|
|
|
|
READY_FOR_DELIVERY = 'ready_for_delivery',
|
|
DELIVERED = 'delivered',
|
|
|
|
AFTER_PRINT_COVER = 'after_print_cover',
|
|
AFTER_PRINT_BOXING = 'after_print_boxing',
|
|
AFTER_PRINT_CARTONING = 'after_print_cartoning',
|
|
|
|
|
|
FINISHED = 'finished',
|
|
|
|
CANCELED = 'canceled',
|
|
}
|
|
|
|
|
|
export interface CreateOrderItemParam{
|
|
quantity: number
|
|
attributes?: IAttribute[]
|
|
description?: string
|
|
attachments?: { url: string, type: string }[]
|
|
unitPrice?: number
|
|
discount?: number
|
|
}
|
|
|
|
|
|
export interface CreateOrderParam {
|
|
userId: string
|
|
items: Array<{
|
|
productId: number,
|
|
quantity: number
|
|
attributes: IAttribute[]
|
|
description: string
|
|
attachments: { url: string, type: string }[]
|
|
unitPrice?: number
|
|
discount?: number
|
|
}>;
|
|
status: OrderStatusEnum
|
|
//optional
|
|
enableTax?: Boolean
|
|
attachments?: string[]
|
|
paymentMethod?: string
|
|
adminId?: string
|
|
estimatedDays?: number
|
|
designerId?: string
|
|
}
|
|
|
|
export type UpdateOrderParam = Partial<Omit<CreateOrderParam, 'items'>>
|
|
|
|
|
|
export interface UpdateOrderItem {
|
|
productId?: number,
|
|
quantity?: number
|
|
attributes?: IAttribute[]
|
|
description?: string
|
|
attachments?: { url: string, type: string }[]
|
|
unitPrice?: number
|
|
discount?: number
|
|
}
|
|
|
|
export interface IAttribute { attributeId: number, value: string | number | boolean } |