95 lines
2.0 KiB
TypeScript
95 lines
2.0 KiB
TypeScript
import { ApiProperty } from '@midwayjs/swagger';
|
|
import { ShippingDetailsDTO } from './freightcom.dto';
|
|
import { Rule, RuleType } from '@midwayjs/validate';
|
|
import { OrderSale } from '../entity/order_sale.entity';
|
|
|
|
export class ShipmentBookDTO {
|
|
@ApiProperty({ type: OrderSale, isArray: true })
|
|
@Rule(RuleType.array<OrderSale>())
|
|
sales: OrderSale[];
|
|
|
|
@ApiProperty({ type: ShippingDetailsDTO })
|
|
@Rule(RuleType.object<ShippingDetailsDTO>())
|
|
details: ShippingDetailsDTO;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.number())
|
|
stockPointId: number;
|
|
|
|
@ApiProperty({ type: 'number', isArray: true })
|
|
@Rule(RuleType.array<number>().default([]))
|
|
orderIds?: number[];
|
|
}
|
|
|
|
export class ShipmentFeeBookDTO {
|
|
@ApiProperty()
|
|
stockPointId: number;
|
|
@ApiProperty()
|
|
sender: string;
|
|
@ApiProperty()
|
|
startPhone: string;
|
|
@ApiProperty()
|
|
startPostalCode: string;
|
|
@ApiProperty()
|
|
pickupAddress: string;
|
|
// pickupWarehouse: number; // 此处用 stockPointId 到后端解析
|
|
@ApiProperty()
|
|
shipperCountryCode: string;
|
|
@ApiProperty()
|
|
receiver: string;
|
|
@ApiProperty()
|
|
city: string;
|
|
@ApiProperty()
|
|
province: string;
|
|
@ApiProperty()
|
|
country: string;
|
|
@ApiProperty()
|
|
postalCode: string;
|
|
@ApiProperty()
|
|
deliveryAddress: string;
|
|
@ApiProperty()
|
|
receiverPhone: string;
|
|
@ApiProperty()
|
|
receiverEmail: string;
|
|
@ApiProperty()
|
|
length: number;
|
|
@ApiProperty()
|
|
width: number;
|
|
@ApiProperty()
|
|
height: number;
|
|
@ApiProperty()
|
|
dimensionUom: string;
|
|
@ApiProperty()
|
|
weight: number;
|
|
@ApiProperty()
|
|
weightUom: string;
|
|
}
|
|
|
|
export class PaymentMethodDTO {
|
|
@ApiProperty()
|
|
id: string;
|
|
|
|
@ApiProperty()
|
|
type: string;
|
|
|
|
@ApiProperty()
|
|
label: string;
|
|
}
|
|
export class QueryServiceDTO {
|
|
@ApiProperty({ example: '1', description: '页码' })
|
|
@Rule(RuleType.number())
|
|
current: number;
|
|
|
|
@ApiProperty({ example: '10', description: '每页大小' })
|
|
@Rule(RuleType.number())
|
|
pageSize: number;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.string())
|
|
carrier_name: string;
|
|
|
|
@ApiProperty()
|
|
@Rule(RuleType.bool())
|
|
isActive: boolean;
|
|
}
|