feat(marketing-pages): subscribe to auth.user.signed-up

Generated handler + Payload event-task via gen event consume,
threaded through symbols / both binders / cms re-export at the
configured anchors. bus.subscribe wires the in-memory delivery in
dev-seed; the __events.auth.user.signed-up.marketing-pages Payload
task closes the production-bus loop.

Also fixes two generator-level issues found during Phase 8:
- Drop publisher prompt's `when` clause so --args can supply the
  4th positional argument (Plop limitation: --args cannot bypass
  conditional prompts). Validate runs only in consume mode.
- Switch event-task.ts.hbs from TaskConfig<"slug-string"> to
  TaskConfig<{ input: ...; output: object }> since runtime-generated
  event slugs are not keys of TypedJobs['tasks'].
This commit is contained in:
2026-05-08 16:33:14 +02:00
parent c1b8a7e434
commit 6b57a34c0c
11 changed files with 114 additions and 7 deletions

View File

@@ -16,6 +16,8 @@ import { getSiteSettingsUseCase } from "../application/use-cases/get-site-settin
import { getPageBySlugUseCase } from "../application/use-cases/get-page-by-slug.use-case";
import { getSiteSettingsController } from "../interface-adapters/controllers/get-site-settings.controller";
import { getPageBySlugController } from "../interface-adapters/controllers/get-page-by-slug.controller";
import { userSignedUpEvent } from "@repo/auth";
import { onAuthUserSignedUpHandler } from "../events/handlers/on-auth-user-signed-up.handler";
export function bindProductionMarketingPages(
config: SanitizedConfig,
@@ -122,5 +124,24 @@ export function bindProductionMarketingPages(
void bus;
void queue;
// <gen:event-handlers>
// onAuthUserSignedUpHandler subscription — generated, edit the handler file (not this block) for behavior.
const wrappedAuthUserSignedUp = withSpan(
tracer,
{ name: "marketing-pages.onAuthUserSignedUpHandler", op: "event-handler" },
withCapture(
logger,
{
feature: "marketing-pages",
layer: "event-handler",
name: "marketing-pages.onAuthUserSignedUpHandler",
},
onAuthUserSignedUpHandler(),
),
);
if (marketingPagesContainer.isBound(MARKETING_PAGES_SYMBOLS.IOnAuthUserSignedUpHandler)) {
marketingPagesContainer.unbind(MARKETING_PAGES_SYMBOLS.IOnAuthUserSignedUpHandler);
}
marketingPagesContainer.bind(MARKETING_PAGES_SYMBOLS.IOnAuthUserSignedUpHandler).toConstantValue(wrappedAuthUserSignedUp);
bus.subscribe(userSignedUpEvent, "marketing-pages", wrappedAuthUserSignedUp);
// <gen:jobs>
}