feat(housekeeping): deliver hotel operations
This commit is contained in:
1 parent
bfc5bd78a1
commit
abc707cfb2
43 files changed
+3749
-615
No files matched your search
@@ -2,6 +2,7 @@ import "server-only";
|
||||
|
||||
import { CONTENT_COMMANDS } from "../../domains/content/commands/content-commands";
|
||||
import { ECONOMY_COMMANDS } from "../../domains/economy/commands/economy-commands";
|
||||
import { HOTEL_COMMANDS } from "../../domains/hotel/commands/hotel-commands";
|
||||
import { COMMUNITY_COMMANDS } from "../../domains/people/commands/community-commands";
|
||||
import { MODERATION_COMMANDS } from "../../domains/people/commands/moderation-commands";
|
||||
import { SUPPORT_COMMANDS } from "../../domains/people/commands/support-commands";
|
||||
@@ -44,6 +45,7 @@ export function registerHousekeepingCommands<
|
||||
const currentHousekeepingCommands = defineHousekeepingCommands(
|
||||
...CONTENT_COMMANDS,
|
||||
...ECONOMY_COMMANDS,
|
||||
...HOTEL_COMMANDS,
|
||||
...USER_COMMANDS,
|
||||
...COMMUNITY_COMMANDS,
|
||||
...SUPPORT_COMMANDS,
|
||||
|
||||
@@ -6,6 +6,7 @@ import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { CONTENT_ROUTE_IDS } from "../domains/content/routes";
|
||||
import { ECONOMY_ROUTE_IDS } from "../domains/economy/routes";
|
||||
import { HOTEL_PRIMARY_ROUTE_IDS } from "../domains/hotel/routes";
|
||||
import { PEOPLE_ROUTE_IDS } from "../domains/people/routes";
|
||||
import { SYSTEM_ROUTE_IDS } from "../domains/system/routes";
|
||||
import { HOUSEKEEPING_MANIFESTS } from "../manifests";
|
||||
@@ -698,11 +699,134 @@ const approvedRuntimeImports = new Map<string, ReadonlySet<string>>([
|
||||
"src/features/housekeeping/domains/system/routes",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/commands/hotel-commands.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/commands/radio-commands",
|
||||
"src/features/housekeeping/domains/hotel/commands/room-commands",
|
||||
"src/features/housekeeping/domains/hotel/services/mutations",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/manifest.ts",
|
||||
new Set(["src/features/housekeeping/domains/hotel/routes"]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-command-form.tsx",
|
||||
new Set(["src/actions/housekeeping-command"]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-page-frame.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/queries/rooms",
|
||||
"src/features/housekeeping/domains/hotel/routes",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/pages/navigation.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-page-frame",
|
||||
"src/features/housekeeping/domains/hotel/queries/rooms",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/pages/radio.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-command-form",
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-page-frame",
|
||||
"src/features/housekeeping/domains/hotel/queries/rooms",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/pages/room-detail.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-command-form",
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-page-frame",
|
||||
"src/features/housekeeping/domains/hotel/queries/rooms",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/pages/room-furni.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-command-form",
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-page-frame",
|
||||
"src/features/housekeeping/domains/hotel/queries/rooms",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/pages/rooms.tsx",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-command-form",
|
||||
"src/features/housekeeping/domains/hotel/pages/hotel-page-frame",
|
||||
"src/features/housekeeping/domains/hotel/queries/rooms",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/queries/hotel-production.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/queries/rooms",
|
||||
"src/features/housekeeping/domains/hotel/routes",
|
||||
"src/lib/db",
|
||||
"drizzle-orm",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/queries/radio.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/queries/hotel-production",
|
||||
"src/features/housekeeping/domains/hotel/queries/rooms",
|
||||
"src/lib/services/radio",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/queries/rooms.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/queries/hotel-production",
|
||||
"src/features/housekeeping/domains/hotel/queries/radio",
|
||||
"src/features/housekeeping/domains/hotel/routes",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/route-handlers.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/pages/navigation",
|
||||
"src/features/housekeeping/domains/hotel/pages/radio",
|
||||
"src/features/housekeeping/domains/hotel/pages/room-detail",
|
||||
"src/features/housekeeping/domains/hotel/pages/room-furni",
|
||||
"src/features/housekeeping/domains/hotel/pages/rooms",
|
||||
"src/features/housekeeping/domains/hotel/routes",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/services/mutations-production.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/services/mutations",
|
||||
"src/features/housekeeping/domains/hotel/services/mutations-runtime",
|
||||
"src/lib/db",
|
||||
"src/lib/services/audit",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/services/mutations-runtime.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/services/mutations",
|
||||
"src/lib/db",
|
||||
"src/lib/services/rcon",
|
||||
"drizzle-orm",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/domains/hotel/services/mutations.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/hotel/services/mutations-production",
|
||||
]),
|
||||
],
|
||||
[
|
||||
"src/features/housekeeping/foundation/commands/bootstrap.ts",
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/commands/content-commands",
|
||||
"src/features/housekeeping/domains/economy/commands/economy-commands",
|
||||
"src/features/housekeeping/domains/hotel/commands/hotel-commands",
|
||||
"src/features/housekeeping/domains/people/commands/community-commands",
|
||||
"src/features/housekeeping/domains/people/commands/moderation-commands",
|
||||
"src/features/housekeeping/domains/people/commands/support-commands",
|
||||
@@ -715,6 +839,7 @@ const approvedRuntimeImports = new Map<string, ReadonlySet<string>>([
|
||||
new Set([
|
||||
"src/features/housekeeping/domains/content/route-handlers",
|
||||
"src/features/housekeeping/domains/economy/route-handlers",
|
||||
"src/features/housekeeping/domains/hotel/route-handlers",
|
||||
"src/features/housekeeping/domains/people/route-handlers",
|
||||
"src/features/housekeeping/domains/system/route-handlers",
|
||||
]),
|
||||
@@ -1315,7 +1440,7 @@ describe("housekeeping foundation completion contracts", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("creates the real six-domain registry with People, Content, Economy, and System routes enabled", () => {
|
||||
it("creates the real six-domain registry with People, Content, Economy, Hotel, and System routes enabled", () => {
|
||||
const registry = createHousekeepingRegistry(HOUSEKEEPING_MANIFESTS);
|
||||
|
||||
expect(registry.domains.map((domain) => domain.id)).toEqual([
|
||||
@@ -1330,7 +1455,9 @@ describe("housekeeping foundation completion contracts", () => {
|
||||
registry.domains
|
||||
.filter(
|
||||
(domain) =>
|
||||
!["people", "content", "economy", "system"].includes(domain.id),
|
||||
!["people", "content", "economy", "hotel", "system"].includes(
|
||||
domain.id,
|
||||
),
|
||||
)
|
||||
.every((domain) => domain.routes.length === 0),
|
||||
).toBe(true);
|
||||
@@ -1349,6 +1476,11 @@ describe("housekeeping foundation completion contracts", () => {
|
||||
.find((domain) => domain.id === "economy")
|
||||
?.routes.map((route) => route.id),
|
||||
).toEqual(ECONOMY_ROUTE_IDS);
|
||||
expect(
|
||||
registry.domains
|
||||
.find((domain) => domain.id === "hotel")
|
||||
?.routes.map((route) => route.id),
|
||||
).toEqual(HOTEL_PRIMARY_ROUTE_IDS);
|
||||
expect(
|
||||
registry.domains
|
||||
.find((domain) => domain.id === "system")
|
||||
|
||||
@@ -63,6 +63,24 @@ const economyRouteMessageKeys = [
|
||||
"pages.housekeeping.routes.economy.rewards.calendar-detail",
|
||||
] as const;
|
||||
|
||||
const hotelRouteMessageKeys = [
|
||||
"pages.housekeeping.routes.hotel.rooms",
|
||||
"pages.housekeeping.routes.hotel.room-detail",
|
||||
"pages.housekeeping.routes.hotel.room-furni",
|
||||
"pages.housekeeping.routes.hotel.navigation",
|
||||
"pages.housekeeping.routes.hotel.radio.overview",
|
||||
"pages.housekeeping.routes.hotel.radio.settings",
|
||||
"pages.housekeeping.routes.hotel.radio.monitoring",
|
||||
"pages.housekeeping.routes.hotel.radio.moderation",
|
||||
"pages.housekeeping.routes.hotel.radio.autodj",
|
||||
"pages.housekeeping.routes.hotel.radio.history",
|
||||
"pages.housekeeping.routes.hotel.radio.points",
|
||||
"pages.housekeeping.routes.hotel.radio.ranks",
|
||||
"pages.housekeeping.routes.hotel.radio.api-keys",
|
||||
"pages.housekeeping.routes.hotel.radio.banners",
|
||||
"pages.housekeeping.routes.hotel.radio.embed",
|
||||
] as const;
|
||||
|
||||
const expectedDomainMessages = [
|
||||
{
|
||||
id: "operations",
|
||||
@@ -136,6 +154,12 @@ describe("housekeeping localization contract", () => {
|
||||
expect((message as string).trim(), key).not.toBe("");
|
||||
}
|
||||
|
||||
for (const key of hotelRouteMessageKeys) {
|
||||
const message = resolveMessage(messages, key);
|
||||
expect(message, key).toEqual(expect.any(String));
|
||||
expect((message as string).trim(), key).not.toBe("");
|
||||
}
|
||||
|
||||
for (const [index, expected] of expectedDomainMessages.entries()) {
|
||||
const manifest = HOUSEKEEPING_MANIFESTS[index];
|
||||
|
||||
|
||||
@@ -114,6 +114,21 @@ const routeMocks = vi.hoisted(() => {
|
||||
"routes.economy.rewards.calendar": "HK::economy-rewards-calendar",
|
||||
"routes.economy.rewards.calendar-detail":
|
||||
"HK::economy-rewards-calendar-detail",
|
||||
"routes.hotel.rooms": "HK::hotel-rooms",
|
||||
"routes.hotel.room-detail": "HK::hotel-room-detail",
|
||||
"routes.hotel.room-furni": "HK::hotel-room-furni",
|
||||
"routes.hotel.navigation": "HK::hotel-navigation",
|
||||
"routes.hotel.radio.overview": "HK::hotel-radio-overview",
|
||||
"routes.hotel.radio.settings": "HK::hotel-radio-settings",
|
||||
"routes.hotel.radio.monitoring": "HK::hotel-radio-monitoring",
|
||||
"routes.hotel.radio.moderation": "HK::hotel-radio-moderation",
|
||||
"routes.hotel.radio.autodj": "HK::hotel-radio-autodj",
|
||||
"routes.hotel.radio.history": "HK::hotel-radio-history",
|
||||
"routes.hotel.radio.points": "HK::hotel-radio-points",
|
||||
"routes.hotel.radio.ranks": "HK::hotel-radio-ranks",
|
||||
"routes.hotel.radio.api-keys": "HK::hotel-radio-api-keys",
|
||||
"routes.hotel.radio.banners": "HK::hotel-radio-banners",
|
||||
"routes.hotel.radio.embed": "HK::hotel-radio-embed",
|
||||
"states.empty.title": "Localized empty title",
|
||||
"states.empty.description": "Localized empty description",
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@ import { ECONOMY_INBOX_SOURCES } from "../domains/economy/inbox";
|
||||
import { ECONOMY_ROUTES } from "../domains/economy/routes";
|
||||
import { ECONOMY_SEARCH_PROVIDERS } from "../domains/economy/search";
|
||||
import { ECONOMY_WIDGETS } from "../domains/economy/widgets";
|
||||
import { HOTEL_PRIMARY_ROUTES } from "../domains/hotel/routes";
|
||||
import { PEOPLE_INBOX_SOURCES } from "../domains/people/inbox";
|
||||
import { PEOPLE_ROUTES } from "../domains/people/routes";
|
||||
import { PEOPLE_SEARCH_PROVIDERS } from "../domains/people/search";
|
||||
@@ -373,9 +374,11 @@ describe("housekeeping registry", () => {
|
||||
? CONTENT_ROUTES
|
||||
: expected.id === "economy"
|
||||
? ECONOMY_ROUTES
|
||||
: expected.id === "system"
|
||||
? SYSTEM_ROUTES
|
||||
: [],
|
||||
: expected.id === "hotel"
|
||||
? HOTEL_PRIMARY_ROUTES
|
||||
: expected.id === "system"
|
||||
? SYSTEM_ROUTES
|
||||
: [],
|
||||
);
|
||||
expect(actual.searchProviders).toEqual(
|
||||
expected.id === "people"
|
||||
|
||||
Reference in new issue
Block a user