From ae756e554fee62091f97179d7b92d4cf5a8f9c8a Mon Sep 17 00:00:00 2001 From: ngqile Date: Wed, 2 Dec 2026 10:34:27 +0800 Subject: [PATCH] docs: archive polish-e2e-followups Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs --- .../.openspec.yaml | 0 .../design.md | 0 .../proposal.md | 0 .../specs/admin-access/spec.md | 0 .../specs/admin-login-security/spec.md | 0 .../specs/admin-roles/spec.md | 0 .../specs/admin-visual-design/spec.md | 0 .../specs/lead-dashboard/spec.md | 0 .../specs/lead-interests/spec.md | 0 .../sql/01-soft-delete.sql | 0 .../sql/99-rollback.sql | 0 .../2026-12-02-polish-e2e-followups}/tasks.md | 0 openspec/specs/admin-access/spec.md | 14 +++++++++- openspec/specs/admin-login-security/spec.md | 18 ++++++++++++ openspec/specs/admin-roles/spec.md | 27 ++++++++++++++++-- openspec/specs/admin-visual-design/spec.md | 20 +++++++++++++ openspec/specs/lead-dashboard/spec.md | 12 ++++++++ openspec/specs/lead-interests/spec.md | 28 +++++++++++++++++-- 18 files changed, 113 insertions(+), 6 deletions(-) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/.openspec.yaml (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/design.md (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/proposal.md (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/specs/admin-access/spec.md (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/specs/admin-login-security/spec.md (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/specs/admin-roles/spec.md (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/specs/admin-visual-design/spec.md (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/specs/lead-dashboard/spec.md (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/specs/lead-interests/spec.md (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/sql/01-soft-delete.sql (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/sql/99-rollback.sql (100%) rename openspec/changes/{polish-e2e-followups => archive/2026-12-02-polish-e2e-followups}/tasks.md (100%) diff --git a/openspec/changes/polish-e2e-followups/.openspec.yaml b/openspec/changes/archive/2026-12-02-polish-e2e-followups/.openspec.yaml similarity index 100% rename from openspec/changes/polish-e2e-followups/.openspec.yaml rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/.openspec.yaml diff --git a/openspec/changes/polish-e2e-followups/design.md b/openspec/changes/archive/2026-12-02-polish-e2e-followups/design.md similarity index 100% rename from openspec/changes/polish-e2e-followups/design.md rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/design.md diff --git a/openspec/changes/polish-e2e-followups/proposal.md b/openspec/changes/archive/2026-12-02-polish-e2e-followups/proposal.md similarity index 100% rename from openspec/changes/polish-e2e-followups/proposal.md rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/proposal.md diff --git a/openspec/changes/polish-e2e-followups/specs/admin-access/spec.md b/openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/admin-access/spec.md similarity index 100% rename from openspec/changes/polish-e2e-followups/specs/admin-access/spec.md rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/admin-access/spec.md diff --git a/openspec/changes/polish-e2e-followups/specs/admin-login-security/spec.md b/openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/admin-login-security/spec.md similarity index 100% rename from openspec/changes/polish-e2e-followups/specs/admin-login-security/spec.md rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/admin-login-security/spec.md diff --git a/openspec/changes/polish-e2e-followups/specs/admin-roles/spec.md b/openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/admin-roles/spec.md similarity index 100% rename from openspec/changes/polish-e2e-followups/specs/admin-roles/spec.md rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/admin-roles/spec.md diff --git a/openspec/changes/polish-e2e-followups/specs/admin-visual-design/spec.md b/openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/admin-visual-design/spec.md similarity index 100% rename from openspec/changes/polish-e2e-followups/specs/admin-visual-design/spec.md rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/admin-visual-design/spec.md diff --git a/openspec/changes/polish-e2e-followups/specs/lead-dashboard/spec.md b/openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/lead-dashboard/spec.md similarity index 100% rename from openspec/changes/polish-e2e-followups/specs/lead-dashboard/spec.md rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/lead-dashboard/spec.md diff --git a/openspec/changes/polish-e2e-followups/specs/lead-interests/spec.md b/openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/lead-interests/spec.md similarity index 100% rename from openspec/changes/polish-e2e-followups/specs/lead-interests/spec.md rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/specs/lead-interests/spec.md diff --git a/openspec/changes/polish-e2e-followups/sql/01-soft-delete.sql b/openspec/changes/archive/2026-12-02-polish-e2e-followups/sql/01-soft-delete.sql similarity index 100% rename from openspec/changes/polish-e2e-followups/sql/01-soft-delete.sql rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/sql/01-soft-delete.sql diff --git a/openspec/changes/polish-e2e-followups/sql/99-rollback.sql b/openspec/changes/archive/2026-12-02-polish-e2e-followups/sql/99-rollback.sql similarity index 100% rename from openspec/changes/polish-e2e-followups/sql/99-rollback.sql rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/sql/99-rollback.sql diff --git a/openspec/changes/polish-e2e-followups/tasks.md b/openspec/changes/archive/2026-12-02-polish-e2e-followups/tasks.md similarity index 100% rename from openspec/changes/polish-e2e-followups/tasks.md rename to openspec/changes/archive/2026-12-02-polish-e2e-followups/tasks.md diff --git a/openspec/specs/admin-access/spec.md b/openspec/specs/admin-access/spec.md index 3fde1d7..202027b 100644 --- a/openspec/specs/admin-access/spec.md +++ b/openspec/specs/admin-access/spec.md @@ -8,7 +8,7 @@ Staff log in to the Co-Lite admin portal, and every admin page and `/api/admin/* ### Requirement: Staff login -The system SHALL let an active admin user log in through the admin portal with company code, username and password, or with username and password and no company for a super admin, and SHALL return the user's name, roles, company, menu and whether a password change is required. +The system SHALL let an active admin user log in through the admin portal with company code, username and password, or with username and password and no company for a super admin, and SHALL return the user's name, roles, company, menu and whether a password change is required. When a login fails and the company field was left empty, the login page SHALL also say that staff sign in with their company code, decided from the form alone so that it never reveals whether the username exists. #### Scenario: Correct credentials @@ -29,6 +29,18 @@ The system SHALL let an active admin user log in through the admin portal with c - **THEN** `/api/admin/auth/login` responds 401 - **AND** the login page shows an invalid-credentials message without saying whether the company or username exists +#### Scenario: Staff user without company + +- **GIVEN** an active admin user `sales1` of company `ins` +- **WHEN** they submit username `sales1` and their correct password with the company left empty +- **THEN** login is refused with a 401 +- **AND** the page shows the invalid-credentials message and that staff sign in with their company code + +#### Scenario: Unknown username without company + +- **WHEN** someone submits a username that does not exist with the company left empty +- **THEN** the page shows exactly the same messages as for `sales1` without a company + #### Scenario: Deactivated user - **GIVEN** an admin user whose account is deactivated diff --git a/openspec/specs/admin-login-security/spec.md b/openspec/specs/admin-login-security/spec.md index ac13b07..bd1469f 100644 --- a/openspec/specs/admin-login-security/spec.md +++ b/openspec/specs/admin-login-security/spec.md @@ -142,3 +142,21 @@ The system SHALL let an admin with `BO_LOGIN_SECURITY` read the lockout settings - **WHEN** an INS user with `BO_LOGIN_SECURITY` changes a lockout setting or a password rule - **THEN** the change is refused with 403 and the settings stay as they were + +### Requirement: Password hint from the rules + +Every screen that sets an admin password (first-login change, change own password, set a temporary password, reset password by email link) SHALL show a hint listing the admin password rules that are switched on, with their values, read from the same rules the server checks. A refused password SHALL name the rule it failed. + +#### Scenario: Hint follows the switched-on rules + +- **GIVEN** the switched-on admin rules are minimum length 8, at least 1 capital and at least 1 small letter, and the symbol rule is off +- **WHEN** a user opens the change password dialog +- **THEN** the hint lists at least 8 characters, 1 capital letter and 1 small letter +- **AND** it says nothing about symbols + +#### Scenario: Rule switched on + +- **GIVEN** a super admin switches on the symbol rule with value 2 under Login security +- **WHEN** a user opens the reset password page from an email link +- **THEN** the hint also lists at least 2 symbols +- **AND** a new password with one symbol is refused with a message naming the symbol rule diff --git a/openspec/specs/admin-roles/spec.md b/openspec/specs/admin-roles/spec.md index 147b64b..460343e 100644 --- a/openspec/specs/admin-roles/spec.md +++ b/openspec/specs/admin-roles/spec.md @@ -8,7 +8,7 @@ Admins with the Roles module define roles and choose which back-office modules e ### Requirement: Role list and edit -The system SHALL let any admin with `BO_ROLES` list admin roles, and SHALL let only a super admin create and rename them, because roles are shared by every company. Role names SHALL be unique. The member role and `ROLE_ADMIN` SHALL NOT appear in the list (`ROLE_ADMIN` is attached to every admin automatically and grants no modules). +The system SHALL let any admin with `BO_ROLES` list admin roles, and SHALL let only a super admin create, rename and delete them, because roles are shared by every company. Role names SHALL be unique, including against deleted roles. The member role and `ROLE_ADMIN` SHALL NOT appear in the list (`ROLE_ADMIN` is attached to every admin automatically and grants no modules). #### Scenario: Create role @@ -23,7 +23,7 @@ The system SHALL let any admin with `BO_ROLES` list admin roles, and SHALL let o #### Scenario: Company user edits a role -- **WHEN** an INS user with `BO_ROLES` creates or renames a role +- **WHEN** an INS user with `BO_ROLES` creates, renames or deletes a role - **THEN** the request is refused with 403 and nothing changes ### Requirement: Role permissions @@ -51,3 +51,26 @@ The system SHALL hold Co-Lite's back-office modules in the module table, with a - **WHEN** the local stack starts from an empty database - **THEN** the super admin's sidebar shows Users and Roles and no Tastefully back-office entries + +### Requirement: Role deletion + +A super admin SHALL be able to delete a role after confirming. The delete SHALL be refused while any user, enabled or not, holds the role. Deleting SHALL be soft: a deleted role SHALL disappear from the role list and the user role picker. + +#### Scenario: Delete an unused role + +- **GIVEN** role `ROLE_TEMP` that no user holds +- **WHEN** a super admin deletes it and confirms +- **THEN** it is no longer in the role list or the user role picker + +#### Scenario: Delete a role in use + +- **GIVEN** role `ROLE_SALES` held by 3 users, one of them disabled +- **WHEN** a super admin deletes it +- **THEN** the delete is refused with a message that 3 users hold the role +- **AND** the role is unchanged + +#### Scenario: Name of a deleted role + +- **GIVEN** `ROLE_TEMP` was deleted +- **WHEN** a super admin creates a role named `ROLE_TEMP` +- **THEN** the save is refused with a message that the name belongs to a deleted role diff --git a/openspec/specs/admin-visual-design/spec.md b/openspec/specs/admin-visual-design/spec.md index 6486c15..64d8d31 100644 --- a/openspec/specs/admin-visual-design/spec.md +++ b/openspec/specs/admin-visual-design/spec.md @@ -149,3 +149,23 @@ The sidebar SHALL show Dashboard first, then the labelled sections Events, Leads - **WHEN** an admin collapses the sidebar to the icon rail - **THEN** the sections are separated by dividers and no section label shows + +### Requirement: Phone Cards For Listings + +Every listing built on the shared data table SHALL show one card per row below the `md` width instead of a table, with the row's first column as the card title, the other columns as labelled values, and the row actions at the bottom of the card. Sorting and paging SHALL stay available. A page with its own phone cards SHALL keep them. + +#### Scenario: Users on a phone + +- **WHEN** a super admin opens Users at 360 px +- **THEN** each user is a card with the name as title and labelled username, company, roles and status +- **AND** the page does not scroll sideways + +#### Scenario: Actions on a card + +- **WHEN** a user opens Events at 360 px +- **THEN** each event card has the row's actions at its bottom + +#### Scenario: Wide screen unchanged + +- **WHEN** a user opens Users at 1280 px +- **THEN** the listing is the table, as before diff --git a/openspec/specs/lead-dashboard/spec.md b/openspec/specs/lead-dashboard/spec.md index 5ce4fed..0f6df93 100644 --- a/openspec/specs/lead-dashboard/spec.md +++ b/openspec/specs/lead-dashboard/spec.md @@ -156,3 +156,15 @@ The dashboard SHALL count only the records of the caller's company for company s - **WHEN** a super admin picks CV in the company picker - **THEN** every figure counts CV records only + +### Requirement: Figure explanations + +The dashboard SHALL explain, in a visible line under its title, what the won-in-period figure and the funnel count, so that a period where they differ does not look wrong. The explanation SHALL be visible at phone width, not only on hover. + +#### Scenario: Win of an older capture explained + +- **GIVEN** a lead captured in October and changed to WON in November +- **WHEN** the user views November +- **THEN** won in period shows 1 and the funnel shows WON 0 +- **AND** won in period says it counts leads won in the period whenever they were captured +- **AND** the funnel says it counts the period's captures by their current stage diff --git a/openspec/specs/lead-interests/spec.md b/openspec/specs/lead-interests/spec.md index 7ad638e..a6af56e 100644 --- a/openspec/specs/lead-interests/spec.md +++ b/openspec/specs/lead-interests/spec.md @@ -8,7 +8,7 @@ Admins with the Interests module maintain the list of products and services that ### Requirement: Interest list -The system SHALL keep one interest list shared by all companies. Admins with `BO_INTERESTS` SHALL see the list, and only a super admin SHALL add, rename, reorder, deactivate and reactivate interests. An interest name SHALL be required, at most 100 characters, and unique ignoring case. Interests SHALL NOT be deletable. +The system SHALL keep one interest list shared by all companies. Admins with `BO_INTERESTS` SHALL see the list, and only a super admin SHALL add, rename, reorder, deactivate, reactivate and delete interests. An interest name SHALL be required, at most 100 characters, and unique ignoring case, including against deleted interests. Deactivating SHALL ask for confirmation. #### Scenario: Add interest @@ -25,16 +25,38 @@ The system SHALL keep one interest list shared by all companies. Admins with `BO #### Scenario: Deactivate - **GIVEN** an active interest `Cookware` -- **WHEN** a super admin deactivates it +- **WHEN** a super admin deactivates it and confirms - **THEN** it is still listed, marked inactive - **AND** it is no longer offered when capturing a lead in any company +#### Scenario: Cancel deactivate + +- **WHEN** a super admin chooses Deactivate on `Cookware` and then Cancel +- **THEN** `Cookware` stays active + #### Scenario: Company user edits -- **WHEN** an INS user with `BO_INTERESTS` adds, renames or deactivates an interest +- **WHEN** an INS user with `BO_INTERESTS` adds, renames, deactivates or deletes an interest - **THEN** the request is refused with 403 and the list is unchanged #### Scenario: No module - **WHEN** an admin without `BO_INTERESTS` opens the Interests page or calls an interests endpoint - **THEN** the page shows not-authorised and the endpoint responds 403 + +### Requirement: Interest deletion + +A super admin SHALL be able to delete an interest after confirming. Deleting SHALL be soft: a deleted interest SHALL disappear from the list, the capture forms and the filters, while leads already tagged with it SHALL keep showing its name. + +#### Scenario: Delete + +- **GIVEN** an interest `Cookware` that two leads are tagged with +- **WHEN** a super admin deletes it and confirms +- **THEN** it is no longer listed or offered anywhere +- **AND** the two leads still show `Cookware` + +#### Scenario: Name of a deleted interest + +- **GIVEN** `Cookware` was deleted +- **WHEN** a super admin adds `Cookware` +- **THEN** the save is refused with a message that the name belongs to a deleted interest