Plugin surface: write and retire calendar entries that belong to no application #887

Closed
opened 2026-10-10 16:35:01 +00:00 by tiagoagueda · 1 comment
Owner

A sync plugin can read the calendar but cannot put anything on it unless it is an interview of an application it already knows. An employment-service plugin needs to place dated entries of its own — a monthly declaration deadline, an expected payment — that belong to no application.

What exists today

  • Reminder(OwnedModel) (applications/models.py:651): application nullable, summary, due_at, done_at, notified_at, uid unique per owner. A reminder without an application is already allowed, and drawn by agenda.events_between() (applications/agenda.py:212-250).
  • The .ics import creates such rows directly (applications/ical_import.py:260-300) — core code.
  • Reminder and any writer for it are not on postulo.plugins.api.__all__; schedule_interview (services.py:396) is not either.

What would change

  • add_reminder(owner, *, summary, due_at, uid, source, note="") -> Reminder and retire_reminder(owner, uid) -> bool on the surface.
  • Idempotent by uid: a second call with the same uid updates summary, date and note in place, and never touches done_at (a person who ticked it keeps it ticked).
  • source records which plugin placed it (a plugin name), drawn beside the entry on the calendar and in its dialog, so the person sees where it came from; a reminder with a source is retired, not deleted, when that plugin is removed (the owns_models/erasure rules, CONTRIBUTING.md:876-951).
  • The .ics import moves onto the same writer.

Decisions

  • A field on Reminder or a SyncLink. Recommended: a source field — a SyncLink names a remote twin, and these entries have none.
  • Notifications. Recommended: these reminders notify like any other (the point of a deadline), with the plugin's name in the message.

Checked against main at 8c3d03570. Needed by tiagoagueda/postulo-francetravail, an independent plugin (its tiagoagueda/postulo-francetravail#3) outside Postulo's official repositories, but general to any country's employment service.

A sync plugin can read the calendar but cannot put anything on it unless it is an interview of an application it already knows. An employment-service plugin needs to place dated entries of its own — a monthly declaration deadline, an expected payment — that belong to no application. ## What exists today - `Reminder(OwnedModel)` (`applications/models.py:651`): `application` nullable, `summary`, `due_at`, `done_at`, `notified_at`, `uid` unique per owner. A reminder without an application is already allowed, and drawn by `agenda.events_between()` (`applications/agenda.py:212-250`). - The `.ics` import creates such rows directly (`applications/ical_import.py:260-300`) — core code. - `Reminder` and any writer for it are **not** on `postulo.plugins.api.__all__`; `schedule_interview` (`services.py:396`) is not either. ## What would change - `add_reminder(owner, *, summary, due_at, uid, source, note="") -> Reminder` and `retire_reminder(owner, uid) -> bool` on the surface. - Idempotent by `uid`: a second call with the same uid updates summary, date and note in place, and never touches `done_at` (a person who ticked it keeps it ticked). - `source` records which plugin placed it (a plugin name), drawn beside the entry on the calendar and in its dialog, so the person sees where it came from; a reminder with a `source` is retired, not deleted, when that plugin is removed (the `owns_models`/erasure rules, `CONTRIBUTING.md:876-951`). - The `.ics` import moves onto the same writer. ## Decisions - **A field on `Reminder` or a `SyncLink`.** Recommended: a `source` field — a SyncLink names a remote twin, and these entries have none. - **Notifications.** Recommended: these reminders notify like any other (the point of a deadline), with the plugin's name in the message. Checked against `main` at `8c3d03570`. Needed by [tiagoagueda/postulo-francetravail](https://source.tiagoagueda.com/tiagoagueda/postulo-francetravail), an independent plugin (its tiagoagueda/postulo-francetravail#3) outside Postulo's official repositories, but general to any country's employment service.
tiagoagueda added this to the 0.6.0 milestone 2026-10-10 16:35:01 +00:00
Author
Owner

Fixed in 0bb4fe8e7 on main.

Fixed in 0bb4fe8e7 on main.
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
Postulo/postulo#887
No description provided.