# ICMIS — Probation user feedback: change log

Scope: only the concerns raised by Probation (PACS) users in *MODULES SUMMARIES – ICMS*.
Nothing outside the Probation & Aftercare area was changed, apart from one line in
`config/permissions.php` (new **approve** right for Staff Training) and the sidebar links.

## Deploying

1. **Database** — pick one:
   * `php artisan migrate` (runs `2026_09_29_000001_probation_user_feedback.php`), **or**
   * `mysql -u USER -p DB < database/2026_09_29_probation_user_feedback.sql` (same changes, idempotent).

   ⚠ `database/migrations/probation.php` (already in the project) is a *config* file, not a
   migration, and makes `php artisan migrate` fail. Move it out of that folder or use the SQL file.
   Both scripts only add columns/tables and widen five ENUMs to VARCHAR; no data is removed.
2. Re-run the permissions seeder (or tick the right in Roles) so supervisors get
   **Staff Training → approve**. Super-admins already pass.
3. `php artisan storage:link` (warrant scans, case documents, training files).
4. `php artisan route:clear && php artisan view:clear && php artisan config:clear`.
5. Lecture uploads are limited by PHP's `upload_max_filesize` / `post_max_size`
   (and nginx `client_max_body_size`). For long recordings use the “link to media server” field.

No PHP runtime was available while making these changes, so they were checked statically
(bracket/directive balance, route names, config keys, model fillables vs. schema).
Please smoke-test each tab on a staging copy before production.

## Concern → change

### 1. Social Inquiry
| Concern | Where |
|---|---|
| Case ledger: Number + colour code (BLACK referral / BLUE placement / GREY completion) | `ProbationCase::colorCode/colorHex/colorLabel`; shown on list, workspace, ledgers |
| Type of Referral (19), Source of Inquiry (11 new) | `config/probation.php` `referral_types`, `referral_sources` (old values still display via `referral_sources_legacy`) |
| Date Referred, Date Registered/Noted, Mention Date, Name, Age, Sex (M/F/Intersex), Document + Number, Tribe, Nationality, Religion, Offence, Section, CRC, PCR, Police Station, Court/Penal Institution, Magistrate/Judge, Allocated Officer | Registration form `cases/create`, Case Ledger tab `cases/_ledger`, `ProbationAssessmentController@storeLedger` |
| Remove Disposal from the ledger | Disposal now only in the **Outcome** tab; disposing an SI to PO/CSO/Borstal happens there |
| Inquiry: Informant (11), Name of Informant, Date Interviewed, Notes box | Inquiry tab + `SocialInquiryController@addInterview` |
| Assessments on the latest tool | RNR (Risk Needs Assessment – Adults, PR 2) and PK-RAVET captured item-by-item with scoring — `config/probation_assessments.php`, `cases/_assessments` |
| “Case Conferences” with Date, Venue, Minutes linked to a report | Conferences tab; minutes flow into generated reports |
| Reports: 19 types + templates | `report_types`, `report_templates` (section headings pre-filled from the case). **Headings are placeholders — replace with the official PACS templates in `config/probation.php`.** Supervision reports (PR9, CS7, Progress…) remain for the other modules |
| Supervision / Interventions / Empowerment / Completion removed from SI | Tabs hidden on Social Inquiry; available on supervision cases |
| Documents: type dropdown (5), no Title | Documents tab |
| Outcome: no fine amount | `_outcome` |
| Search by Name and Case Number | List search covers name, serial, court file and CRC numbers |

### 2. Probation Orders & 3. Community Service Orders
* “Register new” → **Direct placement**; “Convert…” → **Retrieve from social inquiry** — default choice, searchable list, details auto-filled.
* Person section titled **Probationer** / **CSO Client**.
* Source of Inquiry and Safeguarding flags removed from these two modules.
* **Date placed** / **Date of expiry**.
* **Remarks** tab (timestamped, with author).
* CSO: **Work agency** at placement; agencies carry an **area** and **hourly rate**;
  **Quantification** = hours worked × rate; **Skills transfer** recorded per placement (Community Service tab).

### 4. Supervision
`/probation/supervision` lists every case under supervision (PO, CSO, Aftercare) with counts,
filters and search. PR 2A records capture Date reported / Notes / Date of visit.
(Fixed while here: supervision notes pointed at a non-existent table.)

### 5. Aftercare
* Borstal **and POMAC** clients (category on each case).
* Registration is **Retrieve from social inquiry (Final home report)** only — no “Register new”.
* Aftercare ledger columns exactly as listed (serial, name, category, sex, age, ID/passport/birth cert,
  offence & section, CRC, officer, period, date released, date completed, SAT/UNSAT/ABS, remarks) + empowerment.

### 6. Reports & Analytics
* **Completions**: Satisfactory / Unsatisfactory / Absconded tiles, each clickable to its list; rows open the case.
* **Breaches**: probationer name, case file no., PO/CSO serial, date warrant applied, link to scanned warrant.
* **Case Data**: opens on master data of all cases under supervision (scope switch for all cases); richer CSV.
* PO ledger colour code; CSO ledger hours ordered/worked + quantification; Aftercare ledger empowerment.
* Referrals ledger: colour-coded status, date noted, tribe, ethnicity, ID no., type of referral.
* Officer caseload broken down by case type.
* New **Supervision Analysis**: daily / monthly / quarterly / yearly supervisions with brought-forward,
  new, completed and carried-forward counts; aftercare clients’ status & progress.

### 7. Staff Training (5.1–5.8)
* 5.1 Application form (bio-data, station, cadre, reason) → **Reviewed** → supervisor **Admit/Reject**
  (needs the new *approve* right). “Enrolled” counts only admitted participants; old Enroll button now files an application.
* 5.2 Trainer directory; courses link to `trainer_id`; past courses per trainer.
* 5.3 Objectives, target cadre, duration, mode, venue, capacity, prerequisites, pass mark.
* 5.4 Calendar view (month grid, overlap warning).
* 5.5 Sessions + attendance, assessments (upload or instructions) + scores, suggested average vs pass mark, competency status.
* 5.6 Physical materials register: issue, due date, return, overdue status, copies on loan.
* 5.7 Lecture library (audio/video upload or media-server link) — stored privately and streamed only to admitted staff and course admins.
* 5.8 Certificate with number, verification code and QR code; public check at `/training-certificate/verify/{code}`; “Print / Save as PDF”.

## Files
    M	app/Http/Controllers/BaseProbationCaseController.php
    M	app/Http/Controllers/CaseReportController.php
    M	app/Http/Controllers/CentralSupervisionLedgerController.php
    M	app/Http/Controllers/CommunityServiceController.php
    M	app/Http/Controllers/CsoAgencyController.php
    M	app/Http/Controllers/ProbationAssessmentController.php
    M	app/Http/Controllers/ProbationTrainingController.php
    M	app/Http/Controllers/ReportsController.php
    M	app/Http/Controllers/SocialInquiryController.php
    M	app/Http/Controllers/SupervisionController.php
    M	app/Models/CaseConference.php
    A	app/Models/CaseRemark.php
    M	app/Models/NeedsAssessment.php
    M	app/Models/ProbationCase.php
    M	app/Models/SupervisionBreach.php
    M	app/Models/SupervisionNote.php
    M	app/Models/SupervisionOrder.php
    A	app/Models/TrainingAssessment.php
    A	app/Models/TrainingAssessmentScore.php
    A	app/Models/TrainingAttendance.php
    M	app/Models/TrainingCourse.php
    M	app/Models/TrainingEnrollment.php
    M	app/Models/TrainingMaterial.php
    A	app/Models/TrainingMaterialIssue.php
    A	app/Models/TrainingMedia.php
    A	app/Models/TrainingSession.php
    A	app/Models/TrainingTrainer.php
    M	config/permissions.php
    M	config/probation.php
    A	config/probation_assessments.php
    A	database/2026_09_29_probation_user_feedback.sql
    A	database/migrations/2026_09_29_000001_probation_user_feedback.php
    M	resources/views/layouts/app.blade.php
    A	resources/views/probation/cases/_assessments.blade.php
    A	resources/views/probation/cases/_cso_work.blade.php
    M	resources/views/probation/cases/_ledger.blade.php
    M	resources/views/probation/cases/_outcome.blade.php
    A	resources/views/probation/cases/_remarks.blade.php
    M	resources/views/probation/cases/create.blade.php
    M	resources/views/probation/cases/index.blade.php
    M	resources/views/probation/cases/show.blade.php
    M	resources/views/probation/cso/agencies.blade.php
    M	resources/views/probation/reports/ledgers/aftercare.blade.php
    M	resources/views/probation/reports/ledgers/referrals.blade.php
    M	resources/views/probation/reports/ledgers/supervision.blade.php
    M	resources/views/probation/supervision/index.blade.php
    A	resources/views/probation/training/certificate.blade.php
    M	resources/views/probation/training/create.blade.php
    M	resources/views/probation/training/index.blade.php
    M	resources/views/probation/training/show.blade.php
    A	resources/views/probation/training/trainers.blade.php
    A	resources/views/probation/training/verify.blade.php
    M	resources/views/reports/breaches.blade.php
    M	resources/views/reports/completions.blade.php
    M	resources/views/reports/officers.blade.php
    M	resources/views/reports/probation.blade.php
    A	resources/views/reports/supervision-analysis.blade.php
    M	routes/web.php
