fix(api): effective-rate query whitelist + vacant_clean→vacant_dirty transition - #284
Merged
Merged
Conversation
…transition Day Zero P0s from haip-qa staging run: 1. getEffectiveRate binds @query() to EffectiveRateQueryDto while the global ValidationPipe runs forbidNonWhitelisted over the whole query object — propertyId was rejected ("property propertyId should not exist"), so every effective-rate call 400'd. Added optional propertyId to the DTO. 2. VALID_TRANSITIONS blocked vacant_clean → vacant_dirty, the KB 5.2-documented "clean room found dirty" path the desk needs. Added it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two Day Zero P0s from the haip-qa staging run (
friction/runs/2026-08-05-day-zero-r2/), both root-caused in Cloud's SPA↔engine contract audit:1. Effective Rate Calculator always 400s.
RatePlanController.getEffectiveRatebinds@Query('propertyId', ParseUUIDPipe)separately AND@Query() context: EffectiveRateQueryDto. The globalValidationPipe({ whitelist: true, forbidNonWhitelisted: true })validates the entire query object against the DTO —propertyIdis not a DTO field, so every call failed with400 "property propertyId should not exist". Added optionalpropertyIdto the DTO.2.
vacant_clean → vacant_dirtyrejected. The KB 5.2 chain documents "Vacant Clean → Vacant Dirty" (clean room found dirty — desk sends it back to HK), butVALID_TRANSITIONSinroom-status.service.tsdidn't allow it. Cloud's Rooms UI offered the button (matching the KB) and the engine 400'd. Added.Test plan
vitest run src/modules/room src/modules/rate-plan— 45/45 pass (incl. room-status.service.spec 16/16)Companion Cloud SPA PR: TelivityAI/haip-cloud#52 (Day Zero P0 batch).