Files
evig/scripts/db/migrations/116_drop_technician_applications.sql
Mao NakamotoandClaude Opus 4.8 6bd1f9ae8f refactor(repairer): remove orphaned pro-repairer application/certification flow
The "professional repairer" application flow let users apply to become vetted
pro technicians pending admin approval — but the professional tier was never
assigned to any profile, so the whole pipeline (apply → review → approve/reject,
certification + document verification) produced only dead pending/rejected rows
with no downstream effect. Removed entirely.

Deleted (36 files): /api/repairer/apply, all /api/admin/repairer-applications
routes, /api/admin/documents + /api/admin/certifications routes, the
/admin/repairer-applications page, the 9-file review-UI component dir, the
repairer email templates, and the now-dead certification-status.ts +
document-status.ts config.

Shared-file edits:
- schema: dropped the `repairerApplications` (technician_applications) table
- TABLE_NAMES: removed REPAIRER_APPLICATIONS + the 4 cert/doc tables that the
  deleted routes queried (those 4 never had a migration — they never existed)
- dashboard: removed the repairer-application count + inline action
  (getDashboardStats / buildActionItems / types / InlineActionButton)
- actions.ts: removed approveRepairerApplicationAction
- config/permissions/nav: removed the `repairer-applications` section,
  permission alias, and breadcrumb
- IT-Hilfe admin: the empty-state CTAs (which pointed at the deleted review
  page) now point at the technician directory /it-hilfe/techniker; DE copy
  updated to reflect that technicians self-register
- email: removed the repairer + adminNewRepairerApplication templates/exports
- config/repairer-status: removed REPAIRER_APPLICATION_STATUS(+_LABELS)

Migration 116 drops technician_applications (CASCADE).

KEPT (the live community-technician / IT-Hilfe flow): repairer_profiles
(profile_tier='community'), technician_services/availability/reviews,
getActiveTechnicianProfileId, all /api/it-hilfe/* + /it-hilfe/* pages,
TechnicianProfileSchema, the dashboard totalTechnicians count.

Verified: 0 dangling references, 0 typecheck errors, lint clean, 131 test
suites / 3082 tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 18:06:15 +02:00

23 lines
1.2 KiB
SQL

-- Migration 116: drop the orphaned pro-repairer application table
--
-- The PRO-repairer application/certification flow is removed. It let users apply
-- to become vetted "professional" technicians, pending admin approval — but the
-- professional tier was never assigned to any profile, so the table held only
-- pending/rejected applications with no downstream effect. All of its code
-- (/api/repairer/apply, /api/admin/repairer-applications, the admin review UI,
-- certifications/documents verification) is deleted in the same change.
--
-- KEPT (the live community-technician / IT-Hilfe flow): technician_profiles,
-- technician_services, technician_availability, technician_reviews, and the
-- whole /api/it-hilfe/* + /it-hilfe/* two-sided marketplace. Technicians
-- self-register at /it-hilfe/techniker (profile_tier = 'community').
--
-- The certification/document verification tables the deleted routes referenced
-- (repairer_certifications, certification_types, verification_documents,
-- document_types) were only ever named in TABLE_NAMES — no migration ever
-- created them — so there is nothing to drop for those.
--
-- Renamed repairer_applications -> technician_applications in migration 105.
DROP TABLE IF EXISTS technician_applications CASCADE;