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/src
Thomas Joise 4ee8f17b37 fix(onboarding-migration): preserve ad-hoc custom steps across the template swap
Final whole-branch review FIX 3.

migrateOnboardingTemplates previously DELETEd every project_milestone row and
reinserted only template keys, so a project-specific step added via
addProjectMilestone ("+ Add step", custom_* keys) vanished with no trace if
un-ticked, or was miscounted as `dropped` if ticked.

Old rows are now partitioned before the DELETE into template-mapped vs
ad-hoc custom (not a template key, not in KEY_MAP, and not a known old
generic FRONT_FALLBACK/TAIL_FALLBACK key like amc_start — those keep their
existing drop behavior). Custom rows are re-inserted unchanged after the
template block, sort continuing past it, preserving
label/done/done_on/payment_id/document_id. The return type and the audit
`after` payload both gained a `preserved` count/list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 day ago
..
api.ts fix(milestones): reject front/tail key collisions; dedupe on collision; stamp installed/trained dates 1 day ago
audit.ts feat(d27): #8 audit-log viewer (owner-only) 3 days ago
auth.ts feat(d36): login history (IP + device) + first-login change nudge 2 days ago
aws-costs.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
bounces.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
crypto.ts feat(d32): remove the key concept entirely + keyless legacy cleanup 3 days ago
db-pg.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
db.ts feat(client-detail): quotation-step document link + ticket classification (backend) 1 day ago
gmail.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
import-apex-full.ts feat(d21): P4 — importer seeds module field_spec + writes field_values 4 days ago
import-apex.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
migrate-onboarding-templates.ts fix(onboarding-migration): preserve ad-hoc custom steps across the template swap 1 day ago
migrate-plaintext.ts feat(d32): remove the key concept entirely + keyless legacy cleanup 3 days ago
migrations-pg.ts feat(client-detail): quotation-step document link + ticket classification (backend) 1 day ago
pdf.ts fix(sec/d24): PDF render hardening — strict CSP + request interception 4 days ago
rate-limit.ts fix(sec/d24): auth hardening — login lockout, rate limits, constant-time, trust proxy 4 days ago
reminder-templates.ts feat(documents): invoice due dates — terms default + override, honest overdue chase (Phase 1, D18) 5 days ago
repos-amc.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-aws.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-branches.ts feat(d20): P1 — ticket desk, client branches, per-service data (schema + repos) 4 days ago
repos-clients.ts feat(d37): society category (Kerala co-op directory taxonomy) on clients 2 days ago
repos-dashboard.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-documents.ts feat(sms): bulk SMS purchase proforma + document source tagging (renewal vs top-up) 2 days ago
repos-email.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-employees.ts feat(d34): import employee master + invited/pending-login flag 2 days ago
repos-interactions.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-login-events.ts feat(d36): login history (IP + device) + first-login change nudge 2 days ago
repos-milestones.ts fix(milestones): reject front/tail key collisions; dedupe on collision; stamp installed/trained dates 1 day ago
repos-mis.ts feat(d28): #6 SMS credit review + low-balance upsell 3 days ago
repos-modules.ts feat: show + download SMS logins; install details in Module data 3 days ago
repos-payments.ts fix(payments): exclude draft proformas from outstanding (owner decision) 2 days ago
repos-pipeline.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-rate-card.ts feat(d23): SMS volume-band billing (dated rate card, money locked) 4 days ago
repos-recurring.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-reminders.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-renewals.ts feat(sms): bulk SMS purchase proforma + document source tagging (renewal vs top-up) 2 days ago
repos-reports.ts feat(d26): functional gaps — GST summary, doc search, bulk ops (backend) 3 days ago
repos-search.ts feat(d28): Portals quick-list + global search (clients/docs/tickets) 3 days ago
repos-shares.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
repos-sms.ts feat(sms): live-only balance list, no full-row red, mandatory creds on assign 2 days ago
repos-tickets.ts feat(client-detail): quotation-step document link + ticket classification (backend) 1 day ago
scheduler.ts feat(d28): SMS gateway live balance sync (BalAlert API) + daily auto + low alert 3 days ago
seed.ts feat(client-detail): quotation-step document link + ticket classification (backend) 1 day ago
send-reminder.ts feat(db): D19 P1-P3 — async DB interface, dual engines, Postgres adapter 5 days ago
series.ts fix(sec/d24): money-integrity guards — CN cap, atomic doc-no, qty, TDS, markStatus 4 days ago
server.ts chore(deploy): apply prod DB URL + onboarding-pipeline deploy script 1 day ago
sms-gateway.ts harden(d28): SSRF guard + no credential-URL leak on SMS gateway fetch 3 days ago
templates.ts feat(d37): society category (Kerala co-op directory taxonomy) on clients 2 days ago