Files
edr-platform/apps/edr-passenger-api/src/modules/excess-baggage/excess-baggage.dto.ts

58 lines
2.4 KiB
TypeScript

import { IsString, IsInt, IsOptional, IsPositive } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
export class LogExcessBaggageDto {
@ApiPropertyOptional({ example: 'booking-uuid', description: 'Booking UUID for the passenger booking' })
@IsOptional() @IsString() bookingId?: string;
@ApiPropertyOptional({ example: 'JS6MJ9', description: 'Booking reference for the passenger booking' })
@IsOptional() @IsString() bookingReference?: string;
@ApiPropertyOptional({ example: 'agent-uuid', description: 'Injected from IAM token; optional override' })
@IsOptional() @IsString() agentId?: string;
@ApiPropertyOptional({ example: '+251911223344', description: 'Override the phone the payment link SMS should go to. Defaults to the booking contact phone.' })
@IsOptional() @IsString() contactPhone?: string;
@ApiPropertyOptional({ example: 'passenger@example.com', description: 'Override the email the payment link should also be sent to. Defaults to the booking contact email.' })
@IsOptional() @IsString() contactEmail?: string;
@ApiProperty({ example: 7, description: 'Excess weight in kg above the free allowance' })
@IsInt() @IsPositive() excessWeightKg: number;
@ApiPropertyOptional({ description: 'Collect cash now instead of sending a payment link' })
@IsOptional() collectCash?: boolean;
}
export class WaiveChargeDto {
@ApiProperty() @IsString() waivedBy: string;
@ApiPropertyOptional() @IsOptional() @IsString() waivedReason?: string;
}
export class InitiateExcessPaymentDto {
@ApiProperty({
enum: [
'TELEBIRR',
'CBE_BIRR',
'EBIRR',
'WAAFI',
'DMONEY',
'CARD',
'CAC_BANK',
'CBE_BILL',
],
})
@IsString() method: string;
@ApiPropertyOptional({ enum: ['web', 'mobile'] }) @IsOptional() platform?: string;
@ApiPropertyOptional({
description:
'Payer account / mobile number. Required for the push-debit methods: CAC_BANK (the bank ' +
'SMSes a one-time password to this number) and EBIRR (the wallet pushes a USSD PIN prompt ' +
'to it). Normalised server-side by the payment service.',
example: '77123456',
})
@IsOptional() @IsString() payerAccount?: string;
}
export class ConfirmExcessOtpDto {
@ApiProperty({
description: 'One-time password the payer received by SMS (CAC Bank).',
example: '4530',
})
@IsString() otp: string;
}