WP-02: contracts and failing tests for settings, mail, jobs and scheduler
Some checks failed
CI / backend (push) Has been cancelled
CI / frontend (push) Has been cancelled
CI / ui (push) Has been cancelled

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Dennis Nemec
2026-09-02 22:08:23 +02:00
parent 12269051c4
commit 6113af0a19
21 changed files with 1115 additions and 0 deletions

View File

@ -0,0 +1,30 @@
//! Cron scheduler: decides which scheduled job kinds are due.
use chrono::{DateTime, Utc};
use domain::jobs::JobKind;
use domain::DomainError;
/// Validate a 6-field cron expression (seconds first).
pub fn validate_cron(_expr: &str) -> Result<(), DomainError> {
todo!()
}
/// Next fire time strictly after `after`.
pub fn next_fire(_expr: &str, _after: DateTime<Utc>) -> Option<DateTime<Utc>> {
todo!()
}
/// A job is due if a fire time exists in `(last_run, now]`. With no last run, it is due
/// if a fire time falls within the last `grace` seconds, so a fresh start does not
/// immediately run every job.
pub fn is_due(
_expr: &str,
_last_run: Option<DateTime<Utc>>,
_now: DateTime<Utc>,
_grace_secs: i64,
) -> bool {
todo!()
}
pub struct Scheduler {
pub kinds: Vec<JobKind>,
}