# CS WORKSTATION 1.1.0 — implementation and verification

## Implemented
- Product & Supplier navigation after Service Center.
- Database-backed product/supplier CRUD, server pagination (20 rows), keyword search, category filtering, generated immutable SKU, multiple category tags, printable details and linked-supplier deletion protection.
- Categories reuse Service Center categories; create categories there before adding products.
- New Warranty: separate product modal, multiple items per warranty, edit/remove items before submission and when processing an existing warranty. Existing single-product claims remain supported.
- Messages: searchable multi-recipient chips, atomic server-side delivery to 1–50 active recipients, inbox including sent conversations, message notifications.
- Notifications for task creation/updates, warranty receipt/updates, messages and account/permission changes. Counts refresh every minute while the page is visible.
- Confirmation passwords in both user creation forms and user editing, server-side match validation; education removed from forms/list. Existing education database column is retained for compatibility.
- Dashboard after login; clean page reload on logout.
- Initial branding now comes from database settings in server-rendered HTML; no delayed replacement of the old default brand.
- Customer field uses inline native autocomplete of actual contacts, accepts free text and fills matching contact details.
- Empty orphan customer mirrors of deleted contacts are removed via migration. Service-history-bearing customers remain intact.
- Database state starts empty and is loaded from the database, not restored from a previous browser's local cache.
- Snapshot revision conflicts reject stale saves; changed modules alone are rebuilt. Pending-save navigation warning and visible save errors added.
- Compressed .csbackup archives, SHA-256/size verification, decompression size bound, legacy SQL compatibility, CLI restore, safety backup and maintenance/recovery handling.
- Release deployment excludes client files, preserves shared storage/uploads and keeps maintenance active until atomic release switch.

## Verified on 2026-08-27
- PHP syntax and JavaScript syntax checks.
- tests/workstation-smoke.php: isolated in-memory SQLite CRUD/filter/validation/permission-denial/delete protection tests, archive compression/roundtrip/corruption rejection.
- tests/workstation-ui-smoke.cjs: multi-product add/edit/delete and recipient selection/removal.
- tests/public-blog-smoke.php: existing signed public blog/print/sanitization checks.
- Composer audit --locked --no-plugins: no reported advisories or abandoned dependencies at check time.
- Browser: live login branding; isolated synthetic Product/Supplier popup/category-tag rendering. UI fixture is tests/workstation-ui-preview.php and is NOT registered in production routes.
- Three new migrations applied. The two reported empty contact mirrors are no longer in customer_records or ui_states.
- Pre-change backup: C:/srv/csadvance/shared/backups/csadvance-20260827-172345-8b93bec4.csbackup.

## Not certified / remaining verification
- Final HTTP checks are currently blocked 503: a restore request at 17:28 entered maintenance and hit PHP's 60-second timeout at 17:29. The authorised backup/restore endpoints now request a 3600-second execution budget, but the interrupted restore has NOT been rerun and maintenance has NOT been disabled. Confirm the intended recovery point before resuming live use. The safety snapshot observed on disk is C:/srv/csadvance/shared/backups/before-restore-20260827-172824-99118f3d.csbackup.
- No logged-in browser session was supplied: full real-account end-to-end messaging, permissions, warranty submission, profile editing and print output have NOT been certified.
- PHPUnit executable is absent from installed vendor dependencies. Standalone smoke tests above ran; the complete PHPUnit suite did not run.
- Do not perform a real restore on the working database just to test it. Run a full backup/restore drill against a disposable MySQL staging database before deploying.
- Linux release/rollback scripts were reviewed but not executed on this Windows host.
- A transient MySQL “migrations table not found” error occurred once; subsequent checks and migration succeeded. Its cause was not established. Review MySQL/server logs if it recurs.
- Audit is not a penetration test and no application can be promised “hack-proof”.

## Capacity and remaining architecture limits
There is no defensible concurrent-user maximum without measuring the intended server with representative data. Current dataset is tiny (2 users, no stored quotations/invoices/warranties at review).
New inventory lists are paginated. Legacy customers/claims/tasks/quotations still use per-user JSON state, and a changed legacy module still rebuilds its relational rows. Browser memory, JSON payload size, localStorage quota, PHP limits and MySQL write time will become limiting factors as records grow.
Existing task/state access is per-user; a full shared-task/assignee authorization redesign is NOT included in this release. Notifications do not automatically grant access to another user's records.
Java is not needed to resolve this. The next scale step is record-level Laravel CRUD for the remaining legacy modules, database-backed pagination/search, background jobs for expensive work and representative load testing.
Load-test only a staging copy: measure p95 latency, error rate, database CPU/locks and memory with staged concurrent sessions. Do not infer capacity from the PHP development server.

## Security notes
New inventory endpoints enforce authentication and module/action permissions with server validation and foreign keys. CSRF, prepared SQL, active-recipient validation, notification ownership, password confirmation, image-content checking and escaping of newly rendered user data are in place.
Legacy inline scripts still require unsafe-inline in CSP. Removing that requires migrating inline event handlers throughout the application; this release does not claim a strict CSP.
.csbackup is compressed and checksummed, NOT encrypted or cryptographically signed. Keep backups private, restrict filesystem access, and restore only trusted archives. Backup contains the database, not external uploaded files or .env; protect and back up shared storage/uploads/configuration separately.
Configure HTTPS, secure cookies, APP_DEBUG=false, least-privilege database credentials and private backup storage on the live host. Keep the web document root at public/.
