// packages/auth/src/events/user-signed-up.event.ts
import { z } from "zod";

export const userSignedUpEventSchema = z
  .object({
    userId: z.string(),
    email: z.string().email(),
    signedUpAt: z.string().datetime(),
  })
  .strict();

export type UserSignedUpEvent = z.infer<typeof userSignedUpEventSchema>;

// Inline event descriptor — core-events is optional. The shape { name, schema }
// satisfies EventBusProtocol.publish / subscribe when the bus is present.
export const userSignedUpEvent = {
  name: "auth.user.signed-up" as const,
  schema: userSignedUpEventSchema,
};
