Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
4.2 KiB
4.2 KiB
Context
These come from the owner's e2e of 2026-12-02 and the owner's answers on the same day. The codebase facts:
- Admin password rules:
- They live in
service-system.system_property, typeADMIN_PWD_FORMAT, with statusY/Nand a value. UserController.adminPasswordRuleFailureschecks them, and is called through/user/validatePasswordFromRulesForAdmin.- The portal hint is the fixed key
AdminPasswordHint.
- They live in
- The symbol rule shows a value of 3, but it is switched off. That is why passwords without symbols were accepted, which is correct.
- Interests (
service-counter.interest) have anactiveflag. Roles (service-system.role) have no status column. - Dashboard: the "Won in period" count and the funnel already behave as the
lead-dashboardspec says. Only the labels mislead. - Listings:
DataTable(app/components/ui/data-table.tsx) backs Users, Leads, Events, Interests, Roles, Emails, Audit log, Companies and Login security. Event leads already has its own phone cards.
Goals / Non-Goals
Goals: the spec deltas.
Non-goals:
- hard delete;
- restoring deleted records from the UI;
- per-company password rules;
- translations (a separate change);
- changing attendance or guest removal rules.
Decisions
- Empty-company hint.
- When the login fails and the company field was empty, the page shows the invalid-credentials message plus "Staff sign in with their company code."
- The hint is chosen in the portal from the form state alone, not from the server's answer, so it cannot reveal whether a username exists.
- Password hint from rules.
- mobile-api reads the switched-on rules from the system service:
GET /api/admin/password-rules/active, for signed-in admins;GET /api/public/password-rules, for the reset-password page, which is reached by email link with no session. The rule set is not secret; it is what the hint shows anyway.
- Both return
[{param, value}]for statusYrules only. - The portal builds the sentence from message keys
PwdHint_<param>with{n}. - A refused password returns
PASSWORD_RULEwith the failingparamandvaluein the ProblemDetail, so the form names the rule.
- mobile-api reads the switched-on rules from the system service:
- Soft delete.
- The column is
deleted_at datetime NULL. - The list endpoints, pickers, capture forms and filters exclude deleted rows.
- Existing leads keep showing a deleted interest's name, because history must not change. The same applies to the audit log and to role names in past records.
- The name stays reserved: the unique key is unchanged, and adding a deleted name is refused with "This name belongs to a deleted interest/role".
- Role delete is refused with 409
ROLE_IN_USEwhile any user (enabled or not) holds the role. - Delete is super admin only, like the other writes, is audited, and needs a confirm dialog.
- The column is
- Dashboard explanations. The KPI tile and the funnel each get a one-line description under the title. This uses the existing tile subtitle style, or a muted line if none exists. No tooltip, because a tooltip is hidden on phones.
- Phone cards in
DataTable.- Below
md,DataTablerenders a list of cards instead of the table. - Each card shows the first column as its title. The other visible columns are label/value rows, with the label from the column header.
- Action cells (meta
actions: trueor an existing actions column marker) go in the card footer. - Sorting stays reachable through a small "Sort by" select above the cards when columns are sortable.
- Pagination is shared.
- Pages with custom phone cards (event leads) keep them.
- The scroll cue requirement still holds above
md.
- Below
Risks / Trade-offs
- Generic cards are plainer than hand-made ones. That is acceptable for admin lists, and a page can still opt into a custom card later.
- The public rules endpoint lets anyone read the password policy. That is low risk, because the policy is shown on the page anyway. It gets the per-IP limit used by the other public routes.
Migration Plan
- Run
sql/01-soft-delete.sql, which adds the two nullable columns and is additive. - Deploy system, counter, mobile-api and the portal.
Rollback: sql/99-rollback.sql drops the columns. Redeploy the previous images.