dodil/erp-brick-timesheets
DODIL ERP brick: timesheets
src/brick_timesheets/domain/values.py
"""The settings a customer edits (dated rows in ts_settings) and what their defaults are; the defaults a company starts with.
Code never knows a country: the business date is read in `business_timezone`, the approval route is a row."""
# key -> (default, what it changes, controls?). A control is held by the owner alone (ts:settings:controls).
SETTING_DEFS = {
"approval_route": ("manager", "manager | project_lead_then_manager", True),
"missing_hours_mode": ("block", "block | warn when a working day is not covered", True),
"max_day_hours": ("12.00", "hours on a day above which a note is asked", False),
"time_increment_minutes": ("15", "the smallest step of time", False),
"submit_due": ("MON 10:00", "when last week's sheet is due", False),
"approval_reminder_days": ("2", "business days before an approver is reminded", False),
"billing_day": ("month_end", "when contract and manual T&M projects are billed", False),
"overtime_rule": ("weekly_above_contracted", "weekly_above_contracted | daily_above_contracted | none", False),
"business_timezone": ("Europe/London", "the zone 'today' is counted in", True),
}
ROUTES = ("manager", "project_lead_then_manager")
MODES = ("block", "warn")
OVERTIME_RULES = ("weekly_above_contracted", "daily_above_contracted", "none")
# Activities every company starts with (company_code "*"; a company's own row of the same code wins): code, name, billable by default, internal only.
DEFAULT_ACTIVITIES = (
("DEV", "Development", True, False),
("MEETING", "Meetings", True, False),
("ADMIN", "Administration", False, False),
)
# The placeholder cost rates of the spec (defaults_to_confirm): GBP an hour from 2026-01-01, company "*". The customer replaces them.
DEFAULT_RATES = (("JUNIOR", "28.0000"), ("SENIOR", "52.0000"), ("PRINCIPAL", "75.0000"))
DEFAULT_RATE_CURRENCY = "GBP"
DEFAULT_RATE_FROM = "2026-01-01"