mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 04:08:11 +00:00
Refactored the whole app based on the requirements shared
This commit is contained in:
33
apps/edr-passenger-api/src/modules/agents/agents.dto.ts
Normal file
33
apps/edr-passenger-api/src/modules/agents/agents.dto.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
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() @IsString() tripId: 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;
|
||||
}
|
||||
Reference in New Issue
Block a user