allow customers booking

This commit is contained in:
marshal
2026-05-28 10:31:31 +03:00
parent ffd38f8025
commit 6d49c38f48
5 changed files with 56 additions and 16 deletions

View File

@@ -69,14 +69,16 @@ export class ContainerItem {
export class CreateBookingDto {
// ── core ─────────────────────────────────────────────────────────────
@ApiProperty({ description: "Unique booking reference" })
@ApiPropertyOptional({ description: "Unique booking reference (auto-generated if not provided)" })
@IsOptional()
@IsString()
@Transform(({ value }) => (typeof value === "string" ? value.trim() : value))
reference!: string;
reference?: string;
@ApiProperty({ format: "uuid" })
@ApiPropertyOptional({ format: "uuid", description: "Admin only: target customer. Omit to resolve from auth token." })
@IsOptional()
@IsUUID()
customerId!: string;
customerId?: string;
@ApiPropertyOptional({ format: "uuid" })
@IsOptional()
@@ -87,16 +89,6 @@ export class CreateBookingDto {
@IsDateString()
scheduledDate!: string;
@ApiProperty({ minimum: 0 })
@IsNumber()
@Min(0)
@Transform(({ value }) => Number(value))
totalAmount!: number;
@ApiPropertyOptional({ enum: PAYMENT_STATUSES, default: "PENDING" })
@IsOptional()
@IsIn([...PAYMENT_STATUSES])
paymentStatus?: string;
// ── contract ─────────────────────────────────────────────────────────
@ApiProperty({ enum: CONTRACT_TYPES })