132 lines
2.5 KiB
TypeScript
132 lines
2.5 KiB
TypeScript
import { ApiProperty } from '@midwayjs/swagger';
|
|
import { ErpOrderStatus } from '../enums/base.enum';
|
|
import { Rule, RuleType } from '@midwayjs/validate';
|
|
// import { Shipment } from '../entity/shipment.entity';
|
|
// import { ShipmentItem } from '../entity/shipment_item.entity';
|
|
|
|
export class OrderAddress {
|
|
@ApiProperty()
|
|
first_name: string;
|
|
|
|
@ApiProperty()
|
|
last_name: string;
|
|
|
|
@ApiProperty()
|
|
company: string;
|
|
|
|
@ApiProperty()
|
|
address_1: string;
|
|
|
|
@ApiProperty()
|
|
address_2: string;
|
|
|
|
@ApiProperty()
|
|
city: string;
|
|
|
|
@ApiProperty()
|
|
state: string;
|
|
|
|
@ApiProperty()
|
|
postcode: string;
|
|
|
|
@ApiProperty()
|
|
country: string;
|
|
|
|
@ApiProperty()
|
|
email: string;
|
|
|
|
@ApiProperty()
|
|
phone: string;
|
|
}
|
|
|
|
export class OrderStatusCountDTO {
|
|
@ApiProperty()
|
|
status: ErpOrderStatus;
|
|
|
|
@ApiProperty()
|
|
count: number;
|
|
}
|
|
|
|
export class QueryOrderDTO {
|
|
@ApiProperty({ example: '1', description: '页码' })
|
|
@Rule(RuleType.number())
|
|
current: number;
|
|
|
|
@ApiProperty({ example: '10', description: '每页大小' })
|
|
@Rule(RuleType.number())
|
|
pageSize: number;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.string())
|
|
externalOrderId: string;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.string())
|
|
siteId: string;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.string().allow(''))
|
|
customer_email: string;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.string().allow(null))
|
|
keyword: string;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.date())
|
|
startDate: Date;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.date())
|
|
endDate: Date;
|
|
|
|
@ApiProperty({ type: 'enum', enum: ErpOrderStatus })
|
|
@Rule(RuleType.string().valid(...Object.values(ErpOrderStatus)))
|
|
status: ErpOrderStatus;
|
|
}
|
|
|
|
export class QueryOrderSalesDTO {
|
|
@ApiProperty()
|
|
@Rule(RuleType.bool().default(false))
|
|
isSource: boolean;
|
|
|
|
@ApiProperty({ example: '1', description: '页码' })
|
|
@Rule(RuleType.number())
|
|
current: number;
|
|
|
|
@ApiProperty({ example: '10', description: '每页大小' })
|
|
@Rule(RuleType.number())
|
|
pageSize: number;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.string())
|
|
siteId: string;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.string())
|
|
name: string;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.date().required())
|
|
startDate: Date;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.date().required())
|
|
endDate: Date;
|
|
}
|
|
|
|
// export class Tracking extends Shipment {
|
|
// @ApiProperty({ type: ShipmentItem, isArray: true })
|
|
// products?: ShipmentItem[];
|
|
// }
|
|
|
|
export class CreateOrderNoteDTO {
|
|
@ApiProperty()
|
|
@Rule(RuleType.number())
|
|
orderId: number;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.string())
|
|
content: string;
|
|
}
|