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 04aef0aa36 fix(api): validate ?days= and guard the onboarding-project routes against a crash (FIX B)
GET /projects/stalled had no try/catch, and a caller-supplied ?days= flowed
straight into `new Date(...).toISOString()`. Confirmed the exact crash:
Number('1e300') passes Number.isFinite (so the old guard let it through),
but the resulting cutoff math overflows the valid Date range and
.toISOString() throws RangeError. Uncaught in an async Express handler this
is an unhandled rejection, which kills the whole process on Node 22 -- any
authenticated role, including plain staff, could take the console down with
one GET.

`days` is now validated (integer, 0-3650) with an explicit 4xx on anything
hostile, falling back to the configured default only when the param is
absent (matches the frontend, which never sends ?days= at all). Audited
every other route this feature added to the same section: /projects/board
and /projects/pending/:key had the identical no-try/catch shape and are now
wrapped too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 day ago
..
fixtures feat(hq): seed + apex csv importer with verification and series seeding (HQ-1 task 13) 2 weeks ago
amc.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
audit-viewer.test.ts feat(d27): #8 audit-log viewer (owner-only) 3 days ago
auth.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
authz-gates.test.ts fix(sec/d24): gate destructive/sensitive ops to managerial 4 days ago
aws-costs.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
aws-pull-route.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
aws-repo.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
bounces.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
bulk-sms-purchase.test.ts feat(sms): bulk SMS purchase proforma + document source tagging (renewal vs top-up) 2 days ago
client-modules.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
client-owner.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
client-support.test.ts feat(d31): store credentials in the clear (owner decision) + one-time migration 3 days ago
clients.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
concurrency.test.ts fix(sec/d24): concurrency + workflow isolation 4 days ago
convert-and-send.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
dashboard.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
db-resolve.test.ts fix(deploy): one shared DB-engine resolver so scripts can't silently target a throwaway SQLite file (FIX A) 1 day ago
db.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
documents-page.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
documents.test.ts feat(docs): require a reason when cancelling a document 2 days ago
due-dates.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
e2e.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
employees-routes.test.ts fix(sec/d24): auth hardening — login lockout, rate limits, constant-time, trust proxy 4 days ago
employees.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
functional-d26.test.ts feat(d26): functional gaps — GST summary, doc search, bulk ops (backend) 3 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(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
hq2-schema.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
hq3-schema.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
import-apex-full.test.ts feat(d21): P4 — importer seeds module field_spec + writes field_values 4 days ago
import-routes.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
import.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
interactions.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
isolation.test.ts feat(hq): HQ-1.5 — module quote content, pack pick-lists, bundle isolation check 2 weeks ago
ledger-outstanding.test.ts fix(payments): exclude draft proformas from outstanding (owner decision) 2 days ago
migrate-onboarding-templates.test.ts fix(onboarding-migration): preserve ad-hoc custom steps across the template swap 1 day ago
migrate-plaintext.test.ts feat(d32): remove the key concept entirely + keyless legacy cleanup 3 days ago
milestone-document.test.ts feat(client-detail): quotation-step document link + ticket classification (backend) 1 day ago
milestone-payment.test.ts feat(onboarding): composed milestone templates (shared front + per-module tail) 2 days ago
milestone-status.test.ts fix(milestones): reject front/tail key collisions; dedupe on collision; stamp installed/trained dates 1 day ago
milestones-templates.test.ts feat(onboarding): composed milestone templates (shared front + per-module tail) 2 days ago
milestones.test.ts fix(milestones): reject front/tail key collisions; dedupe on collision; stamp installed/trained dates 1 day ago
mis.test.ts feat(d27): #5 owner MIS cockpit 3 days ago
module-access.test.ts test(d28): lock module directory + portals (fieldSpec, login-only, no secret leak) 3 days ago
module-fields.test.ts feat(d31): store credentials in the clear (owner decision) + one-time migration 3 days ago
module-roster.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
modules.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
money-guards.test.ts fix(sec/d24): money-integrity guards — CN cap, atomic doc-no, qty, TDS, markStatus 4 days ago
onboarding-template-routes.test.ts fix(milestones): reject front/tail key collisions; dedupe on collision; stamp installed/trained dates 1 day ago
payments.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
pdf-download.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
pg-engine.test.ts feat(db): D19 P4 — DATABASE_URL engine selection + Postgres integration suite 4 days ago
pipeline.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
prepare-draft.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
preview-fidelity.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
preview-route.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
preview-sample.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
profile-me.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
projects-stalled-route.test.ts fix(api): validate ?days= and guard the onboarding-project routes against a crash (FIX B) 1 day ago
public-share.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
quote-followup.test.ts feat(docs): require a reason when cancelling a document 2 days ago
receipt.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
recurring.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
reminder-preview.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
reminder-schedule.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
reminders-page.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
reminders.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
renewals.test.ts feat(d27): #1 renewals command center + one-click module renewal quote (backend) 3 days ago
reports.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
scheduler-recurring.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
scheduler-scan.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
seed-templates.test.ts feat(onboarding): composed milestone templates (shared front + per-module tail) 2 days ago
send-reminder.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
series.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
settings-company.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
settings-reminders.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
settings-sharing.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
settings-template.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
shares.test.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 4 days ago
sms-balances.test.ts feat(sms): live-only balance list, no full-row red, mandatory creds on assign 2 days ago
sms-gateway.test.ts harden(d28): SSRF guard + no credential-URL leak on SMS gateway fetch 3 days ago
sms-rate-card.test.ts feat(d23): SMS volume-band billing (dated rate card, money locked) 4 days ago
stalled-onboarding.test.ts feat(onboarding): stalled-project query for the dashboard/MIS tile 2 days ago
template-accent.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
template-render.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
templates.test.ts chore: remove all 'Tecnostac' references — everything is SiMS 2 days ago
ticket-sla.test.ts feat(d28): #3 ticket desk — SLA aging + overdue filter + bill-from-ticket 3 days ago
ticket-types.test.ts feat(client-detail): quotation-step document link + ticket classification (backend) 1 day ago
tickets.test.ts feat(d31): store credentials in the clear (owner decision) + one-time migration 3 days ago