Model schedule entry recurrence on create and read

Merged
MO
10h ago
+2855-21

Creating a schedule entry can now say how it repeats, as BC3 documents it:

  • recurrence_schedule holds frequency, days, week_instance, week_interval and month_interval.
  • A top-level recurs_until sets when it stops.

A schedule entry reads back its full ten-key recurrence_schedule. That also covers GetScheduleEntryOccurrence.

frequency is RecurrenceFrequency, an open enum, both in requests and in responses. Its nine known values are the ones BC3's RecurrenceSchedule validates against, and its Recurrence classes match them (app/models/recurrence/, at the pinned bc3 revision). A frequency BC3 adds later still decodes, as the unknown case with its raw string. Each SDK has a test for that.

This departs from the earlier draft, which read the response frequency as a plain string. The open enum gives the same tolerance, and names the known values too.

Go's CreateEntry validates the recurrence before sending it, because BC3 silently drops an invalid one. The check is stricter than the server: it rejects members that don't apply to the frequency, and recurs_until without a recurrence. Go's frequency constants are now typed RecurrenceFrequency* aliases of the generated enum, replacing the untyped RecurrenceEvery* strings in the earlier draft.

spec/api-gaps/schedule-recurrence-writes.md moves to partial-coverage. ReplaceScheduleEntry still takes no recurrence, which the entry explains.

No to-do write path changes here: repetition_schedule on to-dos is #1161's, and nothing here echoes it.

Swift is regenerated, along with the six other SDKs.

Closes #548