diff --git a/apps/api/src/modules/rate-plan/dto/effective-rate-query.dto.ts b/apps/api/src/modules/rate-plan/dto/effective-rate-query.dto.ts index 6d5aea5..ec22313 100644 --- a/apps/api/src/modules/rate-plan/dto/effective-rate-query.dto.ts +++ b/apps/api/src/modules/rate-plan/dto/effective-rate-query.dto.ts @@ -1,7 +1,16 @@ import { ApiPropertyOptional } from '@nestjs/swagger'; -import { IsDateString, IsInt, IsOptional, Min } from 'class-validator'; +import { IsDateString, IsInt, IsOptional, IsUUID, Min } from 'class-validator'; export class EffectiveRateQueryDto { + // The controller also binds propertyId via @Query('propertyId'), but the + // global ValidationPipe validates the WHOLE query object against this DTO — + // without this field every call 400s with "property propertyId should not + // exist" (forbidNonWhitelisted). Day Zero P0. + @ApiPropertyOptional({ description: 'Property ID (also bound by the controller)' }) + @IsOptional() + @IsUUID() + propertyId?: string; + @ApiPropertyOptional({ description: 'Length of stay in nights (alternative to checkIn/checkOut)' }) @IsOptional() @IsInt() diff --git a/apps/api/src/modules/room/room-status.service.ts b/apps/api/src/modules/room/room-status.service.ts index 3f41769..0f12571 100644 --- a/apps/api/src/modules/room/room-status.service.ts +++ b/apps/api/src/modules/room/room-status.service.ts @@ -20,7 +20,9 @@ type RoomStatus = | 'out_of_service'; const VALID_TRANSITIONS: Record = { - vacant_clean: ['occupied', 'out_of_order', 'out_of_service'], + // KB 5.2 chain: vacant_clean → vacant_dirty is the documented "clean room + // found dirty" path — the desk must be able to send a room back to HK. + vacant_clean: ['occupied', 'vacant_dirty', 'out_of_order', 'out_of_service'], vacant_dirty: ['clean', 'out_of_order'], clean: ['inspected', 'vacant_clean', 'out_of_order'], inspected: ['guest_ready', 'out_of_order'],