// packages/marketing-pages/src/integrations/cms/jobs/__events-auth-user-signed-up.task.ts
// Generated by `gen event consume`. The PayloadJobsEventBus enqueues this task
// when auth publishes `auth.user.signed-up`. The handler
// resolves the consumer's wrapped event handler from the per-feature container
// and invokes it with the typed payload.
import type { TaskConfig } from "payload";
import { marketingPagesContainer } from "../../../di/container";
import { MARKETING_PAGES_SYMBOLS } from "../../../di/symbols";
import type { IOnAuthUserSignedUpHandler } from "../../../events/handlers/on-auth-user-signed-up.handler";
import type { UserSignedUpEvent } from "@repo/auth";

export const onAuthUserSignedUpEventTask: TaskConfig<{
  input: UserSignedUpEvent;
  output: object;
}> = {
  slug: "__events.auth.user.signed-up.marketing-pages",
  inputSchema: [],
  retries: { attempts: 3, backoff: { type: "exponential", delay: 1000 } },
  handler: async ({ input }) => {
    const handler = marketingPagesContainer.get<IOnAuthUserSignedUpHandler>(
      MARKETING_PAGES_SYMBOLS.IOnAuthUserSignedUpHandler,
    );
    await handler(input);
    return { output: {} };
  },
};
