111 lines
4.5 KiB
Python
111 lines
4.5 KiB
Python
"""
|
|
app/enrollment/schema.py
|
|
------------------------
|
|
The JQC Enrollment Form, expressed as data.
|
|
|
|
This is the SINGLE source of truth for the form's shape. The public template
|
|
renders from it, the POST handler parses against it, and the admin detail view
|
|
re-renders a stored submission through it. Changing a task label or adding an
|
|
inspector column is a one-line edit here — no template or parser change.
|
|
|
|
Deliberately free of any app model / DB import: the enrollment form describes
|
|
what a prospective customer *wants set up*, not anything that exists in the
|
|
system yet. Keep it that way (see app/enrollment/__init__.py).
|
|
"""
|
|
|
|
# ── Step 1 columns ───────────────────────────────────────────────────────────
|
|
# key -> display label. 'admin' is the Admin/Director column; the rest are the
|
|
# five inspector seats on the printed form.
|
|
COLUMNS = [
|
|
('admin', 'Admin /\nDirector'),
|
|
('inspector_1', 'User /\nInspector 1'),
|
|
('inspector_2', 'User /\nInspector 2'),
|
|
('inspector_3', 'User /\nInspector 3'),
|
|
('inspector_4', 'User /\nInspector 4'),
|
|
('inspector_5', 'User /\nInspector 5'),
|
|
]
|
|
|
|
INSPECTOR_COLUMNS = [c for c in COLUMNS if c[0] != 'admin']
|
|
|
|
|
|
# ── Step 1 rows ──────────────────────────────────────────────────────────────
|
|
# ref, label, columns_offered. Ref 10 (Search/Export Reports) is an
|
|
# Admin/Director-only capability on the printed form, so it offers one cell.
|
|
TASKS = [
|
|
(1, 'Receive new inspection submitted notification', 'all'),
|
|
(2, 'Receive issue-related notification', 'all'),
|
|
(3, 'New issue created', 'all'),
|
|
(4, 'Issue status updated', 'all'),
|
|
(5, 'Issue comment added', 'all'),
|
|
(6, 'Request follow up / re-inspection', 'all'),
|
|
(7, 'Add Comments (issue detail page)', 'all'),
|
|
(8, 'Receive issue SLA (at-risk, breached)', 'all'),
|
|
(9, 'Log new issue', 'all'),
|
|
(10, 'Search/Export Reports (inspection/issue)', 'admin_only'),
|
|
]
|
|
|
|
|
|
def columns_for(scope):
|
|
"""Return the column list a task row offers."""
|
|
return COLUMNS if scope == 'all' else [('admin', 'Admin /\nDirector')]
|
|
|
|
|
|
# ── Step 2 registrants ───────────────────────────────────────────────────────
|
|
# key -> row label on the printed form.
|
|
REGISTRANTS = [
|
|
('admin', 'Administrative Roles (Admin/Director/Auditor)'),
|
|
('inspector_1', 'User / Inspector 1'),
|
|
('inspector_2', 'User / Inspector 2'),
|
|
('inspector_3', 'User / Inspector 3'),
|
|
('inspector_4', 'User / Inspector 4'),
|
|
('inspector_5', 'User / Inspector 5'),
|
|
]
|
|
|
|
|
|
# ── Step 3 ───────────────────────────────────────────────────────────────────
|
|
MOBILE_APP_LABEL = 'JQC Mobile App For Smart Device'
|
|
|
|
|
|
# ── Recommendation block (static reference, not an input) ────────────────────
|
|
# ref -> (admin_recommended, inspector_recommended). None = no cell on the form.
|
|
RECOMMENDATION = {
|
|
1: (False, True),
|
|
2: (False, True),
|
|
3: (True, True),
|
|
4: (False, True),
|
|
5: (True, True),
|
|
6: (True, True),
|
|
7: (True, True),
|
|
8: (False, True),
|
|
9: (True, True),
|
|
10: (True, None),
|
|
}
|
|
|
|
RECOMMENDATION_INTRO = (
|
|
'To prevent the administrator or director from receiving an overwhelming '
|
|
'number of email notifications, we recommend the following:'
|
|
)
|
|
|
|
NOTES = [
|
|
'Each user will receive instructions on how to sign up and install the app '
|
|
'on their smart device.',
|
|
'Along with the installation instructions, users will receive a quick guide '
|
|
'to navigate the web portal and app based on their credentials.',
|
|
]
|
|
|
|
|
|
# ── Office-use fields (filled in by L.T. Services after receipt) ─────────────
|
|
OFFICE_FIELDS = [
|
|
('receive_date', 'Receive Date'),
|
|
('program_by', 'Program By'),
|
|
('date_email_invitation', 'Date email invitation'),
|
|
]
|
|
|
|
STATUSES = ['new', 'in_progress', 'completed']
|
|
|
|
STATUS_LABELS = {
|
|
'new': 'New',
|
|
'in_progress': 'In Progress',
|
|
'completed': 'Completed',
|
|
}
|