Loading module
Resolving locale, route permissions, and workspace projection.
WorkStay Extraction Prep Map
Purpose
This document records the current extraction-preparation truth for the future accommodation-worker platform that may later become a standalone WorkStay-style runtime.
It does not claim that a unified WorkStay backend already exists.
It distinguishes between:
- current accommodation domain truth
- current vacancy / worker domain truth
- future combined platform intent
- compatibility residue that still blocks clean extraction
Labels used here:
VERIFIED
INFERRED
UNVERIFIED
REAL
MIXED
UI-FIRST
SHELL
MISSING
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
1. Current accommodation-owned surface
2. Current vacancy / worker-owned surface
3. Current booking / reservation / application truth
| Surface | Classification | Ownership | Notes |
| --- | --- | --- | --- |
| Accommodation booking writes | VERIFIED REAL | accommodation-owned | Durable and active through AccommodationCommandHandlers. |
| Accommodation booking reads | VERIFIED REAL | accommodation-owned | Uses AccommodationReadRepository, not fake placeholder arrays anymore. |
| Vacancy applications | VERIFIED REAL | vacancy/worker-owned | Durable applicant + owner review flow. |
| Unified stay-work recommendation / assignment backend | VERIFIED MISSING | future WorkStay-candidate-owned | No durable backend boundary found that combines bookings and worker placement into one service contract. |
4. Current nearby / workstay coupling truth
| Surface | Current location | Classification | Ownership | Notes |
| --- | --- | --- | --- | --- |
| Accommodation catalog nearby vacancy previews | apps/web/src/features/domains/accommodationCatalog.ts | VERIFIED UI-FIRST | future WorkStay-candidate-owned, currently UI-first | Nearby vacancy previews are assembled in frontend catalog helpers, not from backend WorkStay contracts. |
| Vacancy catalog accommodation and transport options | apps/web/src/features/domains/vacancyCatalog.ts | VERIFIED UI-FIRST | future WorkStay-candidate-owned, currently UI-first | Catalog includes accommodation/transport options and policy text, but this is frontend fallback/catalog composition. |
| Workforce portal | apps/web/src/app/[locale]/(portal)/workforce/page.tsx | VERIFIED UI-FIRST | ambiguous future WorkStay-candidate-owned | Page is explicitly backed by frontend mock data and presented as read-only structural input. |
| Map layers for vacancies / accommodations / workforce | apps/web/src/features/map/layers/vacanciesLayer.ts, apps/web/src/features/map/layers/accommodationsLayer.ts, apps/web/src/features/map/layers/workforceLayer.ts | VERIFIED UI-FIRST | future WorkStay-candidate-owned, currently UI-first | All three layers point at frontend mock datasets, not backend spatial APIs. |
| Transport-nearby linkage | apps/web/src/app/[locale]/(portal)/transport/page.tsx | VERIFIED MISSING for WorkStay backend | shared-Kvary / future logistics, not current WorkStay backend | Current transport page is auction/logistics oriented, not accommodation-worker backend logic. |
| Sabre-style travel expansion | no real code found in inspected backend surfaces | VERIFIED MISSING | future platform intent only | No present backend contract or module should be treated as current travel ownership. |
5. Temporary hosting points inside svc-tenders
| Hosting point | Classification | Notes |
| --- | --- | --- |
| services/svc-tenders/src/server.ts route composition | VERIFIED SHELL | Vacancy/accommodation route modules are injected from the mixed service shell. |
| services/svc-tenders/src/repository.ts compatibility hosting | VERIFIED MIXED | Root repository still hosts compatibility residue for vacancy/accommodation reads. |
| shared shell auth ingress passed through route support | VERIFIED SHELL | requireServiceAuth, requireActivePrincipal, and parser helpers are still shell-owned. |
| local projection event log in outbox_events | VERIFIED MIXED | Real for vacancy/accommodation, but still hosted inside svc-tenders runtime assumptions and not yet a clean standalone event boundary. |
6. Shared Kvary backbone dependencies
These dependencies look acceptable to remain shared even after future WorkStay extraction:
- shared auth / identity principal resolution
- gateway proxy façade in
services/api
- DB pool and runtime config patterns
- generic shell ingress helpers such as bearer extraction and JWT verification
These do not justify keeping accommodation/vacancy permanently inside svc-tenders.
7. Likely future combined WorkStay-owned surface
The following combined platform surface is strategically plausible, but not yet unified in code:
| Future combined surface | Current truth | Notes |
| --- | --- | --- |
| accommodation discovery + owner listing management | partly ready | Real backend exists, but public compatibility residue and gateway asymmetry remain. |
| vacancy discovery + posting/application lifecycle | partly ready | Real backend exists, but public vacancy discovery still has dual truth. |
| booking + application operator flows | mostly ready | Both are durable and route-backed today, though still separate domain modules. |
| nearby stay ↔ nearby work intelligence | not ready | Mostly frontend catalog/mock composition today. |
| workforce discovery / supply register | not ready | Current page is mock-backed and lacks backend ownership. |
| travel integration seam | not ready | No current backend contract or implementation found in inspected surfaces. |
8. Minimum credible extraction-prep package
The smallest credible extraction-prep package is not yet a single runtime. It is a candidate package made of real modules plus explicit “stay for now” residue.
Move-first candidates
Keep temporarily during prep
Move later, only after backend truth exists
- workforce portal/backend
- nearby stay-work intelligence contracts
- travel / Sabre-style contract boundary
- transport-adjacent logic not currently backed by WorkStay backend routes
9. Top blockers before actual extraction
| Blocker | Severity | Type | Why it blocks extraction | Next reduction step |
| --- | --- | --- | --- | --- |
| Dual public vacancy truth (vacancy_postings_view + vacancies fallback) | HIGH | code+infra | Public discovery is still mixed, so extracted vacancy service would inherit legacy fallback decisions immediately. | Decide whether to converge public vacancy reads onto projections or explicitly preserve legacy fallback behind a named compatibility seam. |
| Accommodation compatibility residue in root repository | MEDIUM | code-only | Active routes are cleaner than root hosting, but legacy catalog reads still keep the ownership story mixed. | Move accommodation contracts away from root compatibility hosting or retire old consumers. |
| Incomplete accommodation gateway seam | HIGH | code+infra | Public reads and owner reads can target ACCOMMODATIONS_SERVICE_URL, but booking/listing mutations and my-accommodation-bookings still proxy only to TENDERS_SERVICE_URL. | Give accommodation mutation and booking routes the same explicit env seam as public/owner reads. |
| No unified WorkStay contracts | MEDIUM | code-only | Vacancy and accommodation are still separate route/repository contracts with no combined package boundary. | Extract domain-local contracts or package boundaries for accommodation and vacancy first. |
| UI-first nearby stay/work and workforce surfaces | MEDIUM | code-only | Future WorkStay intelligence surface does not yet have backend ownership. | Decide whether those features are deferred or need a first backend contract before extraction. |
| Root repository compatibility dependence | MEDIUM | code-only | Older callers still reach vacancy/accommodation through TendersRepository. | Inventory and reduce remaining root compatibility callers before extraction execution. |
| Local outbox_events usage without clear external event contract | MEDIUM | code+infra | Projection/event flow is real but service-local, not yet a clean shared event seam. | Decide whether WorkStay keeps this as local projection infrastructure or exposes explicit integration events later. |
| Web/service fallback type duplication | LOW | code-only | The web app keeps fallback domain catalogs and corresponding view types beside backend contracts. | Document which frontend types are UI fallback only versus future shared domain contracts. |
10. Recommended extraction direction
Recommended next direction is:
- treat vacancy and accommodation as two real backend subdomains inside one future WorkStay candidate boundary
- do not pretend workforce / nearby intelligence / travel are already backend-owned
- harden code boundaries and contracts for vacancy + accommodation first
- reduce compatibility residue and gateway asymmetry second
- only then define a true combined WorkStay runtime package
That sequence is safer than inventing a unified platform abstraction before current code truth is stable.