Jul 30 - Internal handler files

This commit is contained in:
2026-07-30 12:14:04 -04:00
parent d9bf4be709
commit ceb0b806af
7 changed files with 323 additions and 20 deletions
+22 -9
View File
@@ -85,18 +85,24 @@ class Issue(db.Model):
vendor_notes = db.Column(db.Text, nullable=True)
# Handler type — who is responsible for resolving the issue (phase39).
# NULL and 'internal' both mean janitorial staff (the default); 'facility'
# unlocks the facility_handler_* sub-fields; 'vendor' points to vendor_*.
handler_type = db.Column(db.Enum('internal', 'facility', 'vendor'), nullable=True)
# 'internal' means janitorial staff (the default); 'facility' unlocks the
# facility_handler_* sub-fields; 'vendor' points to vendor_*.
# NOT NULL DEFAULT 'internal' since phase44 — previously nullable, with NULL
# treated as a synonym for 'internal'. Existing NULLs were backfilled by that
# migration, so the two representations are now one.
handler_type = db.Column(
db.Enum('internal', 'facility', 'vendor'),
nullable=False, default='internal',
)
facility_handler_name = db.Column(db.String(100), nullable=True)
facility_handler_contact = db.Column(db.String(200), nullable=True)
facility_handler_notes = db.Column(db.Text, nullable=True)
HANDLER_LABELS = {
'internal': 'Janitorial Staff',
'facility': 'Facility Staff',
'vendor': 'External Vendor',
}
# Free-text name of the janitorial staff member who will handle the issue,
# used when handler_type == 'internal'. Distinct from assigned_to (the JQC
# User who owns follow-up): the actual crew member may not be a system user.
# (phase44)
internal_handler_name = db.Column(db.String(100), nullable=True)
internal_handler_contact = db.Column(db.String(200), nullable=True) # phone or email
# Relationships
# NOTE: Issue.area is provided by the backref on Area.issues (facility.py).
@@ -124,6 +130,13 @@ class Issue(db.Model):
'facility': 'Facility Staff',
'vendor': 'External Vendor',
}
# One-line explanation per handler type, shown under the radio options on the
# issue form so staff pick the right one. (phase44)
HANDLER_DESCRIPTIONS = {
'internal': 'Our janitorial crew handles it.',
'facility': "The facility's own on-site staff handle it.",
'vendor': 'An outside contractor handles it.',
}
@property
def handler_label(self):