Skip to content

fix(api): effective-rate query whitelist + vacant_clean→vacant_dirty transition - #284

Merged
telivity-otaip merged 1 commit into
mainfrom
cursor/day-zero-engine-fixes-6aaa
Aug 5, 2026
Merged

fix(api): effective-rate query whitelist + vacant_clean→vacant_dirty transition#284
telivity-otaip merged 1 commit into
mainfrom
cursor/day-zero-engine-fixes-6aaa

Conversation

@telivity-otaip

Copy link
Copy Markdown
Collaborator

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.getEffectiveRate binds @Query('propertyId', ParseUUIDPipe) separately AND @Query() context: EffectiveRateQueryDto. The global ValidationPipe({ whitelist: true, forbidNonWhitelisted: true }) validates the entire query object against the DTO — propertyId is not a DTO field, so every call failed with 400 "property propertyId should not exist". Added optional propertyId to the DTO.

2. vacant_clean → vacant_dirty rejected. The KB 5.2 chain documents "Vacant Clean → Vacant Dirty" (clean room found dirty — desk sends it back to HK), but VALID_TRANSITIONS in room-status.service.ts didn'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)
  • Staging: Rate Plans → Effective Rate Calculator → Calculate returns a rate; Rooms → vacant_clean room → "→ vacant dirty" persists

Companion Cloud SPA PR: TelivityAI/haip-cloud#52 (Day Zero P0 batch).

…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.
@telivity-otaip
telivity-otaip merged commit 140ee65 into main Aug 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant