Loading module
Resolving locale, route permissions, and workspace projection.
svc-tenders Domain Ownership Map
This document maps the real domain ownership inside and around services/svc-tenders using code-first evidence.
It is not an aspirational target-state document.
Method
-
VERIFIED: directly confirmed in code, migrations, routes, or runtime docs.
-
INFERRED: likely from strong code evidence, but not fully proven end-to-end.
-
UNVERIFIED: not proven strongly enough to treat as truth.
-
REAL: durable backend behavior exists.
-
MIXED: partly durable, partly legacy/fallback/compatibility.
-
UI-FIRST: user-visible behavior depends materially on UI/session/local scaffolding.
READ 2026-03-28T23:42:21.903Z
READ 2026-03-29T04:52:41.869Z
CORE STRICT SAFE DELETE AFTER RERUN REPORT
PUBLIC | DRAFT | v1.0.0
READ 2026-03-29T03:13:33.020Z
SHELL: route or structure exists, but real domain behavior is thin.
MISSING: no real backend domain capability exists yet.
High-level verdict
VERIFIED: the true core of svc-tenders is still tender/procurement lifecycle plus declaration handling and the KES-backed event spine.
VERIFIED: svc-tenders currently hosts multiple real subdomains that are not long-term tender ownership:
- auctions
- vacancies
- accommodations
- ICPI
- Butkhuzi
- KES orchestration/backbone
VERIFIED: the strongest clean extraction candidates are ICPI first, then Butkhuzi, then vacancy/accommodation workstay domains.
VERIFIED: auctions are a future standalone domain, but not a safe first extraction because public bidder mutations are still not durably backend-backed.
VERIFIED: logistics/equipment does not yet meaningfully live inside svc-tenders as a standalone backend domain; only auction lot transport terms are durably stored there.
A. KEEP IN svc-tenders
| Capability | Current location | Current persistence / event usage | Confidence | System state | Ownership verdict | Coupling | Extraction readiness | Evidence |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Tender submission and tender lifecycle transitions | services/svc-tenders/src/server.ts routes /tenders/submit, /admin/tenders/:id/approve, /admin/tenders/:id/reject; services/svc-tenders/src/repository.ts createTenderWithEvent, updateTenderWithEvent; packages/tender-domain/src | tenders, tenders_events, legacy_tender_events; outbox to kes.orchestrator.domain-events | VERIFIED | REAL | Keep in svc-tenders | HIGH | NOT READY | server.ts lines 3133+; repository.ts lines 1681, 2229; docs/80_chain/EVENT_CATALOG.md |
| Tender declaration draft / assessment / ready / announce flow | services/svc-tenders/src/server.ts admin tender declaration routes; services/svc-tenders/src/repository.ts declaration methods; packages/core/tender/declaration.ts | tender_declarations, tender_declaration_events, tender_declaration_evidence | VERIFIED | REAL | Keep in svc-tenders | HIGH | NOT READY | repository.ts methods createTenderDeclarationDraft, updateTenderDeclarationDraft, markTenderDeclarationReady, declareTender; migrations 0037, 0038 |
| Tender review queue, internal tender reads, and procurement-facing read models | services/svc-tenders/src/repository.ts listReviewQueue, listInternalTenders, findInternalTenderById, listAllTenders; services/svc-tenders/src/server.ts public/admin tender reads | tenders + joined tender_declarations | VERIFIED | REAL | Keep in svc-tenders | HIGH | NOT READY | repository.ts tender list/find methods; server.ts /tenders, /tenders/me, /tenders/:id |
| Tender declaration evidence handling | services/svc-tenders/src/repository.ts tender evidence CRUD; tender admin routes in services/svc-tenders/src/server.ts | tender_declaration_evidence | VERIFIED | REAL | Keep in svc-tenders | MEDIUM | NOT READY | migration 0038_tender_declaration_evidence.sql; repository evidence methods |
B. EXTRACT LATER — future auctions domain/service
| Capability | Current location | Current persistence / event usage | Confidence | System state | Ownership verdict | Coupling | Extraction readiness | Evidence |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Auction declaration draft / assessment / ready / announce lifecycle | services/svc-tenders/src/server.ts auction declaration/admin routes; services/svc-tenders/src/repository.ts createAuctionDeclarationDraft, updateAuctionDeclarationDraft, markAuctionDeclarationReady, declareAuction | auction_declarations, auction_declaration_events, auction_declaration_evidence, auctions registry row updated by declaration | VERIFIED | REAL | Extract later to auctions domain | HIGH | PARTIAL | repository.ts lines 2360, 3276; migrations 0032, 0034 |
| Public auction list/detail registry read surface | services/svc-tenders/src/server.ts /auctions, /auctions/:id; services/api/src/auctions/gateway.ts; web readers in apps/web/src/portal/api.ts | auctions table in svc-tenders; but gateway/web fallback and compatibility layers exist | VERIFIED | MIXED | Extract later to auctions domain | MEDIUM | PARTIAL | server.ts lines 2266, 2289; docs/AUCTIONS_TRUTH_MAP.md |
| Auction settlement and entitlement linkage | services/svc-tenders/src/repository.ts settleAuction; internal admin/service paths in services/svc-tenders/src/server.ts | auctions.entitlement_id; linked winner settlement logic; output allocation adjacency | VERIFIED | REAL | Extract later to auctions domain, but only with careful settlement boundary design | HIGH | PARTIAL | repository.ts line 1833; migrations 0047, 0048 |
| Auction instrument semantics, including ACTUS-compatible terms and lot-level transport terms | packages/core/auction/declaration.ts; packages/tender-domain/src/instrument.ts; validation in services/svc-tenders/src/validation.ts; normalization in services/svc-tenders/src/repository.ts | stored inside auction declaration payload / registry projection JSON | VERIFIED | REAL | Extract later with auctions, not with standalone logistics | MEDIUM | PARTIAL | declaration/instrument schemas; repository normalizeAuctionInstrument, upsertAuctionRegistryStateFromDeclaration |
| Public bidder mutation flow: bid submit, Buy Now, pre-commit transport choice, winner fulfillment progression | Mostly web-only: apps/web/src/ui/auctions/compatibility, apps/web/src/ui/auctions/session; no durable bidder mutation route in svc-tenders | session storage overlays; no canonical auction bid write path in svc-tenders public surface | VERIFIED | UI-FIRST | Future auctions domain, but backend mutation path is not implemented yet | HIGH | NOT READY | docs/AUCTIONS_CANONICAL_WRITE_PATH.md; docs/AUCTION_ACTION_SURFACE_BOUNDARY.md; web compatibility/session modules |
C. EXTRACT LATER — future logistics / fulfillment / transport domain/service
| Capability | Current location | Current persistence / event usage | Confidence | System state | Ownership verdict | Coupling | Extraction readiness | Evidence |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Post-award transport / fulfillment coordination workspace | Web-only: apps/web/src/portal/components/TransportWorkspaceClient.tsx, apps/web/src/ui/transport/sessionTransportRequestState.ts, apps/web/src/ui/auctions/session/fulfillmentOverlay.ts | session storage only; no svc-tenders tables or routes | VERIFIED | UI-FIRST | Future logistics domain; not a current svc-tenders backend capability | LOW | NOT READY | no transport tables/routes in services/svc-tenders; web session stores only |
| General transport requests and equipment booking | Web-only Logistics & Equipment workspace; no svc-tenders route family | session storage only | VERIFIED | MISSING | Future logistics/equipment domain | LOW | NOT READY | apps/web/src/ui/transport/sessionTransportRequestState.ts; sessionEquipmentRequestState.ts; no matching backend routes |
| Tracking / dispatch / carrier coordination backend | No real svc-tenders implementation | none | VERIFIED | MISSING | Future logistics domain | LOW | NOT READY | no transport dispatch tables, consumers, or routes found in services/svc-tenders |
D. EXTRACT LATER — future accommodation / worker / travel platform
| Capability | Current location | Current persistence / event usage | Confidence | System state | Ownership verdict | Coupling | Extraction readiness | Evidence |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Vacancy posting draft / publish / close / reopen lifecycle | services/svc-tenders/src/vacancy/domain.ts, services/svc-tenders/src/vacancy/commandHandlers.ts, routes in services/svc-tenders/src/server.ts | vacancy_postings, outbox_events, in-process projection tables/views | VERIFIED | REAL | Extract later to accommodation/worker/travel platform | MEDIUM | PARTIAL | server.ts routes 322+; commandHandlers.ts; migration 0032_vacancy_write_model.sql |
| Vacancy application submission and owner/employer review | same vacancy domain modules + owner/applicant routes in services/svc-tenders/src/server.ts | vacancy_applications, my_vacancy_applications_view, vacancy_applications_by_posting_view, outbox_events | VERIFIED | REAL | Extract later to accommodation/worker/travel platform | MEDIUM | PARTIAL | routes 273+, 497+, 531+, 580+, 613+, 646+, 679+; vacancy projections |
| Public vacancy discovery and detail | services/svc-tenders/src/repository.ts listAllVacancies, findVacancyById; web readers in apps/web/src/portal/api.ts | mixed: vacancy_postings_view plus legacy vacancies fallback union | VERIFIED | MIXED | Extract later to accommodation/worker/travel platform, but only after legacy catalog cleanup | HIGH | PARTIAL | repository.ts WITH projected ... legacy ... UNION ALL; web fetchVacanciesCatalog() fallback to VACANCY_CATALOG |
| Accommodation listing draft / publish / unpublish lifecycle | services/svc-tenders/src/accommodation/domain.ts, services/svc-tenders/src/accommodation/commandHandlers.ts, routes in services/svc-tenders/src/server.ts | accommodation_listings, outbox_events, accommodation_listings_view, accommodation_listing_detail_view | VERIFIED | REAL | Extract later to accommodation/worker/travel platform | MEDIUM | PARTIAL | routes 714+, 747+, 781+, 861+, 878+; migration 0041_accommodation_write_model.sql |
| Accommodation booking request / confirm / reject / cancel | same accommodation modules; read model in services/svc-tenders/src/accommodation/readModel.ts | accommodation_bookings, projection views, outbox_events | VERIFIED | REAL | Extract later to accommodation/worker/travel platform | MEDIUM | PARTIAL | routes 897+, 926+, 943+, 970+; command handlers; read model |
| Public accommodation discovery / detail / quote | mixed between legacy repository-backed public catalog and newer listing write model | legacy accommodations table for public list/detail/quote; newer accommodation_listings* for owner-side management | VERIFIED | MIXED | Extract later to accommodation/worker/travel platform, but not before public/owner model convergence | HIGH | PARTIAL | repository.ts listAllAccommodations, findAccommodationById query accommodations; AccommodationReadRepository exists but public endpoints still hit legacy reads |
| Accommodation booking read surfaces (/my-accommodation-bookings, /accommodation-listings/:id/bookings) | services/svc-tenders/src/server.ts | route exists, but returns hardcoded empty arrays despite real read model availability | VERIFIED | MIXED | Extract later to accommodation/worker/travel platform after route truth hardening | MEDIUM | NOT READY | server.ts lines around 1014, 1038; AccommodationReadRepository already has getMyAccommodationBookings, getAccommodationBookingsByListing |
| Nearby jobs / nearby stays coupling | Web pages under apps/web/src/app/[locale]/(portal)/accommodations and vacancy/accommodation catalogs | mostly UI-level composition over mixed vacancy/accommodation read surfaces | VERIFIED | MIXED | Future accommodation/worker/travel platform responsibility | LOW | PARTIAL | accommodation detail/list pages compose vacancy proximity from public catalog readers |
E. EXTRACT LATER — future ICPI platform
| Capability | Current location | Current persistence / event usage | Confidence | System state | Ownership verdict | Coupling | Extraction readiness | Evidence |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| ICPI price point ingestion, list/read, latest lookup, suggestion, estimation | routes in services/svc-tenders/src/server.ts /icpi/*; repository methods in services/svc-tenders/src/repository.ts; gateway proxy in services/api/src/routes/icpi.ts | icpi_price_points; no Kafka dependence found | VERIFIED | REAL | Future standalone ICPI platform | LOW | READY | server.ts routes 1159+, 1187+, 1204+, 1226+, 1266+; ICPI_SERVICE_URL ?? TENDERS_SERVICE_URL proxy |
F. EXTRACT LATER — future Butkhuzi platform
| Capability | Current location | Current persistence / event usage | Confidence | System state | Ownership verdict | Coupling | Extraction readiness | Evidence |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Butkhuzi norms store, search, suggest, and admin upsert | routes in services/svc-tenders/src/server.ts /butkhuzi/*; repository methods in services/svc-tenders/src/repository.ts; gateway proxy in services/api/src/routes/butkhuzi.ts | butkhuzi_norms, butkhuzi_chunks | VERIFIED | REAL | Future standalone Butkhuzi platform | MEDIUM | PARTIAL | routes 1307+, 1335+, 1357+, 1413+, 1562+; migrations 0009, 0012; proxy supports BUTKHUZI_SERVICE_URL |
| Chunk rebuild / search as KES knowledge substrate | Butkhuzi routes + KES UI consumers in web | same tables; currently used mainly through KES/admin-facing flows | VERIFIED | MIXED | Future Butkhuzi platform, but KES dependency keeps coupling medium | MEDIUM | PARTIAL | apps/web/src/portal/api.ts Butkhuzi readers/writers referenced from KES page; no standalone web route found |
G. MOVE / ALIGN WITH SHARED KVARY BACKBONE
| Capability | Current location | Current persistence / event usage | Confidence | System state | Ownership verdict | Coupling | Extraction readiness | Evidence |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| KES case/task/inspection/payment orchestration | services/svc-tenders/src/server.ts /kes-orchestrator/*; services/svc-tenders/src/repository.ts createKesOrchestratorCase, approveKesOrchestratorLandowner, publishKesOrchestratorAuction, confirmKesOrchestratorFunding, payment/task flows | kes_orchestrator_cases, kes_orchestrator_tasks, kes_orchestrator_inspections, kes_orchestrator_payments, kes_orchestrator_events | VERIFIED | REAL | Shared Kvary execution/backbone, not long-term tender ownership | HIGH | PARTIAL | routes 1585+ through 2236+; repository methods 5805+; migrations 0024, 0025 |
| Kafka outbox relay, domain-event projection consumer, idempotency, DLQ/replay | services/svc-tenders/src/kafka, config in services/svc-tenders/src/config.ts | kes_outbox_events, kafka_consumer_idempotency, kes_domain_event_projection_*; topics kes.orchestrator.events, kes.orchestrator.events.dlq, kes.orchestrator.domain-events | VERIFIED | REAL | Shared Kvary event backbone | HIGH | PARTIAL | kesOutboxRelay.ts, kesDomainEventConsumer.ts, kesEventConsumer.ts, kesDlqReplay.ts, kesOutboxPoisonReplay.ts; EVENT_CATALOG.md |
| Service-auth principal enforcement as cross-domain runtime dependency | services/svc-tenders/src/server.ts requireServiceAuth and principal checks; auth ownership outside svc-tenders | no domain-owned persistence in svc-tenders; depends on shared auth/identity | VERIFIED | REAL | Shared Kvary backbone concern | MEDIUM | PARTIAL | server.ts uses requireServiceAuth, requireActivePrincipal; see docs/AUTH_AND_IDENTITY_BOUNDARY.md |
H. LEGACY / UNCLEAR / NEEDS FOUNDER DECISION
| Capability | Current location | Current persistence / event usage | Confidence | System state | Ownership verdict | Coupling | Extraction readiness | Evidence |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Output allocations after auction declaration/settlement | services/svc-tenders/src/server.ts output-allocation routes; services/svc-tenders/src/repository.ts allocation methods | output_allocations; linked to auction IDs, entitlement IDs, and awarded outputs | VERIFIED | REAL | Founder decision needed: future auctions vs financial/settlement layer vs shared registry service | HIGH | NOT READY | migration 0035_output_allocations_v1.sql; repository methods createOutputAllocation, updateOutputAllocation, listOutputAllocations |
| Legacy public vacancy catalog residue | services/svc-tenders/src/repository.ts vacancies fallback queries; web fallback catalog in apps/web/src/features/domains/vacancyCatalog.ts | vacancies legacy table plus VACANCY_CATALOG UI fallback | VERIFIED | MIXED | Legacy residue inside future workstay domain | MEDIUM | PARTIAL | listAllVacancies and findVacancyById union/fallback logic; web fetchVacanciesCatalog() fallback |
| Legacy public accommodation catalog residue | services/svc-tenders/src/repository.ts public accommodations queries; web fallback catalog in apps/web/src/features/domains/accommodationCatalog.ts | accommodations legacy table plus ACCOMMODATION_CATALOG UI fallback | VERIFIED | MIXED | Legacy residue inside future workstay domain | MEDIUM | PARTIAL | listAllAccommodations, findAccommodationById; web fetchAccommodationsCatalog() / fetchAccommodationById() fallback |
| outbox_events for vacancy/accommodation domains | services/svc-tenders/src/vacancy/commandHandlers.ts, services/svc-tenders/src/accommodation/commandHandlers.ts, migration 0032_vacancy_write_model.sql | local event log used for in-process projection; no Kafka relay or cross-service contract discipline found | VERIFIED | MIXED | Needs founder/architecture decision: remain local projection aid inside future workstay platform, or evolve into broader event boundary later | MEDIUM | PARTIAL | inserts into outbox_events in both command handlers; no corresponding relay worker found |
Practical ownership conclusions
VERIFIED: the safest statement is that svc-tenders is currently hosting one real tender domain, one real shared execution/event backbone, and several colocated future product domains.
VERIFIED: ICPI is the cleanest extraction candidate.
VERIFIED: Butkhuzi is real enough to extract later, but is still functionally tied to KES workflows and admin knowledge operations.
VERIFIED: vacancy and accommodation flows are real subdomains already, but both are still contaminated by legacy public catalog compatibility and partial read wiring.
VERIFIED: auctions belong to a future standalone domain, but public bidder mutations are still too UI-first for a clean extraction.
VERIFIED: logistics/equipment should become its own platform later, but there is almost no backend domain inside svc-tenders to extract today.