This commit is contained in:
Shubhankar45
2026-10-27 12:03:31 +00:00
parent 2ed3945b5d
commit 4e5e95775d
104 changed files with 5210 additions and 606 deletions
+32
View File
@@ -19,6 +19,13 @@ class Role(StrEnum):
GM = "GM"
AM = "AM"
MR = "MR"
#: Senior Field Executive: does an MR's work (daily reports, forms, doctors, chemists) and
#: reports to the same Area Manager, but may cover several headquarters.
SFE = "SFE"
#: The roles that do field work and file reports; everywhere "an MR" is checked, an SFE counts too.
FIELD_ROLES: frozenset[Role] = frozenset({Role.MR, Role.SFE})
class DCRStatus(StrEnum):
@@ -34,6 +41,21 @@ class DCRStatus(StrEnum):
APPROVED = "APPROVED"
class ReportType(StrEnum):
"""An MR files two reports a day, each approved by the Area Manager on its own.
PLAN — in the morning: which doctors and chemists the MR intends to visit, and when.
ACTUAL — at the end of the day: the visits that happened, plus a short note for every
planned visit that did not. It can be started only once the plan is approved.
SELF — an Area Manager's own end-of-day report of the visits they made. It needs no
plan and no approval: submitting it makes it final.
"""
PLAN = "PLAN"
ACTUAL = "ACTUAL"
SELF = "SELF"
#: Statuses in which the owning MR may still change report data (V9).
EDITABLE_STATUSES: frozenset[DCRStatus] = frozenset(
{DCRStatus.DRAFT, DCRStatus.RETURNED}
@@ -61,6 +83,14 @@ class ConversionStatus(StrEnum):
LOST = "LOST"
class MasterApproval(StrEnum):
"""A doctor or chemist an MR adds waits for their Area Manager before anyone can use it."""
PENDING = "PENDING"
APPROVED = "APPROVED"
REJECTED = "REJECTED"
class AuditAction(StrEnum):
CREATE = "CREATE"
UPDATE = "UPDATE"
@@ -81,3 +111,5 @@ class EntityType(StrEnum):
CHEMIST = "chemist"
DCR = "dcr"
PRODUCT = "product"
#: A row of a company form (the table is named in the entry's data).
FORM_ROW = "form_row"