Large File Decomposition Plan
Status: ACTIVE
Audit Date: 2026-03-16
Cleanup Sprint: 01
Method
- Scope prioritized:
services/apiservices/svc-authpackages/identity-infraservices/svc-tenders- active user-facing
apps/web
- Threshold:
- especially files above ~800 LOC
Inventory
| File | Approx LOC | Responsibility Mix | Recommendation | Status |
| --- | ---: | --- | --- | --- |
| services/svc-tenders/src/repository.ts | 8865 | repository, domain transitions, SQL mapping, projections, KES, auctions, vacancies, accommodations, reference data | split by subdomain repositories first, then query helpers | deferred |
| services/svc-tenders/src/server.ts | 5055 | route registration, validation, authz, command wiring, read paths across many domains | split by route families into modules, keep bootstrap thin | deferred |
| | 5722 | page shell, workspace state, designer UX, storage, orchestration surface | split UI sections and local state hooks | deferred |
| | 5722 | same as above | deduplicate with locale-neutral composition | deferred |
| | 3110 | logistics booking UI, equipment booking UI, operations UI, filtering, selection state | split by tab and selection/option components | deferred |
| | 3010 | orchestration UI, controls, visualization, state | split control-plane widgets and data hooks | deferred |
| | 2995 | detail rendering, bidding UX, eligibility, transport, winner fulfillment, session overlays | split action panel, dossier, settlement, fulfillment blocks | deferred |
| | 2929 | API mapping, fallbacks, mock handoff, portal DTO translation | split by domain fetchers and fallback adapters | deferred |
| | 1720 | auth routes, OIDC, 2FA, sessions, profile, admin | split by route families, keep app bootstrap thin | deferred |
| | 1610 | repository for sessions/accounts/profile/admin/auth state | split by account/session/token/profile repositories | deferred |
| | 1215 | validation across tenders, auctions, declarations, supporting inputs | split by domain schemas and declaration submodules | deferred |
| | 1177 | auth, stakeholder onboarding, reviewer actions, context, admin roles | split auth routes, stakeholder routes, reviewer routes | deferred |
| | 971 | auth client, token handling, refresh/session behavior | split transport, token storage, refresh flow | deferred |
| | 961 | onboarding workflow UI, form orchestration, submission | split step components and persistence hooks | deferred |
| | 794 | list UX, filtering, overlay state, portal composition | split filter model and row/card composition | deferred |