feat(housekeeping): deliver economy vertical
CI / check (pull_request) Successful in 40s
CI / release (pull_request) Skipped
CI / deploy (pull_request) Skipped

This commit is contained in:
Simo committed 2026-08-30 13:47:06 +02:00
1 parent 1ec05cda39
commit 9c4b973faf
62 files changed
+6306 -1285

No files matched your search

@@ -1,6 +1,7 @@
import "server-only";
import { CONTENT_COMMANDS } from "../../domains/content/commands/content-commands";
import { ECONOMY_COMMANDS } from "../../domains/economy/commands/economy-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";
@@ -42,6 +43,7 @@ export function registerHousekeepingCommands<
const currentHousekeepingCommands = defineHousekeepingCommands(
...CONTENT_COMMANDS,
...ECONOMY_COMMANDS,
...USER_COMMANDS,
...COMMUNITY_COMMANDS,
...SUPPORT_COMMANDS,
@@ -5,6 +5,7 @@ import { createElement, type ReactElement } from "react";
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 { PEOPLE_ROUTE_IDS } from "../domains/people/routes";
import { SYSTEM_ROUTE_IDS } from "../domains/system/routes";
import { HOUSEKEEPING_MANIFESTS } from "../manifests";
@@ -380,6 +381,218 @@ const approvedRuntimeImports = new Map<string, ReadonlySet<string>>([
"src/features/housekeeping/domains/content/widgets.ts",
new Set(["src/features/housekeeping/domains/content/widgets-production"]),
],
[
"src/features/housekeeping/domains/economy/commands/economy-commands.ts",
new Set(["src/features/housekeeping/domains/economy/services/mutations"]),
],
[
"src/features/housekeeping/domains/economy/pages/catalog.tsx",
new Set([
"src/features/housekeeping/domains/economy/pages/economy-command-form",
"src/features/housekeeping/domains/economy/pages/economy-page-frame",
"src/features/housekeeping/domains/economy/pages/specialized-catalog-editor",
"src/features/housekeeping/domains/economy/queries/catalog",
]),
],
[
"src/features/housekeeping/domains/economy/pages/commerce.tsx",
new Set([
"src/features/housekeeping/domains/economy/pages/economy-command-form",
"src/features/housekeeping/domains/economy/pages/economy-page-frame",
"src/features/housekeeping/domains/economy/queries/catalog",
]),
],
[
"src/features/housekeeping/domains/economy/pages/economy-command-form.tsx",
new Set(["src/actions/housekeeping-command"]),
],
[
"src/features/housekeeping/domains/economy/pages/economy-page-frame.tsx",
new Set([
"src/features/housekeeping/domains/economy/queries/catalog",
"src/features/housekeeping/domains/economy/routes",
]),
],
[
"src/features/housekeeping/domains/economy/pages/history.tsx",
new Set([
"src/features/housekeeping/domains/economy/pages/economy-page-frame",
"src/features/housekeeping/domains/economy/queries/catalog",
]),
],
[
"src/features/housekeeping/domains/economy/pages/items.tsx",
new Set([
"src/features/housekeeping/domains/economy/pages/economy-command-form",
"src/features/housekeeping/domains/economy/pages/economy-page-frame",
"src/features/housekeeping/domains/economy/queries/catalog",
]),
],
[
"src/features/housekeeping/domains/economy/pages/rewards.tsx",
new Set([
"src/features/housekeeping/domains/economy/pages/economy-command-form",
"src/features/housekeeping/domains/economy/pages/economy-page-frame",
"src/features/housekeeping/domains/economy/queries/catalog",
]),
],
[
"src/features/housekeeping/domains/economy/pages/specialized-catalog-editor.tsx",
new Set([
"src/app/admin/catalog/[id]/catalog-detail-tabs",
"src/app/admin/catalog/builder-club/bc-manager",
"src/features/housekeeping/domains/economy/routes",
"src/lib/db",
"drizzle-orm",
]),
],
[
"src/features/housekeeping/domains/economy/pages/value.tsx",
new Set([
"src/features/housekeeping/domains/economy/pages/economy-command-form",
"src/features/housekeeping/domains/economy/pages/economy-page-frame",
"src/features/housekeeping/domains/economy/queries/catalog",
]),
],
[
"src/features/housekeeping/domains/economy/queries/catalog.ts",
new Set([
"src/features/housekeeping/domains/economy/queries/commerce",
"src/features/housekeeping/domains/economy/queries/economy-production",
"src/features/housekeeping/domains/economy/queries/value",
"src/features/housekeeping/domains/economy/routes",
]),
],
[
"src/features/housekeeping/domains/economy/queries/commerce.ts",
new Set([
"src/features/housekeeping/domains/economy/queries/catalog",
"src/features/housekeeping/domains/economy/queries/economy-production",
]),
],
[
"src/features/housekeeping/domains/economy/queries/economy-production.ts",
new Set([
"src/features/housekeeping/domains/economy/queries/catalog",
"src/features/housekeeping/domains/economy/queries/commerce",
"src/features/housekeeping/domains/economy/routes",
"src/lib/db",
"drizzle-orm",
]),
],
[
"src/features/housekeeping/domains/economy/queries/value.ts",
new Set([
"src/features/housekeeping/domains/economy/queries/catalog",
"src/features/housekeeping/domains/economy/queries/economy-production",
]),
],
[
"src/features/housekeeping/domains/economy/services/mutation-runtime-catalog.ts",
new Set([
"src/features/housekeeping/domains/economy/services/mutation-runtime-input",
"src/features/housekeeping/domains/economy/services/mutations",
"src/features/housekeeping/domains/economy/services/mutations-production",
"src/lib/db",
"drizzle-orm",
"mysql2",
]),
],
[
"src/features/housekeeping/domains/economy/services/mutation-runtime-commerce.ts",
new Set([
"src/features/housekeeping/domains/economy/services/mutation-runtime-input",
"src/features/housekeeping/domains/economy/services/mutations",
"src/lib/db",
"drizzle-orm",
"mysql2",
]),
],
[
"src/features/housekeeping/domains/economy/services/mutation-runtime-input.ts",
new Set(["src/features/housekeeping/domains/economy/services/mutations"]),
],
[
"src/features/housekeeping/domains/economy/services/mutation-runtime-rewards.ts",
new Set([
"src/features/housekeeping/domains/economy/services/mutation-runtime-input",
"src/features/housekeeping/domains/economy/services/mutations",
"src/features/housekeeping/domains/economy/services/mutations-production",
"src/lib/db",
"drizzle-orm",
]),
],
[
"src/features/housekeeping/domains/economy/services/mutations-production.ts",
new Set([
"src/features/housekeeping/domains/economy/services/mutations",
"src/features/housekeeping/domains/economy/services/mutations-runtime",
"src/lib/db",
]),
],
[
"src/features/housekeeping/domains/economy/services/mutations-runtime.ts",
new Set([
"src/features/housekeeping/domains/economy/services/mutation-runtime-catalog",
"src/features/housekeeping/domains/economy/services/mutation-runtime-commerce",
"src/features/housekeeping/domains/economy/services/mutation-runtime-rewards",
"src/features/housekeeping/domains/economy/services/mutations",
]),
],
[
"src/features/housekeeping/domains/economy/services/mutations.ts",
new Set([
"src/features/housekeeping/domains/economy/services/mutations-production",
]),
],
[
"src/features/housekeeping/domains/economy/inbox-production.ts",
new Set(["src/features/housekeeping/domains/economy/queries/catalog"]),
],
[
"src/features/housekeeping/domains/economy/inbox.ts",
new Set(["src/features/housekeeping/domains/economy/inbox-production"]),
],
[
"src/features/housekeeping/domains/economy/manifest.ts",
new Set([
"src/features/housekeeping/domains/economy/inbox",
"src/features/housekeeping/domains/economy/routes",
"src/features/housekeeping/domains/economy/search",
"src/features/housekeeping/domains/economy/widgets",
]),
],
[
"src/features/housekeeping/domains/economy/route-handlers.ts",
new Set([
"src/features/housekeeping/domains/economy/pages/catalog",
"src/features/housekeeping/domains/economy/pages/commerce",
"src/features/housekeeping/domains/economy/pages/history",
"src/features/housekeeping/domains/economy/pages/items",
"src/features/housekeeping/domains/economy/pages/rewards",
"src/features/housekeeping/domains/economy/pages/value",
"src/features/housekeeping/domains/economy/routes",
]),
],
[
"src/features/housekeeping/domains/economy/search-production.ts",
new Set([
"src/features/housekeeping/domains/economy/queries/catalog",
"src/features/housekeeping/domains/economy/search",
]),
],
[
"src/features/housekeeping/domains/economy/search.ts",
new Set(["src/features/housekeeping/domains/economy/search-production"]),
],
[
"src/features/housekeeping/domains/economy/widgets-production.ts",
new Set(["src/features/housekeeping/domains/economy/queries/catalog"]),
],
[
"src/features/housekeeping/domains/economy/widgets.ts",
new Set(["src/features/housekeeping/domains/economy/widgets-production"]),
],
[
"src/features/housekeeping/domains/system/commands/system-commands.ts",
new Set(["src/features/housekeeping/domains/system/services/mutations"]),
@@ -489,6 +702,7 @@ const approvedRuntimeImports = new Map<string, ReadonlySet<string>>([
"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/people/commands/community-commands",
"src/features/housekeeping/domains/people/commands/moderation-commands",
"src/features/housekeeping/domains/people/commands/support-commands",
@@ -500,6 +714,7 @@ const approvedRuntimeImports = new Map<string, ReadonlySet<string>>([
"src/features/housekeeping/route-handlers.ts",
new Set([
"src/features/housekeeping/domains/content/route-handlers",
"src/features/housekeeping/domains/economy/route-handlers",
"src/features/housekeeping/domains/people/route-handlers",
"src/features/housekeeping/domains/system/route-handlers",
]),
@@ -1100,7 +1315,7 @@ describe("housekeeping foundation completion contracts", () => {
}
});
it("creates the real six-domain registry with People, Content, and System routes enabled", () => {
it("creates the real six-domain registry with People, Content, Economy, and System routes enabled", () => {
const registry = createHousekeepingRegistry(HOUSEKEEPING_MANIFESTS);
expect(registry.domains.map((domain) => domain.id)).toEqual([
@@ -1114,7 +1329,8 @@ describe("housekeeping foundation completion contracts", () => {
expect(
registry.domains
.filter(
(domain) => !["people", "content", "system"].includes(domain.id),
(domain) =>
!["people", "content", "economy", "system"].includes(domain.id),
)
.every((domain) => domain.routes.length === 0),
).toBe(true);
@@ -1128,6 +1344,11 @@ describe("housekeeping foundation completion contracts", () => {
.find((domain) => domain.id === "content")
?.routes.map((route) => route.id),
).toEqual(CONTENT_ROUTE_IDS);
expect(
registry.domains
.find((domain) => domain.id === "economy")
?.routes.map((route) => route.id),
).toEqual(ECONOMY_ROUTE_IDS);
expect(
registry.domains
.find((domain) => domain.id === "system")
@@ -41,6 +41,28 @@ const systemRouteMessageKeys = [
"pages.housekeeping.routes.system.operations.maintenance",
] as const;
const economyRouteMessageKeys = [
"pages.housekeeping.routes.economy.catalog.overview",
"pages.housekeeping.routes.economy.catalog.detail",
"pages.housekeeping.routes.economy.catalog.builder-club-detail",
"pages.housekeeping.routes.economy.catalog.maintenance",
"pages.housekeeping.routes.economy.items.overview",
"pages.housekeeping.routes.economy.items.detail",
"pages.housekeeping.routes.economy.commerce.shop",
"pages.housekeeping.routes.economy.commerce.shop-create",
"pages.housekeeping.routes.economy.commerce.shop-detail",
"pages.housekeeping.routes.economy.commerce.marketplace",
"pages.housekeeping.routes.economy.commerce.vouchers",
"pages.housekeeping.routes.economy.commerce.subscriptions",
"pages.housekeeping.routes.economy.history.transactions",
"pages.housekeeping.routes.economy.value.rare-values",
"pages.housekeeping.routes.economy.rewards.badges",
"pages.housekeeping.routes.economy.rewards.achievements",
"pages.housekeeping.routes.economy.rewards.sounds",
"pages.housekeeping.routes.economy.rewards.calendar",
"pages.housekeeping.routes.economy.rewards.calendar-detail",
] as const;
const expectedDomainMessages = [
{
id: "operations",
@@ -108,6 +130,12 @@ describe("housekeeping localization contract", () => {
expect((message as string).trim(), key).not.toBe("");
}
for (const key of economyRouteMessageKeys) {
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];
@@ -92,6 +92,28 @@ const routeMocks = vi.hoisted(() => {
"routes.system.operations.command-center":
"HK::system-operations-command-center",
"routes.system.operations.maintenance": "HK::system-operations-maintenance",
"routes.economy.catalog.overview": "HK::economy-catalog-overview",
"routes.economy.catalog.detail": "HK::economy-catalog-detail",
"routes.economy.catalog.builder-club-detail":
"HK::economy-catalog-builder-club-detail",
"routes.economy.catalog.maintenance": "HK::economy-catalog-maintenance",
"routes.economy.items.overview": "HK::economy-items-overview",
"routes.economy.items.detail": "HK::economy-items-detail",
"routes.economy.commerce.shop": "HK::economy-commerce-shop",
"routes.economy.commerce.shop-create": "HK::economy-commerce-shop-create",
"routes.economy.commerce.shop-detail": "HK::economy-commerce-shop-detail",
"routes.economy.commerce.marketplace": "HK::economy-commerce-marketplace",
"routes.economy.commerce.vouchers": "HK::economy-commerce-vouchers",
"routes.economy.commerce.subscriptions":
"HK::economy-commerce-subscriptions",
"routes.economy.history.transactions": "HK::economy-history-transactions",
"routes.economy.value.rare-values": "HK::economy-value-rare-values",
"routes.economy.rewards.badges": "HK::economy-rewards-badges",
"routes.economy.rewards.achievements": "HK::economy-rewards-achievements",
"routes.economy.rewards.sounds": "HK::economy-rewards-sounds",
"routes.economy.rewards.calendar": "HK::economy-rewards-calendar",
"routes.economy.rewards.calendar-detail":
"HK::economy-rewards-calendar-detail",
"states.empty.title": "Localized empty title",
"states.empty.description": "Localized empty description",
};
@@ -4,6 +4,10 @@ import { CONTENT_INBOX_SOURCES } from "../domains/content/inbox";
import { CONTENT_ROUTES } from "../domains/content/routes";
import { CONTENT_SEARCH_PROVIDERS } from "../domains/content/search";
import { CONTENT_WIDGETS } from "../domains/content/widgets";
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 { PEOPLE_INBOX_SOURCES } from "../domains/people/inbox";
import { PEOPLE_ROUTES } from "../domains/people/routes";
import { PEOPLE_SEARCH_PROVIDERS } from "../domains/people/search";
@@ -367,30 +371,38 @@ describe("housekeeping registry", () => {
? PEOPLE_ROUTES
: expected.id === "content"
? CONTENT_ROUTES
: expected.id === "system"
? SYSTEM_ROUTES
: [],
: expected.id === "economy"
? ECONOMY_ROUTES
: expected.id === "system"
? SYSTEM_ROUTES
: [],
);
expect(actual.searchProviders).toEqual(
expected.id === "people"
? PEOPLE_SEARCH_PROVIDERS
: expected.id === "content"
? CONTENT_SEARCH_PROVIDERS
: [],
: expected.id === "economy"
? ECONOMY_SEARCH_PROVIDERS
: [],
);
expect(actual.inboxSources).toEqual(
expected.id === "people"
? PEOPLE_INBOX_SOURCES
: expected.id === "content"
? CONTENT_INBOX_SOURCES
: [],
: expected.id === "economy"
? ECONOMY_INBOX_SOURCES
: [],
);
expect(actual.widgets).toEqual(
expected.id === "people"
? PEOPLE_WIDGETS
: expected.id === "content"
? CONTENT_WIDGETS
: [],
: expected.id === "economy"
? ECONOMY_WIDGETS
: [],
);
expect(actual.capability).toEqual({ mode: "any", slugs: expected.slugs });
}