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. -
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 ofsvc-tendersis still tender/procurement lifecycle plus declaration handling and the KES-backed event spine.VERIFIED:svc-tenderscurrently 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 insidesvc-tendersas 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, |
| Auction instrument semantics, including ACTUS-compatible terms and lot-level transport terms | ; ; validation in ; normalization in | stored inside auction declaration payload / registry projection JSON | | | Extract later with auctions, not with standalone logistics | | | declaration/instrument schemas; repository , |
| Public bidder mutation flow: bid submit, Buy Now, pre-commit transport choice, winner fulfillment progression | Mostly web-only: , ; no durable bidder mutation route in | session storage overlays; no canonical auction bid write path in public surface | | | Future auctions domain, but backend mutation path is not implemented yet | | | ; ; 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 | , , routes in | , , , | | | Extract later to accommodation/worker/travel platform | | | routes , , , , ; migration |
| Accommodation booking request / confirm / reject / cancel | same accommodation modules; read model in | , projection views, | | | Extract later to accommodation/worker/travel platform | | | routes , , , ; command handlers; read model |
| Public accommodation discovery / detail / quote | mixed between legacy repository-backed public catalog and newer listing write model | legacy table for public list/detail/quote; newer for owner-side management | | | Extract later to accommodation/worker/travel platform, but not before public/owner model convergence | | | , query ; exists but public endpoints still hit legacy reads |
| Accommodation booking read surfaces (, ) | | route exists, but returns hardcoded empty arrays despite real read model availability | | | Extract later to accommodation/worker/travel platform after route truth hardening | | | lines around , ; already has , |
| Nearby jobs / nearby stays coupling | Web pages under and vacancy/accommodation catalogs | mostly UI-level composition over mixed vacancy/accommodation read surfaces | | | Future accommodation/worker/travel platform responsibility | | | 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 | uses , ; see |
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, , migration | local event log used for in-process projection; no Kafka relay or cross-service contract discipline found | | | Needs founder/architecture decision: remain local projection aid inside future workstay platform, or evolve into broader event boundary later | | | inserts into in both command handlers; no corresponding relay worker found |
Practical ownership conclusions
VERIFIED: the safest statement is thatsvc-tendersis 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 insidesvc-tendersto extract today.