Spaces:
Runtime error
Runtime error
| import { IsString, IsOptional, IsDate, IsInt, IsDecimal, MaxLength } from 'class-validator'; | |
| import { ApiProperty } from '@nestjs/swagger'; | |
| import { Type, Transform } from 'class-transformer'; | |
| import { CreateOrderDetailDto } from './create-order-detail.dto'; | |
| import { BaseDto } from '../base.dto'; | |
| export class OrderDto extends BaseDto { | |
| ({ | |
| description: 'Unique identifier for the order', | |
| example: 1, | |
| }) | |
| () | |
| OrderID: number; | |
| ({ | |
| description: 'Customer ID associated with the order', | |
| example: 1, | |
| }) | |
| // @IsInt() | |
| CustomerID: string; | |
| ({ | |
| description: 'Employee ID handling the order', | |
| example: 1, | |
| }) | |
| () | |
| EmployeeID: number; | |
| ({ | |
| description: 'Order details associated with the order', | |
| example: [ | |
| { | |
| OrderDetailID: 1, | |
| ProductID: 5, | |
| Quantity: 10, | |
| UnitPrice: 19.99 | |
| }, | |
| ], | |
| required: false, | |
| }) | |
| () | |
| OrderDetails: CreateOrderDetailDto[]; | |
| ({ | |
| description: 'The date when the order was placed', | |
| example: '2023-05-22T13:45:00Z', | |
| required: false, | |
| }) | |
| (({ value }) => new Date(value)) | |
| () | |
| () | |
| (() => Date) | |
| OrderDate: Date; | |
| ({ | |
| description: 'The required date for delivery', | |
| example: '2023-06-01T00:00:00Z', | |
| required: false, | |
| }) | |
| (({ value }) => new Date(value)) | |
| () | |
| () | |
| (() => Date) | |
| RequiredDate: Date; | |
| ({ | |
| description: 'The actual shipping date', | |
| example: '2023-05-25T00:00:00Z', | |
| required: false, | |
| }) | |
| (({ value }) => new Date(value)) | |
| () | |
| () | |
| (() => Date) | |
| ShippedDate: Date; | |
| ({ | |
| description: 'Shipper ID used for the order', | |
| example: 1, | |
| required: false, | |
| }) | |
| () | |
| () | |
| ShipVia: number; | |
| ({ | |
| description: 'Freight charges for shipping', | |
| example: 45.99, | |
| required: false, | |
| }) | |
| () | |
| () | |
| Freight: number; | |
| ({ | |
| description: 'Name of the recipient for shipping', | |
| example: 'John Doe', | |
| required: false, | |
| }) | |
| () | |
| () | |
| (60) | |
| ShipName: string; | |
| ({ | |
| description: 'Address to which the order should be shipped', | |
| example: '123 Tech St, Silicon Valley, CA', | |
| required: false, | |
| }) | |
| () | |
| () | |
| (60) | |
| ShipAddress: string; | |
| ({ | |
| description: 'City where the order should be shipped', | |
| example: 'San Francisco', | |
| required: false, | |
| }) | |
| () | |
| () | |
| (15) | |
| ShipCity: string; | |
| ({ | |
| description: 'Region where the order should be shipped', | |
| example: 'CA', | |
| required: false, | |
| }) | |
| () | |
| () | |
| (15) | |
| ShipRegion: string; | |
| ({ | |
| description: 'Postal code for shipping destination', | |
| example: '94107', | |
| required: false, | |
| }) | |
| () | |
| () | |
| (10) | |
| ShipPostalCode: string; | |
| ({ | |
| description: 'Country where the order should be shipped', | |
| example: 'USA', | |
| required: false, | |
| }) | |
| () | |
| () | |
| (15) | |
| ShipCountry: string; | |
| } | |