WorkStay Code Boundary Hardening
Purpose
This document records the first real code-boundary hardening pass for the current backend surfaces that most credibly belong to a future WorkStay-style platform:
- vacancy
- accommodation
It does not claim that a unified WorkStay runtime already exists.
1. Vacancy-owned contracts moved or isolated
Added vacancy-owned contract module:
This module now owns:
StoredVacancySummaryStoredOwnerVacancyPostingStoredMyVacancyApplicationStoredVacancyApplicationOwnerViewStoredOwnerVacancyApplicationVacancyRouteSupport- re-exported validation-facing vacancy input types
What changed around it:
- services/svc-tenders/src/routes/registerVacancyRoutes.ts now imports
VacancyRouteSupportfrom the vacancy-owned contract module instead of defining it inline. - services/svc-tenders/src/routes/support/vacancyRouteSupport.ts now depends on the vacancy-owned contract module instead of the route file.
- services/svc-tenders/src/vacancy/readRepository.ts, services/svc-tenders/src/vacancy/readModel.ts, and compatibility repositories now import active vacancy result types from the vacancy-owned contract module instead of from the mixed root repository.
- services/svc-tenders/src/vacancy/validation.ts now exports validation-facing vacancy input types directly.
2. Accommodation-owned contracts moved or isolated
Added accommodation-owned contract module:
This module now owns:
StoredAccommodationSummaryStoredAccommodationDetailStoredAccommodationGalleryItemStoredOwnerAccommodationListingAccommodationListingListItemAccommodationListingDetailMyAccommodationBookingItemAccommodationBookingByListingItemOwnerAccommodationReservationItemAccommodationRouteSupport- re-exported validation-facing accommodation input types
What changed around it:
- services/svc-tenders/src/routes/registerAccommodationRoutes.ts now imports
AccommodationRouteSupportfrom the accommodation-owned contract module instead of defining it inline. - services/svc-tenders/src/routes/support/accommodationRouteSupport.ts now depends on accommodation-owned contract types instead of the route file and read-model file for those payload shapes.
- services/svc-tenders/src/accommodation/readModel.ts, services/svc-tenders/src/accommodation/ownerReadRepository.ts, services/svc-tenders/src/accommodation/compatibilityReadRepository.ts, and services/svc-tenders/src/accommodation/quote.ts now use accommodation-owned contract definitions.
3. Mixed dependencies reduced
The most important mixed-dependency reduction in this sprint was:
- the active vacancy/accommodation type definition site is no longer the root services/svc-tenders/src/repository.ts
Instead:
- the root repository now imports and re-exports those types for compatibility
- domain modules define the types they actively use
That means the root repository remains a compatibility host, but not the primary contract owner for the active vacancy/accommodation runtime paths.
4. Compatibility residue that still remains
This sprint did not hide the still-mixed parts:
- vacancy public reads still fall back to legacy
vacanciesinside services/svc-tenders/src/vacancy/readRepository.ts - accommodation compatibility reads against legacy
accommodationsstill exist in services/svc-tenders/src/accommodation/compatibilityReadRepository.ts - root compatibility hosting still remains in services/svc-tenders/src/repository.ts
- shell-owned auth/principal ingress still comes from the broader
svc-tendersshell
These are still real blockers to full extraction and should remain explicit.
5. What still blocks real extraction
Main remaining blockers after this sprint:
- vacancy public dual-truth read path
- root compatibility hosting still present for older vacancy/accommodation callers
- accommodation compatibility catalog residue still present
- shell-owned auth/principal ingress is still shared rather than runtime-local
- vacancy and accommodation are now better-bounded, but still separate domains rather than a unified extracted WorkStay package
6. Net result
This sprint made the code boundary more truthful:
- vacancy owns vacancy contracts
- accommodation owns accommodation contracts
- the root repository is less of a contract-definition site
- route-support contracts are no longer defined inside route modules themselves
That is a safer base for future vacancy-runtime prep, accommodation-runtime prep, or a later combined WorkStay extraction decision.