Expand description
Deadline tracking for regulatory process timers.
Every MaKo process is subject to hard regulatory deadlines defined in the BDEW Application Handbooks. Deadline semantics vary by process family:
| Process family | Deadline unit | Helper |
|---|---|---|
| GPKE Lieferantenwechsel (BK6-22-024) | 24 wall-clock hours | fristen::add_hours |
| WiM / GeLi Gas / MABIS | Werktage | fristen::add_werktage |
Use the helpers in crate::fristen to compute the correct due_at
timestamp before constructing a Deadline.
The DeadlineStore persists these timers per process stream. A background
scheduler polls DeadlineStore::due_now and dispatches a
TimeoutDeadline command to the owning process when a deadline lapses.
The process workflow then handles the command — e.g. by escalating the
case or switching to a failure path.
§Usage
ⓘ
use mako_engine::fristen;
// GPKE 24h Lieferantenwechsel (BK6-22-024):
let due = fristen::add_hours(OffsetDateTime::now_utc(), 24);
// WiM 5-Werktage confirmation window:
let due = fristen::add_werktage(OffsetDateTime::now_utc().date(), 5,
fristen::HolidayCalendar::BdewMaKo).midnight().assume_utc();
let deadline = Deadline::new(
process.stream_id().clone(),
process.process_id(),
process.tenant_id(),
process.workflow_id().clone(),
"aperak-response-window",
due,
);
deadline_store.register(&deadline).await?;
// When the counterparty responds in time, cancel the deadline:
deadline_store.cancel(deadline.deadline_id()).await?;
// Background scheduler (runs every N minutes):
let result = deadline_store.due_now(100).await?;
for d in result.deadlines {
process_handle.execute(TimeoutDeadline { deadline_id: d.deadline_id() }).await?;
deadline_store.cancel(d.deadline_id()).await?;
}Structs§
- Deadline
- A registered regulatory deadline for a single process stream.
- DueNow
Result - Result of a
DeadlineStore::due_nowpoll. - Noop
Deadline Store - A
DeadlineStorethat never persists anything.
Traits§
- Deadline
Store - Storage contract for process deadlines.