Shared dispatch and run history for recurring work
Context
Several modules need recurrence, execution history and failure handling. Accounting uses one shared schedule mechanism and registers each owning module’s work handler.
Decision
Recurring Accounting work uses schedule rows owned by business records. A minute dispatcher claims due occurrences and publishes run messages to one queue; a consumer invokes registered handlers. Billing preparation is still among those handlers.
Alternatives Considered
Create a cloud schedule for every business record. This proposed alternative adds per-record infrastructure instead of timing saved with the owner’s database transaction.
Implement a scheduler in each owning module. That would duplicate claiming, retries, pause handling and run history.
Consequences
Owner changes and schedule changes can commit together.
A unique run does not prevent repeated unfinished handler execution. Invalid definitions and five consecutive failures pause future scheduling without an examined attention notice.
Moving Billing timing out of Accounting requires replacing the existing preparation work registration.