import { z } from 'zod';
import { systemIdSchema } from './common';

export const campaignSchema = z.object({
  id: z.string(),
  name: z.string().min(1, 'Name is required').max(120),
  system: systemIdSchema,
  description: z.string().max(5000).default(''),
  /** ISO date string */
  createdAt: z.string(),
  updatedAt: z.string(),
});

export type Campaign = z.infer<typeof campaignSchema>;

/** Fields a user supplies when creating a campaign. */
export const campaignDraftSchema = campaignSchema.pick({
  name: true,
  system: true,
  description: true,
});
export type CampaignDraft = z.infer<typeof campaignDraftSchema>;
