Commit Graph

22 Commits (24f52fad0a8e9663e4df1efc88df140283eeaeb2)

Author SHA1 Message Date
Thomas Joise 58c97994bd feat(d28): SMS gateway live balance sync (BalAlert API) + daily auto + low alert
Pull each SMS client's actual credit balance from the provider panel instead of
manual entry. sms.balance_api_url (dated setting, default 164.52.195.161/API/
BalAlert.aspx) returns pipe-delimited code|STATUS|payload; parseBalanceResponse
reads the trailing number and flags ERROR lines, never guessing. Uses each
subscription's already-imported username/password_enc — the automated path decrypts
directly (no reveal-audit spam) and audits sms_balance ONLY when it changes;
per-poll telemetry lands in the unaudited sms_balance_check table (SQLite schema +
PG migration 010). Managerial 'Refresh from gateway' button (POST /reports/sms-
balances/refresh) + per-client refresh; scheduler does one pass per day
(maybeRefreshSmsDaily). Low-balance alert on the Dashboard + cockpit tile. Needs
HQ_SECRET_KEY (import-time key) to decrypt — no-ops with a clear message otherwise,
never stores plaintext. Parser unit-tested; full suite 408 green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 days ago
Thomas Joise 3247585e52 docs(d26): functional-gaps record (GST, search, statement, bulk, AWS)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 days ago
Thomas Joise 921fd7e6d1 docs(d25): module order, username login, nginx XFF, hardcoded-DB caveat
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 days ago
Thomas Joise 0a7b7e6118 docs: record SQL-injection re-audit (clean) + D25 PWA/mobile + nginx XFF
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 days ago
Thomas Joise 70234161dc fix(d24): pg allocation row-lock + index ordering; docs (D24 record, 389 tests)
- recordPayment locks the target invoice row (SELECT ... FOR UPDATE, Postgres
  only — SQLite is serialized by the connection mutex) before reading
  outstanding, so concurrent payments cannot over-allocate on prod.
- INDEX_DDL now runs AFTER migrate() in openDb, so indexes referencing
  migrate-added columns (owner_id, lockout cols) build on older DBs.
- D24 remediation recorded in 06-DECISIONS; test counts 377 -> 389.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 days ago
Thomas Joise 86af9ecb27 docs(d22): onboarding tracker D-record; test count 377
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 days ago
Thomas Joise 0e85163b68 docs(d23): SMS rate-card D-record; catalogue additions; test count 372
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 days ago
Thomas Joise 13d2b5fabb docs(d21): stamp DELIVERED, D-record, real-data verification, test count 363
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 days ago
Thomas Joise 2d4344e098 docs(d20): stamp DELIVERED with trial-import reconciliation; D20+D21 records
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 days ago
Thomas Joise bb8dfc3b97 docs: D20 — hq.simssoftware.com on the company EC2; runbook gets the decided target + RDS-first sequencing (D19 switch delivered)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4 days ago
Thomas Joise 30a1ea1c0a docs: D19 delivered — spec stamped with deviations, D-record, env docs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 days ago
Thomas Joise 19fe037bb4 docs: record the review pass — 345 tests, all 8 findings closed
STATUS: count + review summary, D18 sentence in the intro, honest migrate()
column list, routes table gains /reminders /documents /profile /import and the
collapse/user-menu shell description. README + CLAUDE: 345. D18 record in
06-DECISIONS gains the review outcome. Spec banner notes the post-review
deltas (CSV support columns, LIKE filters).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 days ago
Thomas Joise 8064c49465 docs: record the delivered D18 go-live cluster — 344 tests, gaps closed, spec stamped (Phase 10)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 days ago
Thomas Joise 418555179b docs: bring every document current — runbook gains D16 go-live knobs, delivery stamps on all executed specs/plans, 14-SPEC delivery note, README doc table
- DEPLOY-HQ.md §6b: share.base_url (required for quote follow-up emails),
  quote.followup.policy manual/auto, dated reminder_schedule cadences,
  employee accounts + account-owner assignment at go-live
- STATUS/README/CLAUDE already at 293 tests; specs/plans now carry their
  DELIVERED/EXECUTED stamps so the archive reads honestly

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 days ago
Thomas Joise 7862452989 docs: record funnel phases 7-10 delivered — 293 tests, gaps list updated (D16 final)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 days ago
Thomas Joise 5a1c84f1de docs: record quote-to-close funnel slice (D16)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 days ago
Thomas Joise 803320a5d5 docs(decisions): D16 — employees ride staff_user; GET /employees returned whole
Records the decision the code already cites (staff_user IS the employee
table; rename would churn FKs and audit names) and the reviewed deviation
from the funnel spec's blanket pagination rule: GET /employees returns the
bounded console-user set whole with total, no page/pageSize.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 days ago
Thomas Joise 75e1795bfd docs: bring planning docs current with the HQ/Store split
Update the shared-heritage docs that still described the old combined monorepo:
D15 and the HQ console spec now note the 2026-07-16 split into two independent
repos, and the deploy runbook uses the correct repo name (sims-hq, was sims-next).
Historical decisions are preserved; only stale present-tense/naming is corrected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 days ago
Thomas Joise 115f2e6c41 docs: HQ project identity (README, STATUS, CLAUDE) + fix cross-repo doc links
Adds the front-page README, a first STATUS.md build-state doc (the console had
none), and a CLAUDE.md with the house rules that govern this repo. De-links four
references to Store-only planning docs (04-ROADMAP, 08-MARKET-ARCHITECTURES,
09-UX-FLOWS-AND-MENUS) that now live in the Store repo, and regenerates the
lockfile to drop the removed Store workspace entries.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 days ago
Thomas Joise fbf39d7a51 docs+chore: HQ DDL snapshot, gitignored import-drop, Postgres locked pre-go-live (D15)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2 weeks ago
Thomas Joise 3cfda5b55d docs: record one-repo/two-apps confirmation + HQ-DB-as-cloud-nucleus rule (D15)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2 weeks ago
Thomas Joise cb5df2f0d6 docs: HQ ops console spec (D15) + roadmap/decisions updates
New docs/14-SPEC-HQ-CONSOLE.md: internal ops console (apps/hq) for the
~300 Classic clients - quotations/proforma/invoices in minutes with Gmail
send, recurring billing + reminders, AMC, per-client AWS cost, interaction
log; replaces the internal Oracle APEX app. Doc-11 HQ Console started early.

Also: HQ workstream in 04-ROADMAP, D15 in 06-DECISIONS, cross-refs in
doc 11 + STATUS. First commit of the docs baseline (00-17).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2 weeks ago