# Features — edi_system (SAWIS Label System)

Evidence date: 2026-10-16.

Source: `git@bitbucket.org:overdrive/edi_system.git`, `master` at `75a67b5` (2024-02-21).

Status values: **Current** (present and wired), **Completed** (the only history is the replica commit; nothing is marked finished in a changelog), **In development** (TODO or stub still in the tree), **Planned** (named as future and not built), **Changed** (second commit versus the empty initial commit), **Deprecated / removed** (left in tree but not on the active path), **Unknown** (needs a person).

There is no `features` document and no changelog in the source repository. `README.md` "Features" lists only authentication, authorization, user registration, and menu management.

## Current — label product

| Feature | What it does | Evidence |
|---|---|---|
| SAWIS Label shell | Page title, favicon, header logo, and footer browser badges use SAWIS assets | `app/Views/layouts/main.php`, `sawis-header.php`, `so-footer.php`, `public/assets/sawis_assets/` |
| SAWIS Online menu | Navbar links into SAWIS Online. Host depends on the current base URL. Hidden when role is 5 | `app/Views/layouts/sawis-menu.php` |
| Login | SAWIS Online password check, then local password | `app/Controllers/Welcome.php` |
| Logout | Destroys the session and returns to `/` | `Welcome::logout` (auto-routed; not listed in `Routes.php`) |
| Registration | Public form, unique email, role 1 | `Welcome::register`, `Welcome::registration`, `app/Views/common/register.php` |
| Forbidden page | Shown when the menu grant fails | `Welcome::forbiddenPage`, `app/Views/common/forbidden.php`, route `blocked` |
| Label list | Role-scoped table of labels, status name, designer, approver, meeting group | `Labels::index`, `app/Views/label/labelList.php` |
| Admin label form | Tabs for details, files, history, email. Agent dropdown | `labelForm.php`, `TabsContent/labelFormTabAdmin.php`, `labelFilesTab.php`, `labelHistoryTab.php`, `labelEmailTab.php` |
| Member label form | Designer view. Agent and approver read-only | `labelFormMember.php`, `labelFormTab.php` |
| Create label from PDFs | Status 1, file types 1–5, JPEG preview via Imagick | `Labels::createLabel`, `LabelModel::createLabelFiles` |
| Resubmit file version | New `file` row, version + 1, status unchanged | `Labels::resubmitLabelFile` |
| Edit label fields | Trademark, alcohol %, warning, bottle size, year, CC list, agent | `LabelModel::updateLabelData` |
| Delete label file | Sets `file.active` to 0, writes a note, logs action `delete` | `Labels::deleteLabelFile`, `LabelModel::deleteLabelFiles` |
| Approve file | Sets `file.file_approved` | `labelFileApprovalStatus` |
| Approve label | Status 5, or 6 with provisions; note; email queue; PDF certificate | `approveLabel`, `labelApprovalPDF` |
| Reject label | Status 4; note; email queue; PDF certificate | `rejectLabel` |
| Contest rejection | Status 7; note; no email | `contestRejectedlabel` |
| Manual status change | Any posted status id | `manualLabelSubmissionStatusUpdate` |
| Previous file versions | JSON list of other versions of the same type | `getPreviousLabelFileVersions` |
| Meeting-group reassignment | Batch update of `meeting_group_id` from the list | `reassignToMeetingGroup`, `labelList.php` |
| Provisions checklist | Names from `label_provision` appended into notes from the modal | `app/Views/label/labelModals.php`, migration `LabelProvision` |
| Status admin | Create and edit statuses, priority, parent, group. Six names locked in the view | `LabelStatus.php`, `app/Views/label/labelStatus.php` |
| Meeting groups and user groups | Create, rename, activate, assign users | `LabelUserGroups.php`, `app/Views/label/labelUserGroups.php` |
| Email templates | Create and edit bodies tied to a status id | `LabelEmailTemplates.php`, `app/Views/label/labelEmailTemplates.php` |
| Sent queue | Insert on approve/reject; manual send; reschedule date; open tracking | `Email.php`, `Labels::sendEmailNow`, `rescheduleEmail`, `EmailPixelTracking` |
| Label dashboard counts | Five counters on `common/home` | `Home::index` |
| Approval certificate file | Type 6 PDF under `uploads/approvalcerts/` | `Labels::labelApprovalPDF` |

## Current — starter platform (present in the same tree)

These features ship in the replica commit. The README names the first four. The rest are implemented without a product statement. Whether they are in scope for SAWIS labels is **Unknown / Requires Confirmation**.

| Feature | Evidence |
|---|---|
| User list, create, update, delete | `Users.php`, `app/Views/users/userList.php` |
| Role create, update, delete | `Users::createRole`, `updateRole`, `deleteRole`, `userRoleAccess` |
| Menu / category / submenu grants | `Users::changeMenuPermission` and the category and submenu methods, `userAccessList.php` |
| User profile | `Users::userProfile`, `updateUserProfile`, `userProfile.php` |
| Menu management that writes PHP files | `Developers/MenuManagement.php` |
| CRUD generator screen | `Developers/CRUDGenerator.php`, `app/Views/developers/crudGenerator.php` |
| Database table viewer | `Developers/DbTableDataView.php` |
| DB admin screen | `DbAdmin.php`, `app/Views/developers/dbAdmin.php` |
| Embedded Adminer | `app/Views/projects/adminer.php` (large single file) and `adminer_plugin.php` |
| System settings page | `SystemSettings::index` returns `systemSettings.php` (SAWIS header). No settings save method was found on that controller |
| Home shell | `Home.php`, `common/home.php` |
| Car list, form, image and detail update | `Car.php`, `app/Views/car/` |
| Car spreadsheet import into car and cost categories A/B/C | `Car::importSm` and `importToCar`, `importToCatagoryA/B/C` |
| Car stepped API | `CarApi.php` (`new_session` through `step4_fix_my_credit`) |
| App-session charts | `Users::chartSessionslist`, `chartOutcomelist`, `app/Views/dashboards/appSessions.php` |
| Master file list, Overland import, ModelliQ import, CSV export | `MasterFile.php` |
| Uploaded files | `UploadedFile.php`, `app/Views/uploadedFile/` |
| Media files | `MediaFile.php`, `app/Views/mediaFile/` |
| Site health list | `SiteHealth.php`, `app/Views/projects/sitehealth.php` |
| Test project list, activate, deactivate, run | `Test.php`, `TestLog.php`, `app/Views/test/` |
| Organisations JWT API | `Organisations.php`, route `$routes->resource('organisations')` |
| API simulation controller | `ApiSimulation.php` (same shape as organisations: index, show, create, update, login) |
| ChatGPT page | `ChatGPT.php`, `app/Views/projects/chatgpt.php`, `chatgpt_helper.php` |
| Email open pixel | `EmailPixelTracking.php`, route `tracking-pixel` |
| SonarQube on `master` | `bitbucket-pipelines.yml`, `sonar-project.properties`, `sonarqube_scan.bat` |
| Token-gated deploy | `public/deploy.php`, `public/master_deploy.php` |

## Current — platform services

| Feature | Evidence |
|---|---|
| CodeIgniter filters for login and menu grant | `app/Config/Filters.php` |
| Database sessions when `env` is applied | `env` session keys; migration `2022-11-20-124435_Session.php` |
| Migrations for users, menus, labels, cars, files, queue | `app/Database/Migrations/` |
| Seed of one developer user plus starter menus | `app/Database/Seeds/Users.php` |
| PHPUnit skeleton | `phpunit.xml.dist`, `tests/unit/HealthTest.php`, example database and session tests |
| Debug toolbar after each request except `chatGPT/*` | `Filters.php` |

## Completed

No release notes mark a feature complete. The repository has two commits. The application arrived in one commit on 2024-02-21 and has not changed in Git since. Treat every current feature as **unchanged since that replica**, not as a signed completion.

## In development

Left unfinished inside the current tree:

| Item | Evidence |
|---|---|
| Tamper check on label create | Call commented out, with a TODO, in `Labels::createLabel` |
| Deactivate the file that a resubmit replaces | TODO in `LabelModel::resubmitLabelFile` |
| Password-protected PDF check | `Labels::checkPDFValidation` uses a placeholder path and is not called by upload |
| Imagick experiment | `Labels::test` reads a fixed certificate path |
| Car "fix my credit" percentage | Formula commented out in `Home::index`; value fixed at 0 |
| Salesforce connect | `salesforce_helper.php` body commented; call sites commented |
| SMS via Africa's Talking | `africastalking_helper.php` body commented; call sites commented |
| Automatic email send | `sendMail` commented out inside `Email::sendEmailNotification` |
| System settings behaviour | Controller only returns the view |
| CRUD automation scripts | `README.md` heading with an empty bullet |
| Forgot password | Link to `/pages-reset-password.html`; file not in the tree |
| Privacy notice | Login link is `href="#"` |

## Planned

`README.md` "Development TODOS" is only the Jira URL `https://siliconsoftware.atlassian.net/jira/software/projects/SI/boards/12`. The board was not read. Planned items on that board are **Unknown**.

No issue, branch, or comment in this repository describes a next release.

## Recently changed

Relative to commit `2fd7fe3` (gitignore only), commit `75a67b5` added the whole application. Inside that snapshot, the latest migrations (by filename date, all inside the same commit) are:

| Migration file date | Change |
|---|---|
| 2024-02-16 | `send_date` on `sent_queue` |
| 2024-02-09 | `cc_list` on `label` |
| 2024-02-09 | `trademark` on `label` |
| 2024-02-08 | `agent_id` on `label` |
| 2024-01-29 | `tracking_code` on `sent_queue` |
| 2024-01-25 | `provisions` on `label` |
| 2024-01-19 | `meeting_group_id` on `label` |
| 2024-01-18 | `sent_queue` table |
| 2024-01-09 | `parent` on `label_status` |

There is no Git history that shows these migrations landing one by one. They were committed together.

## Deprecated / removed / not on the active path

| Item | Why it is listed here |
|---|---|
| `app/Controllers/Users_old.php` | Second copy of class `Users`. The autoloader loads `Users.php`, not this file |
| `app/Config/Filters_old.php` | Second `Config\Filters` class. Not the filename the autoloader uses |
| `app/Config/Routes_old.php` | Not included by `Routes.php` |
| `app/Config/Kint_old.php` | Same pattern as the other `*_old` files |
| `app/Controllers/File.php` | `index` only. Label files are handled by `Labels` and the `file` table |
| Barcode on update | Column exists. Assignment in `updateLabelData` is commented out |
| Local password check after SAWIS success | `password_verify` is commented out in the SAWIS-success branch |
| AWS SDK | In `composer.json`. No `Aws\` use under `app/` |
| `orhanerday/open-ai` package | In `composer.json`. The helper calls the HTTP API with cURL instead |
| `Routes.php` comment block for organisations | Describes the API. It is a comment, not executable routing, except the `resource` line above it |

## Not features of this repository

- EDI message exchange. Searched the tree for an EDI implementation and did not find one.
- A background worker, queue consumer, or `app/Commands` spark command.
- Seeded label statuses, provisions, email templates, or a Labels menu entry.

## Source index for the label workflow

| Concern | Path |
|---|---|
| Routes that are explicit | `app/Config/Routes.php` |
| Everything else | Auto-routing, `setAutoRoute(true)` |
| Rules that are easy to miss | `app/Common.php` (`statusDisplay`, `contentTypeDisplay`, `labelFormsTamperProtection`) |
| Schema | `app/Database/Migrations/2023-10-16-090428_Label.php` and the 2023-11 through 2024-02 label migrations |
