Commit Graph
6 Commits
Author SHA1 Message Date
GandClaude Opus 4.8 0a01a8727e fix(payments): make Payrexx truly plug-and-play (webhook signature, capture, partial-config guard) (#191)
Audit of the Payrexx integration found gaps that would break live payments the
moment real credentials are added. Closes them so go-live is config-only:

G1 (critical) — webhook signature header. The handler read `payrexx-signature`,
but Payrexx signs with `X-Webhook-Signature` (lowercase-hex SHA-256 HMAC of the
raw body, key as UTF-8 — which the code already computes correctly). With the
wrong header every live webhook was rejected (fail-closed) → customers charged
but orders never advance. One-line header fix.

G2 — capture for workshops/appointments. Gateways only RESERVE funds (authorize);
capture was wired only for marketplace. Non-escrow workshop/appointment payments
were authorized but never captured → the hold expires (~7 days) and the money is
never collected. The webhook now captures non-escrow generic payments immediately
on the reserved event (after the state commit, with loud logging on failure so a
user is never locked out of what they paid for). Escrow payments stay held.

G3 — escrow auto-release. The old `scripts/auto-release-escrow.js` was dead
frankenstein code (Stripe + retired Neon DB_* vars) — deleted. Replaced with a
real `GET /api/cron/release-escrow` that captures any escrow still held past its
deadline (Payrexx), + a `revampit-cron@release-escrow.timer` (daily 04:00). Tested.

G4 — partial-config guard. `isPayrexxConfigured()` ignores the webhook secret, so
a config with INSTANCE+SECRET but no WEBHOOK_SECRET silently charges customers
while rejecting every webhook. `createGateway` now logs a loud error in that exact
state (`isPayrexxPartiallyConfigured()`).

Also: `reservation` now sent as the documented `1` (the string "true" is coerced
to 0 by Payrexx's PHP backend → reservation silently disabled); removed dead
`getBaseUrl()`; rewrote docs/operations/PAYREXX_SETUP.md as the precise
plug-and-play go-live checklist.

Verified live behavior unchanged in mock mode; typecheck + lint + umlauts clean;
full suite 530/7688 green.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 15:52:58 +02:00
GandClaude Opus 4.8 bf28d7a8f7 chore(ops): record E2E test org-content + account purge script (#168)
Companion to purge-demo-content.sql. Records the one-time prod cleanup (already
applied) that truncated E2E org content (blog/jobs/workshops/decisions/protocols/
tasks — all "E2E …" titled) and deleted all ~53 test accounts, keeping only the
two real staff users (georgy.butaev@, shop@), georgy's real membership
application, and the 3 physical locations. Prod is now a clean slate.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 21:31:29 +02:00
GandClaude Opus 4.8 f40453ddce fix(technicians): kill fabricated stats (SSOT), show avatars; purge demo data (#167)
The public technician profile showed fabricated data — "George" (a seeded test
account) with 80 reviews / 80 jobs / 5.0★ / verified / professional but ZERO
backing review rows. Root cause: aggregate columns were seeded with fake numbers
and `recomputeTechnicianAggregate` only updated technicians that HAD reviews
(inner join), so a 0-review tech kept stale/seeded values forever.

- recomputeTechnicianAggregate now LEFT JOINs a base row + COALESCE, so a
  technician with no published reviews is reset to 0/0.0 — fake aggregates can
  no longer survive a recompute.
- Technician profile now shows the real avatar (user_profiles.avatar_url, joined
  in getTechnicianById) with the initial-letter fallback. Avatar upload already
  works at /dashboard/profile → /api/uploads → Cloudflare R2 (storage was never
  missing — it's R2, verified live).
- scripts/ops/purge-demo-content.sql: the one-time prod cleanup (already applied)
  that TRUNCATEd the E2E/demo content (159 listings, 150 IT-Hilfe requests, 82
  appointments, 75 erfassung items, reviews, conversations) + removed the
  fabricated technician profiles, keeping all user accounts and org tables.

The profile's stats render was already guarded (>0), so with truthful data a
no-review technician simply shows no rating/jobs line.

typecheck + lint clean; full suite zero new failures vs baseline.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 21:02:37 +02:00
Mao NakamotoandCursor e4411bfd4f fix(db): Hetzner-only DATABASE_URL SSOT and user/admin E2E smoke
Retire cloud DB and AUTH_DB_* split in code, env examples, and docs so
local dev uses Docker Postgres and prod ops use the Hetzner tunnel pattern.
Add Playwright user-admin-flows spec with locale-aware auth helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 13:04:46 +02:00
Mao NakamotoandClaude Opus 4.8 84959214e4 feat(ops): restore the 4 Vercel crons as systemd timers (+ CRON_SECRET)
Retiring Vercel silently killed its 4 cron jobs (close-decisions,
close-it-hilfe-requests, prune-audit-log, wake-recurring-tasks) — nothing was
running them on the box. Re-created them as systemd timers (UTC schedules
matching the old vercel.json) driven by run-cron.sh, which calls the local
/api/cron/* endpoints with Authorization: Bearer $CRON_SECRET and fails non-zero
on any non-200. Also generated + set CRON_SECRET on the box (it was unset, so the
endpoints were publicly triggerable; now they return 401 without the bearer).
All four verified: HTTP 200 end-to-end. Docs in scripts/ops/README.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 04:01:29 +02:00
Mao NakamotoandClaude Opus 4.8 3c37586e25 feat(ops): nightly off-box DB + uploads backup to R2 (revampit-backups)
Prod Postgres lives only on the Hetzner box since Neon was retired, so this is
the single copy's safety net. pg_dump (custom format, as the postgres superuser
via peer auth — the app role lacks USAGE on the drizzle schema) + a tar of the
local uploads dir are pushed to the PRIVATE R2 bucket revampit-backups with
30-day retention. Reuses the app's bundled @aws-sdk and the same S3_* creds
already in app/.env (one R2 token covers all buckets) — nothing extra to
configure. systemd timer runs it nightly at 03:30 UTC; verified end-to-end.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 03:19:26 +02:00