forked from yoone/API
1
0
Fork 0
API/src/dto/logistics.dto.ts

51 lines
1.2 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 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;
}