You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sims-hq/apps/hq/test
Thomas Joise 5865aafe06 fix(employees): purge sessions on password reset; reject empty patches and duplicate emails cleanly
Review findings on the Phase 1-2 employee slice:

- setEmployeePassword now deletes the employee's sessions in the same
  transaction — resetting a suspected-compromised password must not leave
  the attacker's existing 14-day bearer token valid (deactivateEmployee
  already did this; the reset path is the natural lockout action).
- updateEmployee throws 'Nothing to update' when the patch resolves to
  zero recognized fields, instead of returning 200 and writing a no-op
  before==after audit row; PATCH /employees/:id with {} or wrongly-typed
  fields now 400s.
- createEmployee pre-checks UNIQUE(email) inside the transaction and
  throws 'Email already in use' instead of surfacing the raw
  engine-specific 'UNIQUE constraint failed: staff_user.email' text
  (would differ on Postgres, the locked production engine — D15).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 days ago
..
fixtures feat(hq): seed + apex csv importer with verification and series seeding (HQ-1 task 13) 2 weeks ago
amc.test.ts feat(hq): amc contracts with renewal invoice and derived paid state 2 weeks ago
auth.test.ts feat(hq): staff auth with sessions and owner gate (HQ-1 task 3) 2 weeks ago
aws-costs.test.ts feat(hq): aws cost explorer ingestion — sigv4 signer and monthly tag-grouped pull 2 weeks ago
aws-pull-route.test.ts feat(hq): schedule monthly aws cost pull and owner-gated manual pull route 2 weeks ago
aws-repo.test.ts feat(hq): aws usage repo — upsert/list, cross-client cost ranking, routes 2 weeks ago
bounces.test.ts feat(hq): mailbox bounce detection with email_bounced reminders 2 weeks ago
client-modules.test.ts feat(hq): client-module lifecycle tracking (HQ-1 task 6) 2 weeks ago
client-owner.test.ts feat(clients): account-owner plumbing — client.owner_id, audited owner route, role gate 5 days ago
clients.test.ts feat(hq): client registry with GSTIN validation (HQ-1 task 4) 2 weeks ago
dashboard.test.ts feat(hq): dashboard money view and 6-hourly scheduler wiring 2 weeks ago
db.test.ts feat(hq): sqlite schema + audit log (HQ-1 task 2) 2 weeks ago
documents.test.ts feat(hq): HQ-1.5 — module quote content, pack pick-lists, bundle isolation check 2 weeks ago
e2e.test.ts feat(hq): server assembly, build script and e2e smoke (HQ-1 task 14) 2 weeks ago
employees-routes.test.ts fix(employees): purge sessions on password reset; reject empty patches and duplicate emails cleanly 5 days ago
employees.test.ts fix(employees): purge sessions on password reset; reject empty patches and duplicate emails cleanly 5 days ago
gmail-connect.test.ts feat(hq): one-time gmail oauth connect script (HQ-1 task 12) 2 weeks ago
gmail.test.ts feat(hq): gmail send with token-death handling and email log (HQ-1 task 11) 2 weeks ago
health.test.ts feat(hq): app skeleton with health endpoint (HQ-1 task 1) 2 weeks ago
hq2-schema.test.ts feat(hq): hq-2 schema — recurring/amc/interaction/reminder tables + bounce column + seeds 2 weeks ago
hq3-schema.test.ts feat(hq): hq-3a schema — aws_usage table (per client per month) 2 weeks ago
import.test.ts feat(hq): seed + apex csv importer with verification and series seeding (HQ-1 task 13) 2 weeks ago
interactions.test.ts feat(hq): interaction log with types, follow-ups and routes 2 weeks ago
isolation.test.ts feat(hq): HQ-1.5 — module quote content, pack pick-lists, bundle isolation check 2 weeks ago
modules.test.ts feat(hq): HQ-1.5 — module quote content, pack pick-lists, bundle isolation check 2 weeks ago
payments.test.ts feat(hq): payments with allocation, TDS and advances (HQ-1 task 9) 2 weeks ago
pdf-download.test.ts feat(hq): attachment download filename on GET /documents/:id/pdf?download=1 1 week ago
prepare-draft.test.ts feat(hq): extract pure prepareDraft from createDraft (permissive preview path) 1 week ago
preview-fidelity.test.ts test(hq): golden fidelity — preview HTML byte-identical to the PDF's HTML 1 week ago
preview-route.test.ts feat(hq): POST /documents/preview — permissive live preview, persists nothing 1 week ago
preview-sample.test.ts feat(hq): screen paper styles + documentHtmlSample + POST /previews/sample 1 week ago
public-share.test.ts feat(hq): public GET /share/:token document view route 1 week ago
receipt.test.ts feat(hq): payment receipts — own RCT/ series, zero-GST acknowledgment PDF 2 weeks ago
recurring.test.ts feat(hq): recurring plan repo and owner-gated routes 2 weeks ago
reminder-preview.test.ts feat(hq): GET /reminders/:id/preview — exact email via shared reminderContext 1 week ago
reminder-schedule.test.ts feat(reminders): dated reminder_schedule table + resolveSchedule resolver (Phase 4) 5 days ago
reminders.test.ts feat(hq): reminder templates and idempotent reminder repo 2 weeks ago
reports.test.ts feat(hq): reports — dues aging, module revenue, client profitability with margin 2 weeks ago
scheduler-recurring.test.ts feat(hq): recurring invoice generation with at-most-once auto-send 2 weeks ago
scheduler-scan.test.ts feat(hq): daily scan detection rules with idempotent reminders 2 weeks ago
send-reminder.test.ts feat(hq): reminder email send reusing gmail, plus manual-queue routes 2 weeks ago
series.test.ts feat(hq): seedable per-FY document series (HQ-1 task 7) 2 weeks ago
settings-company.test.ts feat(hq): company profile settings — owner-gated GET/PUT, audited 2 weeks ago
settings-template.test.ts feat(hq): GET/PUT /settings/template + logo upload (owner-gated, audited) 1 week ago
shares.test.ts feat(hq): shareable document link backend (mint/validate/revoke/list) 1 week ago
template-accent.test.ts feat(hq): beautify document template — "Slate Ledger" visual system + template.accent 1 week ago
template-render.test.ts feat(hq): render editable template.* letterhead fields with default fallback 1 week ago
templates.test.ts feat(hq): HQ-1.5 — module quote content, pack pick-lists, bundle isolation check 2 weeks ago