Skip to content

Give every hotel accurate rooms, night audit, and group holds - #407

Closed
telivity-otaip wants to merge 8 commits into
mainfrom
cursor/all-hotels-pms-fixes-0c0b
Closed

telivity-otaip wants to merge 8 commits into
mainfrom
cursor/all-hotels-pms-fixes-0c0b

Conversation

@telivity-otaip

@telivity-otaip telivity-otaip commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Every property gets the same inventory count, night-audit close, and group-block behavior.

  • Creating or retiring a room recounts active rooms onto properties.total_rooms. An occupied room, or a room linked to an in-house stay, cannot be retired. Migration 0033_sync_property_total_rooms.sql reconciles existing rows.
  • Occupancy, the financial summary, and the occupancy trend use the active-room count. properties.total_rooms is only the fallback when a property has no active rooms.
  • Night audit posts room charges and counts rooms sold only for stays that cover the business date (arrival <= date < departure). Overdue departures are recorded on the audit as overdue_departure warnings and overdueDeparturesCount, and the business date still rolls. Unattended mode extends one night only when settings.nightAudit.autoExtendOverdueStays is true and the room can be held.
  • POST /api/v1/night-audit/run-due closes every active property in its own IANA timezone after settings.nightAudit.autoCloseHour (default 2). A missing or invalid timezone is an error for that property and does not stop the others. Auth is HAIP_SERVICE_TOKEN (503 if unset, 401 if wrong). scripts/cron/night-audit-due.sh calls it. It is off unless you schedule it.
  • POST /groups/blocks accepts allocations, and PUT /groups/blocks/:id/inventory/span writes every night of a span in one transaction after a full-span availability check.
  • The housekeeping dashboard returns overdueTasksCount for open tasks dated before the property business date.

UI

  • apps/dashboard/src/pages/NightAudit.tsx: shows overdue departure warnings.
  • apps/dashboard/src/pages/Groups.tsx (plus en/fr copy): allocate a block across its whole stay.

Tests

pnpm lint, pnpm typecheck, and pnpm build pass. 2701 tests across 321 files pass.

cursoragent and others added 8 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>
Pending design and UX review. After a close, the night audit screen
lists overdue_departure warnings and links to the front desk and
reservations.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
Pending design and UX review. The inventory dialog can apply one room
count to every night of the block, and the night audit screen has copy
for overdue departures.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
@telivity-otaip
telivity-otaip deleted the cursor/all-hotels-pms-fixes-0c0b branch November 13, 2026 17:06
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