Files
evig/scripts/db
Mao NakamotoandClaude Opus 4.7 8b82b35691 refactor(it-hilfe): SSOT cleanup pass — TTLs, pagination, budget tiers, routes (MMM.1)
Five SSOT/DRY fixes derived from an end-to-end IT-Hilfe code-health
audit:

1. REQUEST_EXPIRY_DAYS = 30 (config/it-hilfe.ts) + comment in migration
   010 referencing it. Previously: 30-day TTL hardcoded in SQL only —
   tuning required touching the migration.

2. CLAIM_TOKEN_TTL_DAYS = 7 / CLAIM_TOKEN_TTL_MS (config). Previously:
   `const CLAIM_TOKEN_TTL_MS = 7 * 24 * 60 * 60 * 1000` inlined at
   api/it-hilfe/requests/route.ts:304 with a wall of comments
   explaining the magic number.

3. IT_HILFE_PAGINATION { defaultLimit: 20, maxLimit: 50 } (config).
   Replaced object-literal at five API routes:
     - /api/it-hilfe/requests
     - /api/it-hilfe/my-requests
     - /api/it-hilfe/my-offers
     - /api/it-hilfe/helper/my-offers
     - /api/it-hilfe/helper/matching-requests
   Single edit-point for paging policy.

4. getBudgetTierById(id) helper + named lookup in HelperCard.tsx.
   Previously: BUDGET_TIERS[0].badgeClass (gratis) and BUDGET_TIERS[1]
   .badgeClass (kulturlegi) — positional indexing breaks the moment
   anyone reorders the BUDGET_TIERS array.

5. IT_HILFE.routes.createForTechnician(id) builder. Replaced three
   inline template literals `/it-hilfe/create?technician=${...}` in
   /techniker/[id]/page.tsx (lines 149, 154, 253).

Out-of-scope (separate commits needed):
  - Rename helper/technician/repairer to one canonical term
  - Add composite (status, expires_at) index on it_hilfe_requests
  - Remove unused serviceCategory column from itHilfe schema
  - Implement Professional-tier write-path (currently dead code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-07 14:42:11 +02:00
..