chore(occupancy): PR #178 second-pass P3 follow-ups (schedule records, event endpoints, repository queries) #211
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#211
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
These P3 findings from the second review pass on #178 (holiday and event context for investor analytics, #161) were deferred. None of them blocked the merge.
Standards
Deleting an exception edits a frozen record (
app/db/occupancy_repository.py:941).is_exception/exception_namebut leavesis_open=0and the hours. The glossary says the Business-Day Schedule Record "remains fixed".Repository fallback
is_holiday = is_openwhen the field is omitted (app/db/occupancy_repository.py:805).is_holiday, and the fallback defaults to non-holiday (is_holiday = 0) safely without breaking legacy tests.Timed events accept and store
start_date/end_dateon PUT.Event timezone relabelled on every update (
app/services/occupancy_service.py:421)._schedule_epochsclosed-day branch (app/services/occupancy_service.py:726)."04:00"rather than configured reset time._schedule_epochsclosed-day bounds computation.Quarantine loop N-queries per row (
app/services/occupancy_service.py:1491).is_event_day_asyncquery per row.domain_errors()wrapsEventItem.model_validate.domain_errors()validation wrappers.Duplicated code across event queries and derivations.
:2612,:2921), Event Day SQL predicate (4 places), exclusion blocks, andholiday_hoursderivation are repeated.Repeated
reset_timefallback in repository (app/db/occupancy_repository.py).if reset_time is None: cfg=...; configured_reset_time(cfg)and repository expands timed events into business days.reset_timeresolution in repository or require caller to pass it.Speculative generality.
start/endexport aliases;HolidayCreateOrUpdate | HolidayItemunion withgetattr(item, "reason");isinstance(str)check on always-string field.Spec
OccupancyLiveResponse.eventshas no consumer (app/schemas/occupancy_models.py:901).Refs #178, #161.
gabogg referenced this issue2026-10-02 18:17:14 +00:00
Item 1 (deleting an exception edits a frozen record) is resolved in PR #178 pass 3 (commit
dad4d93): re-saving and deleting schedule exceptions now syncs only is_holiday through the audited correction path (_sync_record_holiday_async), leaving frozen record hours and open status untouched and auditable.