The dual-persona job ran 13 journey specs (create/submit/approve real rows)
against prod, where fixture data doesn't exist — the service-appointment
journey needs the user persona to BE a technician and has been the standing
red. Prod keeps the read-only route inventory; the journeys move to the
seeded ephemeral e2e-local CI job (upcoming commit).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same disease as reviews/101b: created on prod via drizzle-kit push, present in
no migration — from-scratch replays lacked them. Two are actively written
(user_lockouts by the auth rate-limiter, activity_feed by logActivity);
location_approvals only survived CI replay because 085 guards on to_regclass.
Exact prod DDL, fully idempotent; re-attaches the 085 immutability trigger
that fresh replays skipped. Verified: full 96-migration local replay clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Legacy cleanup (access control verified — no prod user holds legacy keys):
- Delete /admin/products (+components/hooks/APIs with zero live callers),
/admin/analytics (+orphaned service), /admin/timecards redirect stub
- Factsheet print view is a LIVE feature, not legacy: re-homed to
/admin/erfassung/[id]/factsheet, "Factsheet drucken" restored on the
erfassung success screen (routes.ts erfassungFactsheet)
- sections.ts: drop 'analytics' + duplicate 'finances' (finanzen stays);
'timecards' + 'products' kept as live permission keys with repointed paths
- permissions.ts: remove migrateOldRole + dead aliases (finances→finanzen,
it-hilfe→it-hilfe-admin); design aliases kept and documented
- TIME_OFF_REVIEW notifications now deep-link /admin/team/approvals
CI Pipeline (red since ≥1.7. while deploys stayed green):
- 101b_reviews_table_baseline.sql: `reviews` was Drizzle-pushed, never
migrated — from-scratch replay died at 102. Baseline = exact prod DDL,
idempotent, trigger guarded; full 94-migration replay verified locally
- 108_notification_types_membership_content.sql: CHECK constraint gains
membership_payment_recorded + content_submission_status (drops orphaned
membership_approved)
- /admin/workshops/proposals: quick action, routes.ts, /admin/workshops/new
and proposal emails all deep-link an index that never existed → redirect
stub to /admin/workshops
- E2E accounts recreated on prod (lost in Neon cutover) + AUTH_TEST_*
secrets rotated; login lockout clears with this deploy's restart
Also: approvals hero singular fix ("1 Inhalt wartet").
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Three user-reported issues:
1. **Profile "Validierungsfehler" on save.** GET /api/user/profile returns `null`
for empty columns, but UpdateProfileSchema only accepted `string|undefined`, so
loading a sparse profile and clicking Save failed validation on ~18 null fields.
Schema fields are now `.nullish()` (null = empty) — the API accepts what it returns.
2. **Timecards with leave never submitted / never reached approvers (migration 107).**
The timecard_entries CHECK constraints (migration 067) predated the config's Swiss
absence categories (ferien/krank/unfall/feiertag/militaer/unbezahlt) and 0-minute
unpaid markers, so ANY card containing a leave entry failed to INSERT → submit
rolled back → status never became 'submitted' → the approvals queue was always
empty, even for a superadmin. Migration realigns the constraints with the config
SSOT (category list + duration_minutes >= 0). Must reach the prod Hetzner DB.
3. **Submit far from fill controls.** Save/Einreichen lived only in the top header
while fill-from-plan + leave buttons are mid-page. Added a sticky bottom action
bar so submit is always one tap away after filling.
typecheck clean.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Found during P1 E2E testing of the paid-workshop flow. The paid-registration path
and the payment webhook read/increment `workshop_instances.current_participants`
for capacity checks, but that column was created by the legacy cms-api migration
system and is NOT in any scripts/db/migrations/ file — so a migration-built DB
(including prod) can lack it, which would 500 the paid-registration INSERT the
moment Payrexx goes live. (The dev DB was indeed missing it.)
Idempotent: ADD COLUMN IF NOT EXISTS + backfill from confirmed registrations.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
The "Dual-persona inventory smoke" job had failed on every recent deploy — it
logs in as butaeff@gmail.com (a test account purged this session) and runs 14
journeys, several of which MUTATE production (it-hilfe/marketplace/workshops),
re-polluting prod with exactly the E2E data we cleaned. A perpetually-red,
prod-polluting check provides no signal.
Replace it with scripts/post-deploy-smoke.sh: read-only, no login, no mutation —
asserts the key public pages render (200) and the DB-backed public APIs return
"success":true (technicians, listings, workshops, services, stats, health). This
exercises the real queries (incl. the just-renamed technician_profiles), catching
a broken deploy/schema mismatch the page-render gate alone might miss. Fast
(curl-only; drops the Node/Playwright install), deterministic, 5-min timeout.
The heavier authenticated dual-persona journeys remain available for deliberate
runs via `npm run test:e2e:inventory:prod` (now requires an explicit real
AUTH_TEST_USER_EMAIL — the hardcoded purged-account default was removed).
Verified: the new smoke passes all 13 checks against prod.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The first deploy of migration 105 failed: prod has an empty orphan
`technician_profiles` table (created by 002b-simplified-auth, never adopted —
live data is in repairer_profiles), so the rename errored "relation already
exists". The page-render gate aborted cleanly (prod stayed on the prior release;
the failed migration rolled back atomically, never recorded).
Fix: DROP TABLE IF EXISTS technician_profiles (0 rows, no inbound FKs) before the
renames. Verified on prod with BEGIN…ROLLBACK — renames apply cleanly.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"Repairer" and "technician" are the same concept; the API/service layer already
uses "technician" (/api/technicians SSOT, technician-service) but the DB tables
still carried the old name. This renames the tables so the schema matches.
- Migration 105: ALTER TABLE repairer_{profiles,services,availability,reviews,
applications} RENAME TO technician_*. Postgres carries indexes + inbound FKs
automatically (views/FKs track by OID). Idempotent (IF EXISTS).
- Drizzle pgTable() names + TABLE_NAMES values updated in lockstep, so every
query (Drizzle + sql.raw(TABLE_NAMES.*)) targets the new names.
Scope (deliberately kept to bound risk — all separately riskier):
- the `repairer_id` / `repairer_profile_id` COLUMN names (data/SQL churn),
- the `'repairer'` user-role VALUE (stored data + every role check),
- the JS identifiers `repairerProfiles`/`REPAIRER_PROFILES` (cosmetic, internal,
tsc-guarded — a follow-up cosmetic pass).
No production code hardcodes the table names outside TABLE_NAMES/Drizzle (verified
by grep), so there is no un-tsc-guarded raw-SQL risk.
typecheck + lint + umlauts clean; full suite identical 7-suite baseline failures,
zero new. Migration auto-applies after 104 on deploy.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Phase 4, re-scoped after a per-field write-site audit found NO mirror duplication
— the role-profile contact/bio/avatar fields hold legitimately-distinct business
data (entered via separate forms), so the original "consolidate into user_profiles"
idea was dropped as contraindicated. Only the dead/placeholder columns are cleaned:
- Migration 104: repairer_profiles.phone/address NOT NULL → nullable; normalize
the '' placeholders (self-service community techs, who never enter business
contact) to NULL. Drop the dead seller_profiles.phone/address/postal_code
columns (never written by any code path; the seller form only collects city).
- Schema: drop .notNull() on repairer phone/address; remove the seller columns.
- technician-service.upsertTechnicianProfile no longer writes the '' placeholders.
No readers of the dropped seller columns. typecheck + lint clean; full suite zero
new failures vs baseline. Docs: ARCHITECTURE_DEBT #5 Phase 4 (re-scoped, done).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
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>
`marketplace_listings` (RevampIT internal-shop table) and the /api/shop/inventory
routes were superseded by the unified `listings` table (RevampIT stock carries
is_revampit=true, published via publishRevampitListing). The table was dead for
writes (orphan rows only). Removed end-to-end:
- Repointed the 4 remaining readers off marketplace_listings to `listings`:
- /api/stats/community -> count active `listings`
- /api/stats/impact -> drop the separate shop-sold count, which DOUBLE-COUNTED
RevampIT sold items (already present in `listings` via is_revampit). Bugfix.
- /api/admin/search-index -> recent `listings`
- /api/user/donations -> derive the "listed" stage from inventory_items.marketplace_status
(no marketplace_listings join); sold_at from inventory_items.updated_at.
- Removed the admin "Shop Produkte" tab: deleted /api/shop/inventory[/[id]] routes,
useShopProducts hook, ShopProductsTable, ProductTabSwitcher, and the orphaned
inventory-service (getInventoryProducts/getInventoryProductByUuid). Collapsed
ProductManagement to the single Erfassung-inventory view; dropped the now-dead
unpublish flow. /admin/products still works (inventory view + erfassung return-to).
- Schema/config: removed the marketplaceListings Drizzle table + MARKETPLACE_LISTINGS
from TABLE_NAMES; archived the one-time backfill script.
- Migration 103 drops the table (must reach the Hetzner prod DB). No FK references it.
- Docs: .claude/CLAUDE.md + ARCHITECTURE_DEBT updated (storefront unified).
The /shop/* pages stay as redirects to /marketplace for legacy URLs.
typecheck + lint clean; full suite zero new failures vs baseline.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Three stores held technician ratings but only `reviews` fed the displayed
aggregate, so service-appointment ratings (inline `customer_rating`) and the
legacy `repairer_reviews` table never counted, and the aggregate itself had an
overwrite bug (the IT-Hilfe and repairer recomputes each set only their own
slice). Now `reviews` is the single source:
- Service-appointment "rate" mirrors into `reviews` via createReview
(target_type=repairer, booking_id=appointment) so it feeds the aggregate.
- New recomputeTechnicianAggregate() computes repairer_profiles.average_rating /
total_reviews from ALL of a technician's reviews — IT-Hilfe (via accepted
offer) + repairer (incl. mirrored appointment ratings) combined — replacing the
two slice-specific updaters that overwrote each other. Verified end-to-end
(IT-Hilfe 5 + repairer 3 → 4.00, count 2).
- Migration 102 backfills history from the inline ratings + repairer_reviews into
`reviews` (idempotent), then recomputes every technician's aggregate. Legacy
columns/table left in place (deprecated) for a later contract step.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Offers carried only a free-text proposed_compensation ("CHF 40", "nach Absprache")
— unqueryable/unverifiable. Add a structured proposed_amount_cents (migration 101)
captured via a CHF field in the offer form, surfaced in the offers list, and
returned by the offers/my-offers APIs. The accepted offer's amount is now the
recorded agreed compensation (money may still settle off-platform for the
solidarity model; this records the figure). Labels added in all 8 locales.
Also fixes the offers-route test: the earlier A2 change wrapped the offer write +
count bump in db.transaction(), which the test's db mock didn't provide — added
transaction() to the mock (tx reuses the same builders) so the suite is green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- A1 (critical): the new-request match fan-out was gated on isVerified=true, so
self-serve COMMUNITY technicians (the persona this feature targets, default
is_verified=false with no self-serve verification) never got notified — the
discovery loop silently failed for them. Notify all ACTIVE skill-matched techs;
verified stays a trust badge, not a notification gate.
- A2: offer_count had two writers (DB trigger from migration 090 + the API),
double-counting every fresh offer. Migration 100 drops the trigger fn CASCADE
(app is now the sole writer; it handles insert/resurrect/withdraw) and
reconciles existing counts; the offers POST now wraps the offer write + count
bump in one transaction. Also fixes dev/prod parity (dev push has no triggers).
- A3: onboarding checklist linked to the non-existent /dashboard/repairer (404)
→ /dashboard/techniker.
- A4: repairer_profiles.profile_tier defaulted to 'professional' (opposite of the
self-serve community model) → default 'community' (migration + schema).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fills the ~3,500 previously-untranslated keys across the six non-DE locales
(es/it/ja/ko/ru fully; fr completed) — the gaps that made pages render in mixed
German. ICU placeholders and plural structures preserved (verified: zero
placeholder mismatches per locale); brand/product names kept verbatim; array
shapes unchanged (array-parity gate green); all translated pages render 200.
Adds a staleness detector (scripts/i18n-stale.mjs + messages/_source-baseline.json):
records a hash of the DE source each translation was made from, and flags
translations whose DE source later changed — catching the "locale shows the old
copy" class that nothing previously detected (e.g. the stale RU homepage CTA).
Workflow: edit DE → `npm run i18n:stale` lists what drifted → re-translate →
`npm run i18n:stale-update <locale>`. Wired into `npm run compliance`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
home.finalCta.note in fr/es/it/ja/ko/ru still held an OLD version of the note
with a hardcoded, wrong email ("…napišite nam — info@revamp-it.ch"), while DE
was rewritten to "Geräte spenden bleibt möglich unter Mitmachen." The key wasn't
missing (so DE fallback never kicked in) — it had drifted. Updated all six to the
current meaning. Org contact data (the real address is empfang@revamp-it.ch in
org.ts) must never be baked into a translated string.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
hardware-recycling, linux-open-source and web-design-development were each
defined three times — a bespoke static page (the only one that renders, since
literal route segments shadow the [service] dynamic route), a service_types DB
row, and a servicePresentation entry. The DB row + presentation entry were dead:
getAllServiceSlugs() generated permanently-shadowed [service] routes for them,
and editing them changed nothing visible (a content trap).
- Migration 099 soft-deactivates the 3 service_types rows (is_active=false).
Deactivate, not DELETE: service_appointments cascades on delete, so this
preserves history, is reversible, and drops them from getAllServiceSlugsFromDb
(which filters is_active=true).
- Removed the 3 servicePresentation entries (and now-dangling icon imports), so
they no longer feed getAllServiceSlugs either.
- Dropped the misleading `slug` on linuxOpenSource in SERVICE_CONFIGS — it
advertised online booking that the static page never offered.
The 3 services now live exactly once (their static page). Template services
(computer-repair-upgrades, data-recovery-transfer) are untouched.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds end-to-end HR pipeline from public job postings through admin review to
team_profiles on hire, with migrations, E2E journey, and runbook docs.
Co-authored-by: Cursor <cursoragent@cursor.com>
Blog draft → publish → public view journey; exempt known prod test emails from IT-Hilfe create rate limit so inventory can run all journeys back-to-back.
Co-authored-by: Cursor <cursoragent@cursor.com>
Deterministic sense_check flow with absolute quorum 1; wired into prod inventory script and feature inventory (#98, #99).
Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise create, process-notes JSON import, review UI, and finalize without
depending on LLM availability on prod.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add admin create → checklist gate → publish E2E and coerce selling_price_chf
before toFixed so published intake detail no longer hits the error boundary.
Co-authored-by: Cursor <cursoragent@cursor.com>
Normalize Postgres TIME to HH:MM on timecard API reads so resubmit no longer
400s. Align preferred-technician selection with community visibility SSOT.
Add prod E2E for timecards, IT-Hilfe preferred flow, and richer dynamic
route discovery (orders, sellers, admin detail pages).
Co-authored-by: Cursor <cursoragent@cursor.com>
The migration drift job referenced a script excluded by *.sh; add an
exception so CI can replay migrations on fresh pgvector Postgres.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add dual-persona E2E for workshop propose/approve/reject (#61–62) and wire it
into post-deploy inventory. CI now replays all migrations on pgvector Postgres
with idempotent guards so fresh-DB apply matches prod evolution.
Co-authored-by: Cursor <cursoragent@cursor.com>
Community technicians are public when active; Techniker terminology SSOT;
dynamic ID discovery and empty-state fallbacks; Payrexx setup doc; dual-persona
E2E for workshops registration and service appointment assign flow.
Co-authored-by: Cursor <cursoragent@cursor.com>
Admin creates request, user techniker offers/completes, admin accepts/reviews.
Post-deploy and CI inventory now include journey; add service repair and
upcycling routes to the inventory matrix.
Co-authored-by: Cursor <cursoragent@cursor.com>
Post-deploy job hits 186 routes as user + admin when E2E passwords are
in GitHub secrets; CI also runs optional prod inventory on PRs/main.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Notify staff on timecard submit and submitters on review; fix TIME HH:MM
submit validation and membership/marketplace bell deep links; add feature
inventory SSOT and Playwright smoke tests for appointments and notifications.
Co-authored-by: Cursor <cursoragent@cursor.com>
Unify technician profiles on repairer_profiles with backfill migration 095,
add completeness banner and owner preferred-technician sidebar, extend browse
filters (skill, service type, match my skills), and return 410 Gone for legacy
list APIs pointing callers to /api/technicians and successor routes.
Co-authored-by: Cursor <cursoragent@cursor.com>
Vercel is retired (deploys run via GitHub Actions → Hetzner self-host). Removed
the now-dead Vercel deploy cluster: vercel.json, public/vercel.svg,
scripts/{add-vercel-env,deploy-to-vercel}.sh, and the whole tools/deployment/
dir (deploy.sh + its trigger/keybind/ship wrappers, all funneling into the
Vercel CLI deploy). Dropped the package.json deploy:vercel and setup-deploy
scripts that pointed into it. The 4 crons vercel.json defined are now systemd
timers on the box (previous commit). Nothing in CI/husky/the self-host deploy
referenced any of these.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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>
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>
Prod image uploads were broken: the local-fs path was gated to dev only and S3
was never configured, so uploads returned an error in production. Make local-fs
the universal fallback (writes to public/uploads), and have the deploy symlink
each release's public/uploads → a persistent /opt/revampit/uploads store so
images survive deploys and are served by Next at /uploads/*.
Provider-agnostic: setting S3_* (R2/Hetzner/any S3) switches to object storage
with zero code change; absent S3_*, it falls back to this durable local store.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Root-cause fix for prod schema drift. Prod runs its OWN Postgres on the Hetzner
box (localhost/revampit), NOT Neon — but migrations were only ever applied to
the dev Neon DB, so prod sat at 087 while the repo was at 091 and cart (089),
the IT-Hilfe trigger (090) and time-off (091) were 500ing in production.
- selfhost-deploy-revampit.sh now applies any not-yet-recorded
scripts/db/migrations/*.sql to the prod DB (in a transaction, ON_ERROR_STOP)
BEFORE activating the release, and aborts the deploy if one fails. Both deploy
paths (local pre-push hook + GitHub Actions) use this script, so drift can't
recur. The 4 missing migrations were applied to prod manually as the hotfix.
- .claude/CLAUDE.md: corrected the stale "this project uses Neon" section —
prod = self-hosted Hetzner Postgres, dev = Neon, and auth is still mid-cutover
on Neon (documented so it gets finished).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Schema for the upcoming self-service time-off request + approval cycle.
Recorded in schema_migrations; the table already exists on Neon so repo and
live DB stay in sync. Feature code (API/UI) lands in a follow-up.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Image-management investigation found two issues:
- Deploy orphaned ALL user uploads: /api/uploads writes to public/uploads at
runtime, but the deploy replaces the whole app dir each release → every
uploaded listing photo/avatar/IT-Hilfe image was lost on the next deploy.
Copy public/uploads forward into each new release before the swap. INTERIM
durability fix until images move to S3/object storage (needs Hetzner keys).
- updateProductImage cleaned up old images only if the URL matched the dead
blob.vercel-storage.com host (Vercel Blob is gone). Replace with a
backend-agnostic deleteImage() call guarded on a differing URL.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CRITICAL prod bug found via E2E: submitting an offer on a repair request always
500'd. The trigger function update_peer_repair_offer_count() (fires on every
it_hilfe_offers INSERT/DELETE) still referenced peer_repair_requests — the table
was renamed to it_hilfe_requests but the function wasn't updated, so every offer
insert failed with "relation peer_repair_requests does not exist". The entire
"offer help on a repair request" flow was unusable.
Migration 090 repoints the function at it_hilfe_requests (applied to prod).
Verified end-to-end: request → offer → accept (conversation created) → complete
→ review (helper-rating update now runs cleanly via the earlier helper_id fix).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>