Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion apps/api/src/modules/rate-plan/dto/effective-rate-query.dto.ts
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
4 changes: 3 additions & 1 deletion apps/api/src/modules/room/room-status.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ type RoomStatus =
| 'out_of_service';

const VALID_TRANSITIONS: Record<RoomStatus, RoomStatus[]> = {
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'],
Expand Down
Loading