Administration & Controls
The administrator surface for the whole suite: enablement, the per-area permission matrix, the disciplinary settings tab, the scheduled auto-close job, the routes overview, the two REST APIs, the append-only audit log, and how to manage demo data.
Enablement
The suite is gated by the module_compliance setting (Settings → Manage Modules). When disabled, the whole Compliance menu group, all twelve area screens, the settings tab, the permissions, and the routes are withdrawn, and the cron job self-skips. On upgrade the setting is seeded from the legacy module_disciplinary value. The module slug is compliance, category Human Resource, version 1.2.0.
Permission matrix
Grant access in Settings → Roles. Every area is gated independently, so a role only sees the areas you switch on. Most areas offer a base toggle plus Create / Update / Delete; Overview and Audit Log are view-only, and Configuration is an administrator area.
| Area | Route | Base permission | Actions |
|---|---|---|---|
| Overview | compliance/dashboard | compliance_overview | View only |
| Disciplinary | hrs/compliance | deciplinary | Create / Update / Delete |
| Investigations | compliance/investigations | compliance_investigation | Create / Update / Delete |
| Corrective Actions | compliance/corrective_actions | compliance_corrective_action | Create / Update / Delete |
| Disclosures | compliance/disclosures | compliance_disclosure | Create / Update / Delete |
| Speak-up & Grievances | compliance/reports | compliance_report | Create / Update / Delete (restricted) |
| Training & Certifications | compliance/training | compliance_training | Create / Update / Delete |
| Policies & Attestations | compliance/policies | compliance_policy | Create / Update / Delete |
| Compliance Calendar | compliance/calendar | compliance_calendar | Create / Update / Delete |
| Reports & Analytics | compliance/analytics | compliance_analytics | Create / Update / Delete |
| Audit Log | compliance/audit | compliance_audit | View only |
| Configuration | compliance/config | compliance_config | Create / Update / Delete (admin) |
The Disciplinary area carries additional keys that predate the module and were preserved to keep existing grants resolving:
deciplinary(+_create/_update/_delete) — base case access.deciplinary_category(+_create/_update/_delete) — category catalog.manage_disciplinary— edit cases and change statuses.disciplinary_manage_labels,add_disciplinary_label— case labels.corrective_select_compliance_officers— choose assessors instead of the category default.disciplinary_can_do_comment,disciplinary_can_use_prefab_comments— commenting and canned comments.
Disciplinary settings tab
Administrators configure disciplinary behavior under Settings → Disciplinary (route compliance/settings):
- Disable “new” status — new cases start as Open instead of New.
- Prefab comment options — the canned comments users can pick from.
- Acknowledge prefab — the phrase that marks an acknowledgement.
- Prefab comment limit — how many acknowledgement prefabs a user may leave.
- Auto-close after (days) — the window the scheduled job uses.
Scheduled automation
The auto_close_disciplinary_logs cron job closes aged New/Open disciplinary cases whose corrective period has elapsed beyond the configured window, logging and notifying each closure. It runs per-tenant and self-skips where the module is disabled. It is the suite's only scheduled job; the other areas act on operator input rather than a timer.
Routes overview
Each area has its own canonical route. Disciplinary keeps legacy aliases so old bookmarks, integrations, and notification links keep working.
Area screens
compliance/dashboard— Overviewhrs/compliance· legacyhrs/disciplinaryhrs/compliance_categories· legacyhrs/discipline_categoriescompliance/investigationscompliance/corrective_actionscompliance/disclosurescompliance/reports
Area screens (continued)
compliance/trainingcompliance/policiescompliance/calendarcompliance/analyticscompliance/auditcompliance/configcompliance/settings— disciplinary settings tab
REST APIs
Integration API
GET /api/v1/disciplinary/user/{user_id} and GET /api/v1/disciplinary/{id} (scope users:read). Served by Compliance_api; returns disciplinary records for a subject or a single case.
Employee self-service API
GET /v1/api/me/disciplinary and GET /v1/api/me/disciplinary/{id}. Served by Compliance_euapi; returns only the caller's own cases — a mismatched id returns 404 (hides existence).
Both are documented in the generated OpenAPI specs and Postman collections; their URLs and operation names are unchanged from the pre-module build.
Audit log
Every create, update, and delete across all twelve areas writes a System Logs entry under the Compliance category. Those events also feed the in-suite Audit Log screen (compliance/audit), which is read-only and append-only with an integrity panel — nobody can edit or remove an entry. Grant compliance_audit to reviewers who need to inspect the trail without touching operational data.
Demo-data management
Sample data for demos and training is operator-driven, never installed automatically:
php erpat db:seed ComplianceDemo # load sample data across every area php erpat db:seed ComplianceDemo --dry-run # preview without writing php erpat db:seed ComplianceDemo --tenant=<key> # one tenant php erpat db:seed ComplianceDemo --all # main DB + every active tenant php erpat db:seed ComplianceDemo --remove # soft-delete the demo data again
The seeder is idempotent and its --remove path is a soft delete, so you can load and unload it safely in non-production environments.