mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 21:50:57 +00:00
34 lines
1.5 KiB
TypeScript
34 lines
1.5 KiB
TypeScript
import { IsString, IsInt, IsBoolean, IsOptional, IsArray, ValidateNested } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
export class AgentPassengerDto {
|
|
@ApiProperty() @IsString() fullName: string;
|
|
@ApiProperty() @IsString() phone: string;
|
|
@ApiProperty() @IsString() email: string;
|
|
@ApiProperty() @IsString() seatId: string;
|
|
@ApiPropertyOptional() @IsOptional() @IsString() idDocumentType?: string;
|
|
@ApiPropertyOptional() @IsOptional() @IsString() idDocumentNumber?: string;
|
|
}
|
|
|
|
export class CreateAgentBookingDto {
|
|
@ApiProperty() @IsString() agentId: string;
|
|
@ApiProperty({ example: 'schedule-uuid' }) @IsString() scheduleId: string;
|
|
@ApiProperty({ type: [AgentPassengerDto] }) @IsArray() @ValidateNested({ each: true }) @Type(() => AgentPassengerDto) passengers: AgentPassengerDto[];
|
|
@ApiProperty() @IsString() paymentMethod: string;
|
|
@ApiPropertyOptional() @IsOptional() @IsInt() cashReceived?: number;
|
|
@ApiPropertyOptional() @IsOptional() @IsBoolean() paperTicket?: boolean;
|
|
@ApiPropertyOptional() @IsOptional() @IsString() serviceClass?: string;
|
|
}
|
|
|
|
export class OpenShiftDto {
|
|
@ApiProperty() @IsString() agentId: string;
|
|
@ApiPropertyOptional() @IsOptional() @IsInt() openingBalance?: number;
|
|
}
|
|
|
|
export class CloseShiftDto {
|
|
@ApiProperty() @IsString() shiftId: string;
|
|
@ApiProperty() @IsInt() closingBalance: number;
|
|
@ApiPropertyOptional() @IsOptional() @IsString() notes?: string;
|
|
}
|