From 020c06f1727c85957aed3d42e803348e3fe97f2f Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sun, 30 Aug 2026 14:43:50 +0200 Subject: [PATCH] fix(housekeeping): connect hotel asset ownership --- src/features/housekeeping/domains/hotel/routes.test.ts | 6 ++++++ src/features/housekeeping/domains/hotel/routes.ts | 5 +++-- .../foundation/foundation-source-contract.test.ts | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/features/housekeeping/domains/hotel/routes.test.ts b/src/features/housekeeping/domains/hotel/routes.test.ts index 02aa72c3..6fac4be4 100644 --- a/src/features/housekeeping/domains/hotel/routes.test.ts +++ b/src/features/housekeeping/domains/hotel/routes.test.ts @@ -3,6 +3,7 @@ import { economyMigrationEntries } from "../../migration/economy"; import { hotelMigrationEntries } from "../../migration/hotel"; import { HOUSEKEEPING_ROUTE_HANDLERS } from "../../route-handlers"; import { hotelManifest } from "./manifest"; +import { HOTEL_ASSET_QUERY_OWNERSHIP } from "./queries/assets"; import { HOTEL_ASSET_CANONICAL_ROUTES, HOTEL_PRIMARY_ROUTE_IDS, @@ -55,6 +56,11 @@ describe("Hotel primary routes", () => { }); it("keeps badge and soundtrack ownership canonical in Economy", () => { + expect(HOTEL_ASSET_CANONICAL_ROUTES.map((asset) => asset.routeId)).toEqual([ + HOTEL_ASSET_QUERY_OWNERSHIP.badges, + HOTEL_ASSET_QUERY_OWNERSHIP.sounds, + ]); + for (const asset of HOTEL_ASSET_CANONICAL_ROUTES) { const entry = economyMigrationEntries.find( (candidate) => candidate.legacyPath === asset.legacyPath, diff --git a/src/features/housekeeping/domains/hotel/routes.ts b/src/features/housekeeping/domains/hotel/routes.ts index 73748210..9f4d26cc 100644 --- a/src/features/housekeeping/domains/hotel/routes.ts +++ b/src/features/housekeeping/domains/hotel/routes.ts @@ -4,6 +4,7 @@ import { type CanonicalHousekeepingHref, type HousekeepingRouteDefinition, } from "../../foundation/contracts"; +import { HOTEL_ASSET_QUERY_OWNERSHIP } from "./queries/assets"; export const HOTEL_ROUTE_GROUPS = ["rooms", "navigation", "radio"] as const; export type HotelRouteGroup = (typeof HOTEL_ROUTE_GROUPS)[number]; @@ -88,12 +89,12 @@ export function hotelRouteGroup(id: HotelPrimaryRouteId): HotelRouteGroup { export const HOTEL_ASSET_CANONICAL_ROUTES = Object.freeze([ Object.freeze({ legacyPath: "/admin/badges", - routeId: "economy.rewards.badges", + routeId: HOTEL_ASSET_QUERY_OWNERSHIP.badges, href: "/ase/economy/rewards/badges", }), Object.freeze({ legacyPath: "/admin/sounds", - routeId: "economy.rewards.sounds", + routeId: HOTEL_ASSET_QUERY_OWNERSHIP.sounds, href: "/ase/economy/rewards/sounds", }), ] as const); diff --git a/src/features/housekeeping/foundation/foundation-source-contract.test.ts b/src/features/housekeeping/foundation/foundation-source-contract.test.ts index 0cf0277c..da34a31d 100644 --- a/src/features/housekeeping/foundation/foundation-source-contract.test.ts +++ b/src/features/housekeeping/foundation/foundation-source-contract.test.ts @@ -23,6 +23,10 @@ const SERVER_CAPABILITY_CONTEXT = const PERMISSIONS_ADAPTER = "src/lib/permissions"; const DOMAIN_MODULE_ROOT = "src/features/housekeeping/domains"; const approvedRuntimeImports = new Map>([ + [ + "src/features/housekeeping/domains/hotel/routes.ts", + new Set(["src/features/housekeeping/domains/hotel/queries/assets"]), + ], [ "src/features/housekeeping/domains/people/commands/community-commands.ts", new Set(["src/features/housekeeping/domains/people/services/mutations"]),