mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 03:40:56 +00:00
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import { IsString, IsDateString, IsInt, IsOptional } from 'class-validator';
|
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
export class CreateTripDto {
|
|
@ApiProperty() @IsString() serviceId: string;
|
|
@ApiProperty() @IsString() originStationId: string;
|
|
@ApiProperty() @IsString() destinationStationId: string;
|
|
@ApiProperty({ example: '2026-05-11T08:30:00Z' }) @IsDateString() departureAt: string;
|
|
@ApiProperty({ example: '2026-05-11T20:00:00Z' }) @IsDateString() arrivalAt: string;
|
|
@ApiPropertyOptional() @IsOptional() @IsInt() stopsCount?: number;
|
|
}
|
|
|
|
export class CreateFareRuleDto {
|
|
@ApiPropertyOptional() @IsOptional() @IsString() tripId?: string;
|
|
@ApiPropertyOptional() @IsOptional() @IsString() route?: string;
|
|
@ApiProperty({ example: 'seat-class-uuid' }) @IsString() seatClassId: string;
|
|
@ApiProperty({ example: 45000 }) @IsInt() baseFareMinor: number;
|
|
@ApiProperty({ example: '2026-01-01T00:00:00Z' }) @IsDateString() validFrom: string;
|
|
@ApiPropertyOptional() @IsOptional() @IsDateString() validUntil?: string;
|
|
}
|
|
|
|
export class UpdateTripStatusDto {
|
|
@ApiProperty({ example: 'EN_ROUTE' }) @IsString() status: string;
|
|
}
|