Skip to content

fix(availability): a meeting type's working hours are its whole week (#127) - #134

Merged
asm0dey merged 4 commits into
mainfrom
fix/127-per-type-hours-replace-global
Aug 17, 2026
Merged

fix(availability): a meeting type's working hours are its whole week (#127)#134
asm0dey merged 4 commits into
mainfrom
fix/127-per-type-hours-replace-global

Conversation

@asm0dey

@asm0dey asm0dey commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Closes #127.

The bug

A meeting type's weekly grid was a per-weekday override: a day it left blank fell back to the owner's global hours for that day-of-week (SlotService.windowsFor). So a type configured Mon+Tue only stayed bookable every other day the global grid covered — the reporter's booking page offered all seven days while the type's editor showed hours on two. There was also no way to say "not available on Thursday" for a single type, short of one date override per calendar date.

Not a regression: the fallback dates back to the first availability commit (25c8073). Ruled out along the way — #122 (viewer-local labels predate it), mis-owned rules (owner_id NOT NULL since V8).

The change

Weekly rules are now all-or-nothing per type:

  • type defines any rule → that grid is its week; a weekday with no frames is closed
  • type defines no rules → still inherits the owner's global week, live (editing the global grid keeps propagating to untouched types)
Type Thursday with no frames
has frames on other days closed
has no frames at all follows the global week
date override on that date override wins (no windows = day off)

No migration. Existing partly-configured types simply close the days they never filled in — that is the fix, not a side effect. (A V26 that back-filled those days from global was written and then dropped deliberately.)

Editor changes

So a first save can't silently close six days:

  • a type with no hours of its own renders its grid prefilled from the owner's global week — same for a co-host's own grid on a shared type
  • every day row gains a Remove availability button (workplan.js, data-clear-day) that empties that day; saving then closes it
  • the three working-hours hints reworded, de + he translated alongside

Tests

823/823 green.

  • SlotServiceTest.typeWithAnyRuleIsClosedOnTheDaysItLeavesBlank — written red first, confirmed failing against the old fallback
  • SlotServiceTest.typeWithoutOwnRulesStillUsesGlobalHours — pins the inherit path
  • AdminTypeHoursPrefillTest — prefill on, prefill off once the type owns hours, clear-day button on both grids

Follow-up

docs-site (usage/) still needs the new semantics written up — not in this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_017f4ahdPRUMmSQQcXvjkc9Y

asm0dey and others added 4 commits August 17, 2026 00:39
Per-(type, host) optional override of the write calendar, stored as a
(credential id, Google calendar id) pair so it survives the delete+reinsert
CalendarSelectionService.save() does to google_calendar rows. Lands after
calit-rma2, which stores the per-booking event address; without it, setting an
override on a type with future bookings orphans those events by design.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017f4ahdPRUMmSQQcXvjkc9Y
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017f4ahdPRUMmSQQcXvjkc9Y
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017f4ahdPRUMmSQQcXvjkc9Y
A meeting type's weekly grid used to be a per-WEEKDAY override: any day it
left blank fell back to the owner's global hours for that day-of-week. A type
configured for Mon+Tue only was therefore bookable every other day the global
grid covered, with no way to say "not available on Thursday" for one type
short of a date override per calendar date.

Weekly rules are now all-or-nothing per type. A type that defines ANY rule
owns its week and a weekday with no frames is closed; only a type with no
rules at all still inherits the global week (so editing the global grid keeps
propagating to types nobody has touched). No migration: existing partly
configured types simply close the days they never filled in, which is the
reported bug.

So that the first save cannot silently close six days, a type with no hours of
its own renders its grid PREFILLED from the owner's global week -- same for a
co-host's own grid on a shared type -- and every day row gains a "Remove
availability" button (workplan.js data-clear-day) that empties that day.

Hints reworded on all three grids, de + he translated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017f4ahdPRUMmSQQcXvjkc9Y
@sonarqubecloud

Copy link
Copy Markdown

@asm0dey
asm0dey merged commit dd79264 into main Aug 17, 2026
11 checks passed
@asm0dey
asm0dey deleted the fix/127-per-type-hours-replace-global branch August 17, 2026 08:00
asm0dey added a commit that referenced this pull request Aug 17, 2026
Brings in 1.20.2 and the per-type working-hours fix (#134).

Only conflict was the calit-rma2 bean file: main added an 'Amended
2026-08-17' note recording that google_calendar_id is text rather than
VARCHAR(255), while this branch closed the bean out. Both kept — the
amendment is the constraint V26 was written against.

pom.xml auto-merged cleanly: version 1.20.2 from main, jackson-core
2.22.2 and spotless 3.10.0 from this branch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017f4ahdPRUMmSQQcXvjkc9Y
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.

Booking page does not honor Working hours

1 participant