chore(schedule): third-pass P3 follow-ups from PR #222 #274

Open
opened 2026-10-03 20:17:32 +00:00 by gabogg · 0 comments
Owner

Third-pass P3 findings from PR #222 (review on #222, spec #184 + #258). None blocks merge.

  • Duplicated blank-to-null name logic. HolidayItem.normalize_stored_name (app/schemas/occupancy_models.py:493-496), app/services/occupancy_service.py:1254 and :1283 all strip a name and map blank to None; :1283 also relies on A or B if C else D precedence. Extract one helper (e.g. stored_exception_name(value) -> str | None) and call it from all three.
  • Test nits.
    • tests/test_occupancy.py:177-178 rebuilds the expected label with the production fallback. Pin the literal day name.
    • test_unnamed_exception_stamped_and_live_remain_null (tests/test_next_day_settings_activation.py:1555) never checks live info. Assert /api/occupancy/live holiday_name is None for a current-day unnamed exception, or rename the test.
    • The same test hard-codes 2026-01-15; derive the past date relative to now.
  • Spanish "jornada comercial" means two things. app/static/js/i18n.js:78 (timespanWorkingHours) uses it for opening hours; :230 (operationalCycleDesc) uses it for the business cycle. Reword :230 to "...Mantiene unida la jornada nocturna".
  • Admin correction of an unnamed exception day. app.js:2383 prefills exception_name with ''; submitting with is_exception returns 422 because corrections require a name (intended, documented in CONTEXT.md:131). Add a client-side hint before submit.
Third-pass P3 findings from PR #222 (review on #222, spec #184 + #258). None blocks merge. - [ ] **Duplicated blank-to-null name logic.** `HolidayItem.normalize_stored_name` (`app/schemas/occupancy_models.py:493-496`), `app/services/occupancy_service.py:1254` and `:1283` all strip a name and map blank to `None`; `:1283` also relies on `A or B if C else D` precedence. Extract one helper (e.g. `stored_exception_name(value) -> str | None`) and call it from all three. - [ ] **Test nits.** - `tests/test_occupancy.py:177-178` rebuilds the expected label with the production fallback. Pin the literal day name. - `test_unnamed_exception_stamped_and_live_remain_null` (`tests/test_next_day_settings_activation.py:1555`) never checks live info. Assert `/api/occupancy/live` `holiday_name is None` for a current-day unnamed exception, or rename the test. - The same test hard-codes `2026-01-15`; derive the past date relative to now. - [ ] **Spanish "jornada comercial" means two things.** `app/static/js/i18n.js:78` (`timespanWorkingHours`) uses it for opening hours; `:230` (`operationalCycleDesc`) uses it for the business cycle. Reword `:230` to "...Mantiene unida la jornada nocturna". - [ ] **Admin correction of an unnamed exception day.** `app.js:2383` prefills `exception_name` with `''`; submitting with `is_exception` returns 422 because corrections require a name (intended, documented in CONTEXT.md:131). Add a client-side hint before submit.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gabogg/hikcentral#274
No description provided.