mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
27 lines
1.7 KiB
TypeScript
27 lines
1.7 KiB
TypeScript
import { IsString, IsDateString, IsInt, IsOptional, Min, IsEnum } from 'class-validator';
|
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { Type } from 'class-transformer';
|
|
import { Currency } from '@prisma/client';
|
|
|
|
export class SearchTripsDto {
|
|
@ApiProperty({ example: 'st_ADD' }) @IsString() originStationId: string;
|
|
@ApiProperty({ example: 'st_DJI' }) @IsString() destinationStationId: string;
|
|
@ApiProperty({ example: '2026-05-11' }) @IsDateString() date: string;
|
|
@ApiProperty({ example: 2, description: 'Number of adults (5 years and above)' }) @Type(() => Number) @IsInt() @Min(1) adultCount: number;
|
|
@ApiPropertyOptional({ example: 1, description: 'Number of children (below 5 years)' }) @IsOptional() @Type(() => Number) @IsInt() @Min(0) childCount?: number;
|
|
}
|
|
|
|
export class FareQuoteDto {
|
|
@ApiProperty() @IsString() tripId: string;
|
|
@ApiProperty({
|
|
example: 'ECONOMY_REGULAR',
|
|
enum: ['ECONOMY_REGULAR', 'ECONOMY_BED_LOWER', 'ECONOMY_BED_MIDDLE', 'ECONOMY_BED_UPPER', 'VIP_BED_LOWER', 'VIP_BED_UPPER']
|
|
})
|
|
@IsString() serviceClass: string;
|
|
@ApiProperty({ example: 2, description: 'Number of adults' }) @Type(() => Number) @IsInt() @Min(1) adultCount: number;
|
|
@ApiPropertyOptional({ example: 1, description: 'Number of children' }) @IsOptional() @Type(() => Number) @IsInt() @Min(0) childCount?: number;
|
|
@ApiPropertyOptional({ example: 'WEEKEND15' }) @IsOptional() @IsString() promoCode?: string;
|
|
@ApiPropertyOptional({ example: 450 }) @IsOptional() @Type(() => Number) @IsInt() loyaltyRedemptionPoints?: number;
|
|
@ApiPropertyOptional({ example: 'ETB', enum: ['ETB', 'DJF', 'USD'] }) @IsOptional() @IsEnum(Currency) displayCurrency?: Currency;
|
|
}
|