Skip to content

Rooms, night audit, and group holds for every hotel - #408

Closed
telivity-otaip wants to merge 6 commits into
mainfrom
cursor/haip-pms-backend-9072
Closed

telivity-otaip wants to merge 6 commits into
mainfrom
cursor/haip-pms-backend-9072

Conversation

@telivity-otaip

Copy link
Copy Markdown
Collaborator

Summary

Backend half of haip #407. The Night Audit and Groups screen commits stay on #407 for design review and are not in this pull.

  • Creating or retiring a room recounts properties.total_rooms. Migration 0033_sync_property_total_rooms.sql reconciles existing hotels. It has not been applied yet.
  • Occupancy uses the active-room count when the stored total has drifted.
  • Night audit posts room charges only for nights the stay covers. POST /api/v1/night-audit/run-due walks each active hotel in its own timezone after the local cutoff.
  • A group block can be allocated across its stay in one transaction.
  • Housekeeping returns overdueTasksCount. No badge is added here.

The hosted Cloud API uses the haip-cloud overlay for the hourly job. That overlay blocks a hotel while guests are still checked in past departure. This engine pull does not change that overlay.

Tests

The commits were already green on haip #407 (pnpm lint, pnpm typecheck, pnpm build, and the Postgres test run). This pull stops before the two UI commits, so CI runs again on this branch.

Open in Web Open in Cursor 

cursoragent and others added 6 commits November 13, 2026 14:42
Creating or retiring a room now recounts active rooms in the same
transaction. A room that is occupied or tied to an in-house stay cannot
be retired. Migration 0033 reconciles hotels that already drifted.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Occupancy, the financial summary, and the occupancy trend use the count
of active rooms already loaded for the report. properties.total_rooms is
only the fallback when a property has no active rooms yet.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Room charges and rooms sold only count stays that cover the business
date. Overdue departures are recorded and the date still rolls. An
unattended close extends one night only when the property opts in and
the room can be held. POST /night-audit/run-due walks every active
hotel in its IANA timezone after the local cutoff.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
POST /groups/blocks can carry allocations, and PUT
/groups/blocks/:id/inventory/span sets the same hold on every night of
a span. Sellable availability is checked for the whole span before any
row is written, and rooms already picked up are kept.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
The dashboard returns overdueTasksCount for pending, assigned, and
in-progress tasks whose service date is before the property's business
date. Seed cleanup is unchanged and real tasks are not skipped.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
@telivity-otaip
telivity-otaip deleted the cursor/haip-pms-backend-9072 branch November 13, 2026 17:07
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.

2 participants