Repository navigation
fix(cron): send mode unattended on scheduled night audit (TEL-230) - #406
Merged
Merged
Conversation
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>
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
Scheduled night audit now identifies itself as an unattended close. haip-cloud#398 (TEL-230) treats any
POST /api/v1/night-audit/runthat 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.shposts{"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/operations/cron.md,scripts/cron/README.md, and the night-audit notes inREADME.md. Copying the example into EventBridge, Cloud Scheduler, or a Kubernetes CronJob keepsmode.RunAuditDto.modeis 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 omitsmode(manual).Tests
apps/api/src/modules/night-audit/dto/run-audit.dto.spec.tsasserts the cron body, that everyscripts/cron/*.shcaller ofnight-audit/runsendsmode, and that the DTO acceptsunattendedand a body that omitsmode.