diff --git a/docs/MODULE_ARCHITECTURE.md b/docs/MODULE_ARCHITECTURE.md index 519dba2..8807277 100644 --- a/docs/MODULE_ARCHITECTURE.md +++ b/docs/MODULE_ARCHITECTURE.md @@ -217,6 +217,12 @@ Other stable runtime capabilities currently include: - `payments.requests` - `workflow.definitionContributions` and `workflow.runtimeWorker` +`calendar.scheduling` keeps workflow modules independent of Calendar-owned +models and transport adapters. Consumers may create tentative events, promote +the selected event in place, and release unused events idempotently. The +provider returns bounded external-delivery and outbox references so consumers +can retain retry state without copying Calendar's synchronization internals. + `application_status.projection` lets a presentation module resolve the tenant and display or request access to an owner-supplied, deliberately bounded applicant-status view. The provider retains policy, authorization, token, and diff --git a/src/govoplan_core/core/calendar.py b/src/govoplan_core/core/calendar.py index 51c7f73..9b8df76 100644 --- a/src/govoplan_core/core/calendar.py +++ b/src/govoplan_core/core/calendar.py @@ -45,6 +45,15 @@ class CalendarEventRef: outbox_operation_id: str | None = None +@dataclass(frozen=True, slots=True) +class CalendarEventReleaseRef: + event_id: str + accepted: bool = True + already_released: bool = False + external_state: str = "local_released" + outbox_operation_id: str | None = None + + @dataclass(frozen=True, slots=True) class CalendarInvitationAttendeeRequest: address: str @@ -156,6 +165,27 @@ class CalendarSchedulingProvider(Protocol): ) -> CalendarEventRef: ... + def promote_event( + self, + session: object, + *, + tenant_id: str, + user_id: str | None, + event_id: str, + request: CalendarEventRequest, + ) -> CalendarEventRef: + ... + + def release_event( + self, + session: object, + *, + tenant_id: str, + user_id: str | None, + event_id: str, + ) -> CalendarEventReleaseRef: + ... + @runtime_checkable class CalendarOutboxProvider(Protocol):