booking: the Window type, so the parser and the slot arithmetic can be built apart
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 file changed,
+16
−0
internal/calendar/slots.go+16 −0
diff --git a/internal/calendar/slots.go b/internal/calendar/slots.go| new file mode 100644 |
| index 0000000..d519e6f |
| --- /dev/null |
| +++ b/internal/calendar/slots.go |
| @@ -0,0 +1,16 @@ |
| +package calendar |
| + |
| +import "time" |
| + |
| +// Window is one weekly availability window: a weekday and a half-open |
| +// span of minutes from that day's local midnight, [StartMin, EndMin). |
| +// |
| +// It is the plain value the availability parser produces and the slot |
| +// arithmetic consumes, and the value BookingWindow rows are read into. |
| +// Declared here, in the file that does the arithmetic, so that neither |
| +// the parser nor the store has to be compiled to talk about one. |
| +type Window struct { |
| + Weekday time.Weekday |
| + StartMin int |
| + EndMin int |
| +} |