import { z } from 'zod'

export const CANCELLATION_REASONS = [
  'too_expensive',
  'missing_feature',
  'switching_tool',
  'temporary',
  'other',
] as const

export const cancelSubscriptionSchema = z
  .object({
    cancellationReason: z.enum(CANCELLATION_REASONS).optional(),
    cancellationReasonFreetext: z.string().trim().max(2000).optional(),
  })
  .strict()

export const reactivateSubscriptionSchema = z.object({}).strict()

export type CancelSubscriptionBody = z.infer<typeof cancelSubscriptionSchema>
