from enum import StrEnum class JobKind(StrEnum): """Duration / kind of a customer job (specification 5.2).""" SERVICE = "service" ONE_OFF = "one_off" FIXED_TERM = "fixed_term" ONGOING = "ongoing" class JobStatus(StrEnum): """Status of a customer job; the order is the Kanban column order (specification 5.3).""" PROSPECT = "prospect" TENTATIVE = "tentative" QUOTE_REQUEST = "quote_request" ORDER = "order" IN_PRODUCTION = "in_production" ON_HOLD = "on_hold" DONE = "done" INVOICED = "invoiced" BILLED = "billed" ARCHIVED = "archived" @property def is_finished(self) -> bool: """Done or later: such a job is no longer late.""" return self in _FINISHED _FINISHED = frozenset({JobStatus.DONE, JobStatus.INVOICED, JobStatus.BILLED, JobStatus.ARCHIVED}) class Priority(StrEnum): """Specification 5.4. Always shown as text too, never by colour alone.""" WAITING = "waiting" NORMAL = "normal" FIRST = "first" URGENT = "urgent" IMMEDIATE = "immediate" class PaymentBasis(StrEnum): """Specification 5.5.""" PRICE_LIST = "price_list" FIXED_QUOTE = "fixed_quote" MONTHLY_FEE = "monthly_fee" HOURLY = "hourly" NOT_BILLABLE = "not_billable"