Skip to content

fix(cron): send mode unattended on scheduled night audit (TEL-230) - #406

Merged
telivity-otaip merged 2 commits into
mainfrom
cursor/night-audit-unattended-mode-a4c9
Nov 13, 2026
Merged

telivity-otaip merged 2 commits into
mainfrom
cursor/night-audit-unattended-mode-a4c9

Conversation

@telivity-otaip

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

Copy link
Copy Markdown
Collaborator

Summary

Scheduled night audit now identifies itself as an unattended close. haip-cloud#398 (TEL-230) treats any POST /api/v1/night-audit/run that omits "mode": "unattended" as a manual close, which is blocked while a guest is checked in past departure. The cron must send the field so those stays auto-extend one night and the business date still rolls.

Ship this with haip-cloud#398. Do not deploy one without the other: the cron without #398 is still a manual close on the hosted API, and #398 without this cron leaves the scheduled job blocked on overdue stays.

What changed

  • scripts/cron/night-audit.sh posts {"propertyId","businessDate","mode":"unattended"}. That was the only scheduled night-audit caller in this repo (no other cron script, worker, or workflow posts /night-audit/run).
  • Docs that describe the cron request now include the field: docs/operations/cron.md, scripts/cron/README.md, and the night-audit notes in README.md. Copying the example into EventBridge, Cloud Scheduler, or a Kubernetes CronJob keeps mode.
  • RunAuditDto.mode is optional (manual | unattended). The global pipe rejects unknown properties, so an older build of this API would 400 the extra field. This service accepts it and does not branch on it, so close behavior here is unchanged. The staff Night Audit screen still omits mode (manual).

Tests

  • apps/api/src/modules/night-audit/dto/run-audit.dto.spec.ts asserts the cron body, that every scripts/cron/*.sh caller of night-audit/run sends mode, and that the DTO accepts unattended and a body that omits mode.
  • Published counts are synced to 2681 passing tests across 315 files.
Open in Web Open in Cursor 

cursoragent and others added 2 commits November 13, 2026 11:09
The night-audit cron sends mode=unattended so a scheduled close is not
treated as a manual close. RunAuditDto accepts the optional field and
does not branch on it, so the extra property is not rejected.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
The night-audit cron spec adds four passing tests in one new file.

Co-authored-by: telivity-otaip <telivity-otaip@users.noreply.github.com>
@telivity-otaip
telivity-otaip merged commit 9f77626 into main Nov 13, 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.

2 participants