feat(scheduling): tenant-wide standard due date for tasks and no-SLA tickets #257
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-345-standard-due-date"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Project tasks have a
due_date(NaiveDate) with no defaulting: created without one, they stay open-ended. Tickets get SLA-derived dates (sla_due_date/first_response_due/resolution_due) viacalculate_sla_dates, but a ticket matching no SLA returns early with those columns NULL, so it also has no due date.Goal
Let a tenant set a standard due date that applies whenever an explicit one is missing.
Proposed approach
New tenant setting
scheduling/default_due_business_days(integer 0..=365; 0 disables). Applied in two places:projects::service::create_task: whenrequest.due_dateis None, fall back to today + N business days.tickets::service::create_ticket: aftercalculate_sla_dates, fillsla_due_datewith the same fallback only when it is still NULL, so any SLA-derived date wins.Business-day math is a new
utils::datetime::add_business_days(skips Sat/Sun) with unit tests. The setting is read through asettings::read_default_due_business_daysfree function so both services apply it without depending onSettingsService.validate_setting_valuegains an arm rejecting out-of-range values (HTTP 422).Acceptance criteria
scheduling/default_due_business_dayssetting validated (0..=365, 0 disables)add_business_daysskips weekends, with unit testsFrontend Settings field to edit the value is a separate mokosh-apps PR.