/**
 * Generated by orval v7.21.0 🍺
 * Do not edit manually.
 * MBHS
 * Multidimensional Behavioral Health Screen
 * OpenAPI spec version: 1.0.0
 */
export interface Message {
  message: string;
  email_notice?: string;
}

export type UserLoginDTODeviceType =
  (typeof UserLoginDTODeviceType)[keyof typeof UserLoginDTODeviceType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const UserLoginDTODeviceType = {
  ios: "ios",
  android: "android",
  web: "web",
} as const;

export interface UserLoginDTO {
  /**
   * @minLength 3
   * @maxLength 255
   */
  username: string;
  /**
   * @minLength 3
   * @maxLength 50
   */
  password: string;
  /** @maxLength 255 */
  device_name: string;
  device_type: UserLoginDTODeviceType;
  /** @maxLength 255 */
  device_id: string;
  /**
   * Device token for push notification
   * @maxLength 255
   */
  device_token?: string;
}

export interface UserRoleModel {
  /**
   * Role UUID (null for admin users)
   * @nullable
   */
  uuid: string | null;
  /** Role name (admin for admin users) */
  name: string;
}

export interface UserModel {
  uuid: string;
  email: string;
  name: string;
  isd_code: string;
  mobile: string;
  locale: string;
  mobile_verified_at: string;
  email_verified_at: string;
  /** @nullable */
  profile_photo: string | null;
  role: UserRoleModel;
}

export interface UserLoginModel {
  user: UserModel;
  is_already_logged_in: boolean;
  /** Whether the user must change their password on first login */
  force_password_change: boolean;
  /** Whether the practitioner has an active subscription */
  has_active_subscription: boolean;
  /** True if this practitioner is covered under a Practice Manager group plan and does not need their own subscription */
  is_managed: boolean;
  /**
   * Subscription type: individual or group (null if no subscription)
   * @nullable
   */
  subscription_type: string | null;
  access_token: string;
  refresh_token: string;
}

export interface UserLoginResponseModel {
  message: string;
  email_notice?: string;
  data: UserLoginModel;
}

/**
 * 1 = GOOGLE, 2 = APPLE
 */
export type SocialLoginDTOSocialType =
  (typeof SocialLoginDTOSocialType)[keyof typeof SocialLoginDTOSocialType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SocialLoginDTOSocialType = {
  NUMBER_1: 1,
  NUMBER_2: 2,
} as const;

export type SocialLoginDTODeviceType =
  (typeof SocialLoginDTODeviceType)[keyof typeof SocialLoginDTODeviceType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SocialLoginDTODeviceType = {
  ios: "ios",
  android: "android",
  web: "web",
} as const;

export interface SocialLoginDTO {
  /** 1 = GOOGLE, 2 = APPLE */
  social_type: SocialLoginDTOSocialType;
  name?: string;
  token: string;
  /** @maxLength 255 */
  device_name: string;
  device_type: SocialLoginDTODeviceType;
  /** @maxLength 255 */
  device_id: string;
  /**
   * Device token for push notification
   * @maxLength 255
   */
  device_token?: string;
}

export type RefreshTokenDTODeviceType =
  (typeof RefreshTokenDTODeviceType)[keyof typeof RefreshTokenDTODeviceType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const RefreshTokenDTODeviceType = {
  ios: "ios",
  android: "android",
  web: "web",
} as const;

export interface RefreshTokenDTO {
  /** @maxLength 255 */
  device_name: string;
  device_type: RefreshTokenDTODeviceType;
  /** @maxLength 255 */
  device_id: string;
  /**
   * Device token for push notification
   * @maxLength 255
   */
  device_token?: string;
}

export interface RefreshTokenModel {
  access_token: string;
  refresh_token: string;
}

export interface RefreshTokenResponseModel {
  message: string;
  email_notice?: string;
  data: RefreshTokenModel;
}

export type RoleType = (typeof RoleType)[keyof typeof RoleType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const RoleType = {
  Practitioners: "Practitioners",
  Individuals: "Individuals",
} as const;

export type UserRegisterDTODeviceType =
  (typeof UserRegisterDTODeviceType)[keyof typeof UserRegisterDTODeviceType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const UserRegisterDTODeviceType = {
  ios: "ios",
  android: "android",
  web: "web",
} as const;

export interface UserRegisterDTO {
  /**
   * @minLength 8
   * @pattern PASSWORD_REGULAR_EXPRESSION
   */
  password: string;
  /** @pattern ISD_CODE_REGULAR_EXPRESSION */
  isd_code?: string;
  /** @pattern MOBILE_NUMBER_REGULAR_EXPRESSION */
  mobile?: string;
  /** User role type */
  role: RoleType;
  /**
   * @minLength 3
   * @maxLength 255
   * @pattern /^[^<>]*$/
   */
  name: string;
  /**
   * @minLength 3
   * @maxLength 50
   */
  username: string;
  /**
   * @minLength 3
   * @maxLength 255
   */
  email: string;
  /** @maxLength 255 */
  device_name: string;
  device_type: UserRegisterDTODeviceType;
  /** @maxLength 255 */
  device_id: string;
  /**
   * Device token for push notification
   * @maxLength 255
   */
  device_token?: string;
}

export interface UserRegisterModel {
  user: UserModel;
  is_already_logged_in: boolean;
  access_token: string;
  refresh_token: string;
}

export interface UserRegisterResponseModel {
  message: string;
  email_notice?: string;
  data: UserRegisterModel;
}

export interface UserProfileModel {
  user: UserModel;
}

export interface UserProfileResponseModel {
  message: string;
  email_notice?: string;
  data: UserProfileModel;
}

export interface UpdateProfileDTO {
  /**
   * User name
   * @minLength 2
   * @maxLength 100
   */
  name?: string;
  /**
   * ISD code
   * @maxLength 10
   */
  isd_code?: string;
  /**
   * Mobile number
   * @maxLength 20
   */
  mobile?: string;
}

export type UpdateLocaleDTOLocale =
  (typeof UpdateLocaleDTOLocale)[keyof typeof UpdateLocaleDTOLocale];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const UpdateLocaleDTOLocale = {
  en: "en",
  ar: "ar",
} as const;

export interface UpdateLocaleDTO {
  locale: UpdateLocaleDTOLocale;
}

export interface UpdatePasswordDTO {
  /**
   * Current password
   * @minLength 8
   */
  password: string;
  /**
   * New password - must contain at least 8 characters, one digit, one special character, one uppercase and one lowercase letter
   * @minLength 8
   * @maxLength 50
   * @pattern PASSWORD_REGULAR_EXPRESSION
   */
  new_password: string;
  /** Confirm new password - must match new password */
  confirm_password: string;
}

export interface ForceChangePasswordDto {
  /**
   * New password - must contain at least 8 characters, one digit, one special character, one uppercase and one lowercase letter
   * @minLength 8
   * @maxLength 50
   * @pattern PASSWORD_REGULAR_EXPRESSION
   */
  new_password: string;
  /** Confirm new password - must match new password */
  confirm_password: string;
}

export interface ForgotPasswordDTO {
  /**
   * @minLength 3
   * @maxLength 255
   */
  email: string;
}

export interface ValidateTokenDTO {
  token: string;
}

export interface ResetPasswordDTO {
  token: string;
  /**
   * @minLength 8
   * @pattern PASSWORD_REGULAR_EXPRESSION
   */
  password: string;
  confirm_password?: string;
}

export type SendOTPDTOVerificationFor =
  (typeof SendOTPDTOVerificationFor)[keyof typeof SendOTPDTOVerificationFor];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SendOTPDTOVerificationFor = {
  email: "email",
  mobile: "mobile",
} as const;

export interface SendOTPDTO {
  verification_for: SendOTPDTOVerificationFor;
  email?: string;
  /** @pattern ISD_CODE_REGULAR_EXPRESSION */
  isd_code?: string;
  /** @pattern MOBILE_NUMBER_REGULAR_EXPRESSION */
  mobile?: string;
}

export type VerifyOTPDTOVerificationFor =
  (typeof VerifyOTPDTOVerificationFor)[keyof typeof VerifyOTPDTOVerificationFor];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const VerifyOTPDTOVerificationFor = {
  email: "email",
  mobile: "mobile",
} as const;

export interface VerifyOTPDTO {
  verification_for: VerifyOTPDTOVerificationFor;
  email?: string;
  /** @pattern ISD_CODE_REGULAR_EXPRESSION */
  isd_code?: string;
  /** @pattern MOBILE_NUMBER_REGULAR_EXPRESSION */
  mobile?: string;
  /**
   * @minLength 6
   * @maxLength 6
   */
  otp: string;
}

export interface ProfileModel {
  uuid: string;
  is_active: boolean;
  name: string;
  email: string;
  email_verified_at: string;
  mobile_verified_at: string;
  created_at: string;
  /** @nullable */
  profile_photo: string | null;
}

export interface AdminProfileModel {
  profile: ProfileModel;
}

export interface AdminProfileResponseModel {
  message: string;
  email_notice?: string;
  data: AdminProfileModel;
}

export interface UpdateAdminProfileDto {
  uuid: string;
  name: string;
  email: string;
  is_active: boolean;
}

export interface ChangePasswordDto {
  /** Current password */
  current_password: string;
  /**
   * New password (min 8 characters)
   * @minLength 8
   * @pattern /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]/
   */
  new_password: string;
  /** Confirm new password */
  confirm_password: string;
}

/**
 * Duration of complimentary access in months. Omit (or send null) for lifetime / no expiry.
 * @nullable
 */
export type GrantComplimentaryDtoDurationMonths =
  | (typeof GrantComplimentaryDtoDurationMonths)[keyof typeof GrantComplimentaryDtoDurationMonths]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GrantComplimentaryDtoDurationMonths = {
  NUMBER_1: 1,
  NUMBER_3: 3,
  NUMBER_6: 6,
  NUMBER_12: 12,
} as const;

export interface GrantComplimentaryDto {
  /** UUID of the user who will receive complimentary access */
  user_uuid: string;
  /**
   * Reason recorded with the audit log. Required so every grant has a justification on record.
   * @minLength 1
   * @maxLength 255
   */
  reason: string;
  /**
   * Duration of complimentary access in months. Omit (or send null) for lifetime / no expiry.
   * @nullable
   */
  duration_months?: GrantComplimentaryDtoDurationMonths;
}

export interface AdminSubscriptionUserData {
  uuid: string;
  username: string;
  email: string;
  /** @nullable */
  avatar?: string | null;
  /** @nullable */
  role?: string | null;
}

export interface AdminSubscriptionPlanData {
  /** @nullable */
  uuid?: string | null;
  name: string;
}

/**
 * Subscribed user
 * @nullable
 */
export type AdminSubscriptionDataUser = AdminSubscriptionUserData | null;

/**
 * Subscription plan
 * @nullable
 */
export type AdminSubscriptionDataPlan = AdminSubscriptionPlanData | null;

/**
 * Billing cycle
 * @nullable
 */
export type AdminSubscriptionDataBillingCycle =
  | (typeof AdminSubscriptionDataBillingCycle)[keyof typeof AdminSubscriptionDataBillingCycle]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AdminSubscriptionDataBillingCycle = {
  monthly: "monthly",
  yearly: "yearly",
} as const;

/**
 * Subscription type
 * @nullable
 */
export type AdminSubscriptionDataSubscriptionType =
  | (typeof AdminSubscriptionDataSubscriptionType)[keyof typeof AdminSubscriptionDataSubscriptionType]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AdminSubscriptionDataSubscriptionType = {
  individual: "individual",
  group: "group",
} as const;

/**
 * Subscription status. Trial users are reported as "active" — use is_trial to distinguish.
 */
export type AdminSubscriptionDataStatus =
  (typeof AdminSubscriptionDataStatus)[keyof typeof AdminSubscriptionDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AdminSubscriptionDataStatus = {
  active: "active",
  cancelled: "cancelled",
  past_due: "past_due",
  incomplete: "incomplete",
  paused: "paused",
} as const;

export interface AdminSubscriptionData {
  /** Subscription UUID */
  uuid: string;
  /**
   * Subscribed user
   * @nullable
   */
  user?: AdminSubscriptionDataUser;
  /**
   * Subscription plan
   * @nullable
   */
  plan?: AdminSubscriptionDataPlan;
  /**
   * Billing cycle
   * @nullable
   */
  billing_cycle?: AdminSubscriptionDataBillingCycle;
  /**
   * Renewal date (ISO date)
   * @nullable
   */
  renewal_date?: string | null;
  /** Subscription amount */
  amount?: number;
  /** Currency code */
  currency?: string;
  /**
   * Subscription type
   * @nullable
   */
  subscription_type?: AdminSubscriptionDataSubscriptionType;
  /** Subscription status. Trial users are reported as "active" — use is_trial to distinguish. */
  status: AdminSubscriptionDataStatus;
  /**
   * Trial end date (ISO, UTC). Null if the subscription never had a trial.
   * @nullable
   */
  trial_end?: string | null;
  /** True if trial_end is set and in the future (user is currently on trial). */
  is_trial: boolean;
  /** True if the subscription was admin-granted complimentary (free) access. */
  is_complimentary: boolean;
  /**
   * Start date (ISO date)
   * @nullable
   */
  started_at?: string | null;
  /**
   * Expiry date (ISO date)
   * @nullable
   */
  expires_at?: string | null;
  /**
   * Date subscription was cancelled (ISO date)
   * @nullable
   */
  canceled_at?: string | null;
}

export interface AdminSubscriptionListData {
  /** Array of subscriptions */
  subscriptions: AdminSubscriptionData[];
  /** Total number of subscriptions */
  total_count: number;
  /** Current page */
  page: number;
  /** Items per page */
  limit: number;
  /** Total pages */
  total_pages: number;
}

export interface AdminSubscriptionListResponse {
  message: string;
  data: AdminSubscriptionListData;
}

export interface AdminSubscriptionStatisticsData {
  /** Number of active subscriptions */
  active_subscriptions: number;
  /** Total earning from subscriptions */
  total_earning: number;
  /** Subscriptions cancelled this month */
  cancelled_this_month: number;
  /** New subscriptions this month */
  new_this_month: number;
}

export interface AdminSubscriptionStatisticsResponse {
  message: string;
  data: AdminSubscriptionStatisticsData;
}

export interface AdminSubscriptionCancelData {
  /** Updated subscription status */
  status: string;
  /** Date the subscription was cancelled (ISO date) */
  canceled_at: string;
}

export interface AdminSubscriptionCancelResponse {
  message: string;
  data: AdminSubscriptionCancelData;
}

/**
 * Subscribed user
 * @nullable
 */
export type AdminSubscriptionDetailDataUser = AdminSubscriptionUserData | null;

/**
 * Subscription plan
 * @nullable
 */
export type AdminSubscriptionDetailDataPlan = AdminSubscriptionPlanData | null;

/**
 * Billing cycle
 * @nullable
 */
export type AdminSubscriptionDetailDataBillingCycle =
  | (typeof AdminSubscriptionDetailDataBillingCycle)[keyof typeof AdminSubscriptionDetailDataBillingCycle]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AdminSubscriptionDetailDataBillingCycle = {
  monthly: "monthly",
  yearly: "yearly",
} as const;

/**
 * Subscription type
 * @nullable
 */
export type AdminSubscriptionDetailDataSubscriptionType =
  | (typeof AdminSubscriptionDetailDataSubscriptionType)[keyof typeof AdminSubscriptionDetailDataSubscriptionType]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AdminSubscriptionDetailDataSubscriptionType = {
  individual: "individual",
  group: "group",
} as const;

/**
 * Subscription status. Trial users are reported as "active" — use is_trial to distinguish.
 */
export type AdminSubscriptionDetailDataStatus =
  (typeof AdminSubscriptionDetailDataStatus)[keyof typeof AdminSubscriptionDetailDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AdminSubscriptionDetailDataStatus = {
  active: "active",
  cancelled: "cancelled",
  past_due: "past_due",
  incomplete: "incomplete",
  paused: "paused",
} as const;

export interface AdminSubscriptionDetailData {
  /** Subscription UUID */
  uuid: string;
  /**
   * Subscribed user
   * @nullable
   */
  user?: AdminSubscriptionDetailDataUser;
  /**
   * Subscription plan
   * @nullable
   */
  plan?: AdminSubscriptionDetailDataPlan;
  /**
   * Billing cycle
   * @nullable
   */
  billing_cycle?: AdminSubscriptionDetailDataBillingCycle;
  /**
   * Renewal date (ISO date)
   * @nullable
   */
  renewal_date?: string | null;
  /** Subscription amount */
  amount?: number;
  /** Currency code */
  currency?: string;
  /**
   * Subscription type
   * @nullable
   */
  subscription_type?: AdminSubscriptionDetailDataSubscriptionType;
  /** Subscription status. Trial users are reported as "active" — use is_trial to distinguish. */
  status: AdminSubscriptionDetailDataStatus;
  /**
   * Trial end date (ISO, UTC). Null if the subscription never had a trial.
   * @nullable
   */
  trial_end?: string | null;
  /** True if trial_end is set and in the future (user is currently on trial). */
  is_trial: boolean;
  /** True if the subscription was admin-granted complimentary (free) access. */
  is_complimentary: boolean;
  /**
   * Start date (ISO date)
   * @nullable
   */
  started_at?: string | null;
  /**
   * Expiry date (ISO date)
   * @nullable
   */
  expires_at?: string | null;
  /**
   * Date subscription was cancelled (ISO date)
   * @nullable
   */
  canceled_at?: string | null;
  /**
   * Record creation date (ISO date)
   * @nullable
   */
  created_at?: string | null;
}

export interface AdminSubscriptionDetailResponse {
  message: string;
  data: AdminSubscriptionDetailData;
}

export type FilterDTOFieldType =
  (typeof FilterDTOFieldType)[keyof typeof FilterDTOFieldType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const FilterDTOFieldType = {
  timestamp: "timestamp",
  unix_timestamp: "unix_timestamp",
  text: "text",
  number: "number",
  boolean: "boolean",
} as const;

export type FilterDTOOperation =
  (typeof FilterDTOOperation)[keyof typeof FilterDTOOperation];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const FilterDTOOperation = {
  equal: "equal",
  like: "like",
  between: "between",
  contains: "contains",
} as const;

export type FilterDTOValues = { [key: string]: unknown };

export interface FilterDTO {
  name: string;
  field_type: FilterDTOFieldType;
  operation: FilterDTOOperation;
  values: FilterDTOValues;
}

export interface RoleModel {
  uuid: string;
  name: string;
}

export interface UsersModel {
  uuid: string;
  username: string;
  name: string;
  email: string;
  profile_photo?: string;
  is_active: boolean;
  isd_code?: string;
  mobile?: string;
  email_verified_at?: string;
  mobile_verified_at?: string;
  created_at: string;
  updated_at?: string;
  role?: RoleModel;
}

export interface AdminUsersModel {
  users: UsersModel[];
  total_count: number;
}

export interface AdminUsersResponseModel {
  message: string;
  email_notice?: string;
  data: AdminUsersModel;
}

/**
 * Duration of complimentary access in months. Omit (or send null) for lifetime / no expiry.
 * @nullable
 */
export type InviteGrantDtoDurationMonths =
  | (typeof InviteGrantDtoDurationMonths)[keyof typeof InviteGrantDtoDurationMonths]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const InviteGrantDtoDurationMonths = {
  NUMBER_1: 1,
  NUMBER_3: 3,
  NUMBER_6: 6,
  NUMBER_12: 12,
} as const;

export interface InviteGrantDto {
  /**
   * Reason recorded with the audit log. Required.
   * @minLength 1
   * @maxLength 255
   */
  reason: string;
  /**
   * Duration of complimentary access in months. Omit (or send null) for lifetime / no expiry.
   * @nullable
   */
  duration_months?: InviteGrantDtoDurationMonths;
}

/**
 * Role to assign to the user
 */
export type InviteUserDtoRole =
  (typeof InviteUserDtoRole)[keyof typeof InviteUserDtoRole];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const InviteUserDtoRole = {
  Individuals: "Individuals",
  Practitioners: "Practitioners",
} as const;

export interface InviteUserDto {
  /**
   * Full name of the user
   * @minLength 2
   * @maxLength 100
   */
  name: string;
  /** Email address of the user */
  email: string;
  /** Role to assign to the user */
  role: InviteUserDtoRole;
  /**
   * Optional password set by the admin. When omitted, a temp password is generated and emailed (existing flow). Must match signup rules: min 8 chars + at least one upper, one lower, one number, one special character.
   * @minLength 8
   * @pattern PASSWORD_REGULAR_EXPRESSION
   */
  password?: string;
  /** When present, the user is created and immediately granted complimentary Therapist Manager access in a single atomic transaction. Role must be Practitioners. */
  grant?: InviteGrantDto;
}

export interface InvitedUserData {
  uuid: string;
  name: string;
  email: string;
}

export interface InviteUserResponseModel {
  message: string;
  email_notice?: string;
  data: InvitedUserData;
}

export interface UpdateStatusDto {
  is_active: boolean;
}

export interface ContentPageModel {
  uuid: string;
  title: string;
  slug: string;
  content: string;
}

export interface AdminContentPageModel {
  content_pages: ContentPageModel;
  total_count: number;
}

export interface AdminContentPageResponseModel {
  message: string;
  email_notice?: string;
  data: AdminContentPageModel;
}

export interface UpdateContentPageDto {
  title?: string;
  content?: string;
}

export interface PermissionsModel {
  uuid: string;
  name: string;
  is_active: boolean;
  created_at: string;
  updated_at: string;
}

export interface AdminPermissionsModel {
  permissions: PermissionsModel[];
  total_count: number;
}

export interface AdminPermissionsResponseModel {
  message: string;
  email_notice?: string;
  data: AdminPermissionsModel;
}

export interface AdminPermissionDetailResponseModel {
  message: string;
  email_notice?: string;
  data: PermissionsModel;
}

export interface NameDto {
  name: string;
}

export interface RolesModel {
  uuid: string;
  name: string;
  is_active: boolean;
  created_at: string;
  updated_at: string;
}

export interface AdminRolesModel {
  roles: RolesModel[];
  total_count: number;
}

export interface AdminRolesResponseModel {
  message: string;
  email_notice?: string;
  data: AdminRolesModel;
}

export interface AdminRolesDetailResponseModel {
  message: string;
  email_notice?: string;
  data: RolesModel;
}

export interface CreateRoleDto {
  name: string;
  permission_uuids: string[];
}

export interface UpdateDto {
  name: string;
  permission_uuids: string[];
}

export interface ModelHasRoleDto {
  role_id: number;
  model_type: string;
  model_id: number;
}

export interface SubAdminResponseModel {
  uuid: string;
  name: string;
  email: string;
  /** @nullable */
  email_verified_at: string | null;
  password: string;
  /** @nullable */
  remember_token: string | null;
  locale: string;
  is_active: boolean;
  /** @nullable */
  mobile: string | null;
  /** @nullable */
  mobile_verified_at: string | null;
  created_at: string;
  /** @nullable */
  updated_at: string | null;
  model_has_roles: ModelHasRoleDto[];
}

export interface SubAdminListResponseModel {
  sub_admins: SubAdminResponseModel[];
  total_count: number;
}

export interface AdminSubAdminResponseModel {
  message: string;
  email_notice?: string;
  data: SubAdminListResponseModel;
}

export interface SubAdminModel {
  uuid: string;
  name: string;
  is_active: boolean;
  created_at: string;
  updated_at: string;
}

export interface SubAdminDetailResponseModel {
  message: string;
  email_notice?: string;
  data: SubAdminModel;
}

export interface SubAdminDto {
  roles: number[];
  email: string;
  password: string;
  name: string;
  is_active: boolean;
}

export interface Admin {
  id: number;
  uuid: string;
}

export interface UpdateSubAdminDto {
  roles: string[];
  email: string;
  name: string;
  is_active: boolean;
}

export type CreateScreeningDataStatus =
  (typeof CreateScreeningDataStatus)[keyof typeof CreateScreeningDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CreateScreeningDataStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

export interface CreateScreeningData {
  /** Screening UUID — use this to navigate to the questions page */
  uuid: string;
  status: CreateScreeningDataStatus;
}

export interface CreateScreeningScreening {
  screening: CreateScreeningData;
}

export interface CreateScreeningResponse {
  message: string;
  data: CreateScreeningScreening;
}

export interface AnswerItemDTO {
  /** UUID of the question being answered */
  question_uuid: string;
  /**
   * Answer value (0 = Definitely False, 1 = Mostly False, 2 = Mostly True, 3 = Definitely True)
   * @minimum 0
   * @maximum 3
   */
  answer: number;
}

export interface SubmitAnswersDTO {
  /**
   * Array of answers for each question
   * @minItems 1
   */
  answers: AnswerItemDTO[];
}

export interface IndividualScreeningResultItem {
  scale_name: string;
  raw_score: number;
  percentile: number;
  risk_level: string;
}

export interface ScreeningDetailItemResponse {
  /** Question order number (1–29) */
  question_order: number;
  /** English question text */
  question_text: string;
  /** Snake_case scale name */
  scale_name: string;
  /** Raw answer value: 1, 2, or 3 (0 items excluded) */
  answer_value: number;
  /** "Mostly False" | "Mostly True" | "Definitely True" */
  answer_label: string;
}

export type IndividualScreeningDataStatus =
  (typeof IndividualScreeningDataStatus)[keyof typeof IndividualScreeningDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const IndividualScreeningDataStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

export interface IndividualScreeningData {
  uuid: string;
  status: IndividualScreeningDataStatus;
  started_at?: string;
  completed_at?: string;
  /** True if the individual was invited by a therapist to complete this screening; false if self-initiated. */
  is_therapist_invited: boolean;
  /** @nullable */
  suicide_risk_category: string | null;
  /** @nullable */
  suicide_risk_narrative: string | null;
  results: IndividualScreeningResultItem[];
  item_responses: ScreeningDetailItemResponse[];
}

export interface IndividualScreeningResultsData {
  screening: IndividualScreeningData;
}

export interface IndividualScreeningResultsResponse {
  message: string;
  data: IndividualScreeningResultsData;
}

export interface ScreeningListResultsSummary {
  total_scales: number;
  high_risk_count: number;
  moderate_risk_count: number;
  low_risk_count: number;
}

export type ScreeningListItemStatus =
  (typeof ScreeningListItemStatus)[keyof typeof ScreeningListItemStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ScreeningListItemStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

/**
 * @nullable
 */
export type ScreeningListItemResultsSummary =
  ScreeningListResultsSummary | null;

export interface ScreeningListItem {
  uuid: string;
  status: ScreeningListItemStatus;
  /** True when the screening was created by a therapist/PM for this client */
  is_therapist_invited: boolean;
  /** True once the practitioner has shared the report with the client. Therapist-assigned completed screenings only appear in this list when this is true. */
  report_shared_with_client: boolean;
  /** @nullable */
  started_at: string | null;
  /** @nullable */
  completed_at: string | null;
  created_at: string;
  has_results: boolean;
  /** True when the screening was paid for directly by the individual */
  is_paid: boolean;
  /** @nullable */
  results_summary: ScreeningListItemResultsSummary;
}

export interface ScreeningListPagination {
  page: number;
  limit: number;
  total: number;
  total_pages: number;
}

export interface ScreeningListData {
  screenings: ScreeningListItem[];
  pagination: ScreeningListPagination;
}

export interface ScreeningListResponse {
  message: string;
  data: ScreeningListData;
}

export interface ResendVerificationDTO {
  /** User email address */
  email: string;
}

export interface SupportRequestDTO {
  /**
   * Subject of the support request
   * @minLength 5
   * @maxLength 200
   */
  subject: string;
  /**
   * Message body
   * @minLength 10
   * @maxLength 2000
   */
  message: string;
}

/**
 * Billing frequency: monthly or annual
 */
export type CreateSubscriptionDtoPlanType =
  (typeof CreateSubscriptionDtoPlanType)[keyof typeof CreateSubscriptionDtoPlanType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CreateSubscriptionDtoPlanType = {
  monthly: "monthly",
  annual: "annual",
} as const;

/**
 * Subscription type: individual or group (practice manager)
 */
export type CreateSubscriptionDtoSubscriptionType =
  (typeof CreateSubscriptionDtoSubscriptionType)[keyof typeof CreateSubscriptionDtoSubscriptionType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CreateSubscriptionDtoSubscriptionType = {
  individual: "individual",
  group: "group",
} as const;

export interface CreateSubscriptionDto {
  /** Billing frequency: monthly or annual */
  plan_type?: CreateSubscriptionDtoPlanType;
  /** Subscription type: individual or group (practice manager) */
  subscription_type: CreateSubscriptionDtoSubscriptionType;
}

export interface CheckoutSessionData {
  /** Stripe checkout URL */
  checkout_url: string;
  /** Stripe session ID */
  session_id: string;
}

export interface CheckoutSessionResponse {
  message: string;
  data: CheckoutSessionData;
}

export interface TrialCheckoutData {
  /** @nullable */
  checkout_url: string | null;
  /** @nullable */
  session_id: string | null;
  /** @nullable */
  message: string | null;
}

export interface TrialCheckoutResponse {
  message: string;
  data: TrialCheckoutData;
}

export interface TrialUpgradeResponse {
  /** Trial ended early — card will be charged immediately. Redirect user to subscription page. */
  message: string;
}

/**
 * Subscription status
 */
export type SubscriptionStatusDataStatus =
  (typeof SubscriptionStatusDataStatus)[keyof typeof SubscriptionStatusDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionStatusDataStatus = {
  active: "active",
  cancelled: "cancelled",
  past_due: "past_due",
  incomplete: "incomplete",
  paused: "paused",
} as const;

/**
 * Plan type
 */
export type SubscriptionStatusDataPlanType =
  (typeof SubscriptionStatusDataPlanType)[keyof typeof SubscriptionStatusDataPlanType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionStatusDataPlanType = {
  monthly: "monthly",
  annual: "annual",
} as const;

/**
 * Subscription type: individual or group
 * @nullable
 */
export type SubscriptionStatusDataSubscriptionType =
  | (typeof SubscriptionStatusDataSubscriptionType)[keyof typeof SubscriptionStatusDataSubscriptionType]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionStatusDataSubscriptionType = {
  individual: "individual",
  group: "group",
} as const;

/**
 * Billing cycle
 * @nullable
 */
export type SubscriptionStatusDataBillingCycle =
  | (typeof SubscriptionStatusDataBillingCycle)[keyof typeof SubscriptionStatusDataBillingCycle]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionStatusDataBillingCycle = {
  monthly: "monthly",
  yearly: "yearly",
} as const;

export interface SubscriptionStatusData {
  /** Subscription UUID */
  uuid: string;
  /** Subscription status */
  status: SubscriptionStatusDataStatus;
  /** Plan type */
  plan_type: SubscriptionStatusDataPlanType;
  /**
   * Subscription type: individual or group
   * @nullable
   */
  subscription_type?: SubscriptionStatusDataSubscriptionType;
  /**
   * Billing cycle
   * @nullable
   */
  billing_cycle?: SubscriptionStatusDataBillingCycle;
  /** Subscription amount */
  amount?: number;
  /** Currency code */
  currency?: string;
  /**
   * Stripe subscription ID
   * @nullable
   */
  stripe_subscription_id?: string | null;
  /**
   * Current period start (ISO date)
   * @nullable
   */
  current_period_start?: string | null;
  /**
   * Current period end (ISO date)
   * @nullable
   */
  current_period_end?: string | null;
  /**
   * Subscription start date (ISO date)
   * @nullable
   */
  started_at?: string | null;
  /**
   * Next renewal date (ISO date)
   * @nullable
   */
  renewal_date?: string | null;
  /**
   * Subscription expiry date (ISO date)
   * @nullable
   */
  expires_at?: string | null;
  /**
   * Cancellation date (ISO date)
   * @nullable
   */
  canceled_at?: string | null;
  /**
   * Trial end date (ISO date)
   * @nullable
   */
  trial_end?: string | null;
  /** True when the subscription is (or was) an admin-granted complimentary access. Stays true after auto-expiry so the FE can render an "ended on …" banner; flipped to false only on manual admin revoke. */
  is_complimentary: boolean;
  /**
   * Date the complimentary access ends / ended. Null for lifetime grants. Populated for active grants, auto-expired grants, and manually revoked grants whose original expiry was set.
   * @nullable
   */
  complimentary_ends_at?: string | null;
  /**
   * Record creation date (ISO date)
   * @nullable
   */
  created_at?: string | null;
}

/**
 * @nullable
 */
export type SubscriptionStatusResponseData = SubscriptionStatusData | null;

export interface SubscriptionStatusResponse {
  message: string;
  /** @nullable */
  data?: SubscriptionStatusResponseData;
}

/**
 * Current subscription state. "none" means no subscription exists.
 */
export type FrontendSubscriptionStatusDataStatus =
  (typeof FrontendSubscriptionStatusDataStatus)[keyof typeof FrontendSubscriptionStatusDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const FrontendSubscriptionStatusDataStatus = {
  active: "active",
  cancelled: "cancelled",
  past_due: "past_due",
  incomplete: "incomplete",
  paused: "paused",
  none: "none",
} as const;

/**
 * Which pricing plan the user subscribed to
 * @nullable
 */
export type FrontendSubscriptionStatusDataPlanType =
  | (typeof FrontendSubscriptionStatusDataPlanType)[keyof typeof FrontendSubscriptionStatusDataPlanType]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const FrontendSubscriptionStatusDataPlanType = {
  monthly: "monthly",
  annual: "annual",
} as const;

/**
 * Subscription type: individual or group
 * @nullable
 */
export type FrontendSubscriptionStatusDataSubscriptionType =
  | (typeof FrontendSubscriptionStatusDataSubscriptionType)[keyof typeof FrontendSubscriptionStatusDataSubscriptionType]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const FrontendSubscriptionStatusDataSubscriptionType = {
  individual: "individual",
  group: "group",
} as const;

export interface FrontendSubscriptionStatusData {
  /** Current subscription state. "none" means no subscription exists. */
  status: FrontendSubscriptionStatusDataStatus;
  /**
   * Which pricing plan the user subscribed to
   * @nullable
   */
  plan_type?: FrontendSubscriptionStatusDataPlanType;
  /**
   * Subscription type: individual or group
   * @nullable
   */
  subscription_type?: FrontendSubscriptionStatusDataSubscriptionType;
  /**
   * When the current billing period ends (ISO date)
   * @nullable
   */
  current_period_end?: string | null;
  /**
   * When the 14-day free trial ends (ISO date). Non-null means the subscription is currently in trial. Use this to show a trial countdown banner and "Upgrade Now" button in the UI.
   * @nullable
   */
  trial_end?: string | null;
  /** True if the subscription is a free trial. Use to decide whether to enforce the 5-screening limit. */
  is_trial: boolean;
  /** Number of screenings completed during the trial period. Only relevant when is_trial = true. */
  trial_screenings_used: number;
}

export interface FrontendSubscriptionStatusResponse {
  message: string;
  data: FrontendSubscriptionStatusData;
}

export interface BillingPortalData {
  /** Stripe billing portal URL */
  portal_url: string;
  /** True if the user is currently in a free trial. Use this to decide whether to redirect to Stripe portal or call /trial/switch-plan for plan changes. */
  is_trial: boolean;
}

export interface BillingPortalResponse {
  message: string;
  data: BillingPortalData;
}

export interface CancelSubscriptionResponse {
  message: string;
}

/**
 * Plan features by billing cycle. Use _es suffix keys for Spanish translations.
 */
export type SubscriptionPlanDataFeatures = { [key: string]: unknown };

/**
 * Subscription type: individual or group
 * @nullable
 */
export type SubscriptionPlanDataSubscriptionType =
  | (typeof SubscriptionPlanDataSubscriptionType)[keyof typeof SubscriptionPlanDataSubscriptionType]
  | null;

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionPlanDataSubscriptionType = {
  individual: "individual",
  group: "group",
} as const;

export interface SubscriptionPlanData {
  /** Plan ID */
  id: number;
  /** Plan name (English) */
  name: string;
  /**
   * Plan name (Spanish)
   * @nullable
   */
  name_es?: string | null;
  /** Plan description (English) */
  description: string;
  /**
   * Plan description (Spanish)
   * @nullable
   */
  description_es?: string | null;
  /** Monthly price */
  price_monthly: number;
  /** Yearly price */
  price_yearly: number;
  /** Plan features by billing cycle. Use _es suffix keys for Spanish translations. */
  features: SubscriptionPlanDataFeatures;
  /**
   * Subscription type: individual or group
   * @nullable
   */
  subscription_type?: SubscriptionPlanDataSubscriptionType;
  /** Whether the plan is active */
  is_active: boolean;
}

export interface SubscriptionPlansResponse {
  message: string;
  /** Array of available plans */
  data: SubscriptionPlanData[];
}

export interface InvoiceData {
  /** Invoice ID */
  id: string;
  /** Invoice date */
  date: string;
  /**
   * Plan/product name from Stripe
   * @nullable
   */
  plan_name?: string | null;
  /** Invoice amount */
  amount: number;
  /** Currency code */
  currency: string;
  /** Invoice status */
  status: string;
  /** Invoice URL */
  invoice_url?: string;
  /** Invoice PDF URL */
  invoice_pdf?: string;
}

export interface PaginationMeta {
  /** Total number of records */
  total: number;
  /** Current page number */
  page: number;
  /** Number of records per page */
  limit: number;
  /** Total number of pages */
  totalPages: number;
}

export interface BillingHistoryResponse {
  message: string;
  /** Array of invoices */
  data: InvoiceData[];
  meta: PaginationMeta;
}

/**
 * Client gender
 */
export type CreateClientDtoGender =
  (typeof CreateClientDtoGender)[keyof typeof CreateClientDtoGender];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CreateClientDtoGender = {
  Male: "Male",
  Female: "Female",
  Other: "Other",
} as const;

export interface CreateClientDto {
  /**
   * Client full name
   * @minLength 2
   * @maxLength 100
   * @pattern /^[^<>]*$/
   */
  name: string;
  /** Client email address */
  email?: string;
  /**
   * Client phone number
   * @pattern /^\+?[\d\s\-().]{7,20}$/
   */
  phone?: string;
  /**
   * Client age
   * @minimum 18
   * @maximum 120
   */
  age?: number;
  /** Client gender */
  gender: CreateClientDtoGender;
}

/**
 * Client gender
 */
export type ClientDataWithPasswordGender =
  (typeof ClientDataWithPasswordGender)[keyof typeof ClientDataWithPasswordGender];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ClientDataWithPasswordGender = {
  male: "male",
  female: "female",
  other: "other",
} as const;

export interface ClientDataWithPassword {
  /** Unique client ID */
  id: number;
  /** Client UUID */
  uuid: string;
  /** Client full name */
  name: string;
  /** Client email address */
  email?: string;
  /** Client phone number */
  phone?: string;
  /** Client age */
  age?: number;
  /** Client gender */
  gender: ClientDataWithPasswordGender;
  /** Practitioner ID who owns this client */
  practitioner_id: number;
  /** Linked user account ID */
  user_id?: number;
  /** Creation timestamp */
  created_at: string;
  /** Last update timestamp */
  updated_at?: string;
  /** Whether the latest completed screening report has been shared with the client */
  latest_report_shared: boolean;
  /** Temporary password for client login */
  temp_password: string;
}

export interface CreateClientResponse {
  message: string;
  data: ClientDataWithPassword;
}

export interface Object {
  [key: string]: unknown;
}

/**
 * Client gender
 */
export type ClientDataGender =
  (typeof ClientDataGender)[keyof typeof ClientDataGender];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ClientDataGender = {
  male: "male",
  female: "female",
  other: "other",
} as const;

export interface ClientData {
  /** Unique client ID */
  id: number;
  /** Client UUID */
  uuid: string;
  /** Client full name */
  name: string;
  /** Client email address */
  email?: string;
  /** Client phone number */
  phone?: string;
  /** Client age */
  age?: number;
  /** Client gender */
  gender: ClientDataGender;
  /** Practitioner ID who owns this client */
  practitioner_id: number;
  /** Linked user account ID */
  user_id?: number;
  /** Creation timestamp */
  created_at: string;
  /** Last update timestamp */
  updated_at?: string;
  /** Whether the latest completed screening report has been shared with the client */
  latest_report_shared: boolean;
}

export interface ClientListResponse {
  message: string;
  /** Array of client records */
  data: ClientData[];
  meta: PaginationMeta;
}

export interface ClientResponse {
  message: string;
  data: ClientData;
}

/**
 * Client gender
 */
export type UpdateClientDtoGender =
  (typeof UpdateClientDtoGender)[keyof typeof UpdateClientDtoGender];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const UpdateClientDtoGender = {
  Male: "Male",
  Female: "Female",
  Other: "Other",
} as const;

export interface UpdateClientDto {
  /**
   * Client full name
   * @minLength 2
   * @maxLength 100
   * @pattern /^[^<>]*$/
   */
  name?: string;
  /** Client email address */
  email?: string;
  /**
   * Client phone number
   * @pattern /^\+?[\d\s\-().]{7,20}$/
   */
  phone?: string;
  /**
   * Client age
   * @minimum 18
   * @maximum 120
   */
  age?: number;
  /** Client gender */
  gender?: UpdateClientDtoGender;
}

export interface DeleteClientResponse {
  message: string;
}

export interface ResendCredentialsData {
  /** New temporary password */
  temp_password: string;
}

export interface ResendCredentialsResponse {
  message: string;
  data: ResendCredentialsData;
}

export interface SendReminderResponse {
  message: string;
}

export interface VisibilitySettingsData {
  /** Client can view assessment results */
  can_view_results: boolean;
  /** Client can view progress tracking */
  can_view_progress: boolean;
  /** Client can download PDF reports */
  can_download_reports: boolean;
}

export interface VisibilitySettingsResponse {
  message: string;
  data: VisibilitySettingsData;
}

export interface UpdateVisibilitySettingsDto {
  /** Allow client to view their assessment results */
  can_view_results?: boolean;
  /** Allow client to view their progress charts */
  can_view_progress?: boolean;
  /** Allow client to download PDF reports */
  can_download_reports?: boolean;
}

export interface RiskDistribution {
  low: number;
  moderate: number;
  high: number;
}

export interface DashboardStatsData {
  /** Total clients assigned to this practitioner */
  total_clients: number;
  /** Total screenings across all clients */
  total_screenings: number;
  /** Completed screenings */
  completed_screenings: number;
  /** Screenings not yet completed */
  pending_screenings: number;
  /** Count of "At Least Moderate" suicide risk screenings */
  high_risk_cases: number;
  risk_distribution: RiskDistribution;
}

export interface DashboardStatsResponse {
  message: string;
  data: DashboardStatsData;
}

export interface ScreeningResultItem {
  scale_name: string;
  raw_score: number;
  percentile: string;
  risk_level: string;
}

export type ScreeningDetailDataStatus =
  (typeof ScreeningDetailDataStatus)[keyof typeof ScreeningDetailDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ScreeningDetailDataStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

export type ScreeningDetailDataClient = { [key: string]: unknown };

export interface ScreeningDetailData {
  id: number;
  uuid: string;
  status: ScreeningDetailDataStatus;
  started_at?: string;
  completed_at?: string;
  created_at: string;
  client: ScreeningDetailDataClient;
  results: ScreeningResultItem[];
  answers_count: number;
  /** Per-item responses (score > 0 only) */
  item_responses: ScreeningDetailItemResponse[];
}

export interface ScreeningDetailResponse {
  message: string;
  data: ScreeningDetailData;
}

export interface ChartDataPoint {
  /** Label for the data point */
  label: string;
  /** Value for the data point */
  value: number;
}

export interface ChartData {
  /** Chart period type */
  period: string;
  /** Year of the chart data */
  year: number;
  /** Array of chart data points */
  chart_data: ChartDataPoint[];
  /** Total count for the period */
  total: number;
}

export interface ScreeningsChartResponse {
  message: string;
  data: ChartData;
}

export interface ClientsChartResponse {
  message: string;
  data: ChartData;
}

export interface HighRiskCaseData {
  /** Client ID */
  client_id: number;
  /** Client name */
  client_name: string;
  /** Client email */
  client_email?: string;
  /** Client phone number */
  mobile_number?: string;
  /** Client gender */
  gender?: string;
  /** Client age */
  age?: number;
  /** Screening ID */
  screening_id: number;
  /** Screening completion date */
  screening_date: string;
  /** Suicide risk category */
  suicide_risk_category: string;
}

export interface HighRiskCasesResponse {
  message: string;
  /** Array of high-risk cases */
  data: HighRiskCaseData[];
  meta: PaginationMeta;
}

export interface PendingScreeningData {
  /** Client ID */
  client_id: number;
  /** Client name */
  client_name: string;
  /** Client email */
  client_email?: string;
  /** Client phone number */
  mobile_number?: string;
  /** Client gender */
  gender?: string;
  /** Client age */
  age?: number;
  /** Screening ID */
  screening_id: number;
  /** Screening creation date */
  created_at: string;
}

export interface PendingScreeningsResponse {
  message: string;
  /** Array of pending screenings */
  data: PendingScreeningData[];
  meta: PaginationMeta;
}

export interface CompletedScreeningData {
  /** Client ID */
  client_id: number;
  /** Client name */
  client_name: string;
  /** Client email */
  client_email?: string;
  /** Client phone number */
  mobile_number?: string;
  /** Client gender */
  gender?: string;
  /** Client age */
  age?: number;
  /** Screening ID */
  screening_id: number;
  /** Screening UUID */
  screening_uuid: string;
  /** Screening completion date */
  completed_at: string;
  /** Suicide risk category */
  suicide_risk_category: string;
}

export interface CompletedScreeningsResponse {
  message: string;
  /** Array of completed screenings */
  data: CompletedScreeningData[];
  meta: PaginationMeta;
}

export interface CreateAssessmentLinkDto {
  /**
   * Number of days until the link expires (default: 7)
   * @minimum 1
   */
  expires_in_days?: number;
}

export interface BulkCreateLinkDto {
  /**
   * Array of client IDs to generate assessment links for
   * @minItems 1
   */
  client_ids: number[];
  /** Whether to send email notifications (default: true) */
  send_email?: boolean;
  /**
   * Number of days until the links expire (default: 7)
   * @minimum 1
   */
  expires_in_days?: number;
}

export interface BulkSendEmailDto {
  /**
   * Array of assessment link IDs to send emails for
   * @minItems 1
   */
  link_ids: number[];
}

export interface PublicAnswerDto {
  /** UUID of the question */
  question_uuid: string;
  /**
   * Answer value (0-3)
   * @minimum 0
   * @maximum 3
   */
  answer: number;
}

export interface SubmitPublicAnswersDto {
  /**
   * Array of answers to submit
   * @minItems 1
   */
  answers: PublicAnswerDto[];
}

export interface PublicAssessmentResultItem {
  scale_name: string;
  raw_score: number;
  percentile: number;
  risk_level: string;
}

export interface PublicAssessmentResultsData {
  client_name: string;
  completed_at: string;
  results: PublicAssessmentResultItem[];
  overall_risk: string;
  /** @nullable */
  suicide_risk_category: string | null;
  /** @nullable */
  suicide_risk_narrative: string | null;
  item_responses: ScreeningDetailItemResponse[];
  is_therapist_invited: boolean;
}

export interface PublicAssessmentResultsResponse {
  message: string;
  data: PublicAssessmentResultsData;
}

export interface AdminTransactionUserData {
  uuid: string;
  username: string;
  email: string;
  /** @nullable */
  avatar?: string | null;
  /** @nullable */
  role?: string | null;
}

/**
 * @nullable
 */
export type AdminTransactionDataUser = AdminTransactionUserData | null;

/**
 * Revenue source
 */
export type AdminTransactionDataSource =
  (typeof AdminTransactionDataSource)[keyof typeof AdminTransactionDataSource];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AdminTransactionDataSource = {
  payment: "payment",
  subscription: "subscription",
} as const;

export interface AdminTransactionData {
  /** Transaction UUID */
  uuid: string;
  /** @nullable */
  user?: AdminTransactionDataUser;
  /** Amount (always > 0) */
  amount: number;
  currency: string;
  /** Revenue source */
  source: AdminTransactionDataSource;
  /** Always "completed" — endpoint hard-filters on this */
  status: string;
  /** ISO UTC timestamp of payment */
  paid_at: string;
  /**
   * Stripe invoice id (source=subscription) or payment_intent id (source=payment)
   * @nullable
   */
  external_id?: string | null;
}

export interface AdminTransactionListData {
  transactions: AdminTransactionData[];
  total_count: number;
  page: number;
  limit: number;
  total_pages: number;
}

export interface AdminTransactionListResponse {
  message: string;
  data: AdminTransactionListData;
}

/**
 * New status for the lead
 */
export type ProcessLeadDtoStatus =
  (typeof ProcessLeadDtoStatus)[keyof typeof ProcessLeadDtoStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ProcessLeadDtoStatus = {
  new: "new",
  contacted: "contacted",
  qualified: "qualified",
  converted: "converted",
  closed: "closed",
} as const;

export interface ProcessLeadDto {
  /** New status for the lead */
  status: ProcessLeadDtoStatus;
  /** Notes about the lead processing */
  notes?: string;
}

/**
 * New status for the ticket
 */
export type UpdateTicketStatusDtoStatus =
  (typeof UpdateTicketStatusDtoStatus)[keyof typeof UpdateTicketStatusDtoStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const UpdateTicketStatusDtoStatus = {
  open: "open",
  in_progress: "in_progress",
  resolved: "resolved",
  closed: "closed",
} as const;

export interface UpdateTicketStatusDto {
  /** New status for the ticket */
  status: UpdateTicketStatusDtoStatus;
  /** Resolution notes for the ticket */
  resolution_notes?: string;
}

export interface CreateLeadDto {
  /**
   * Name of the person submitting the contact form
   * @maxLength 255
   */
  name: string;
  /**
   * Email address
   * @maxLength 255
   */
  email: string;
  /**
   * Phone number (optional)
   * @maxLength 20
   */
  phone?: string;
  /**
   * Subject of the inquiry
   * @maxLength 500
   */
  subject: string;
  /** Message content */
  message: string;
  /**
   * Source of the lead (e.g., website, referral)
   * @maxLength 100
   */
  source?: string;
}

export interface PMClientListItemData {
  /** Client UUID */
  uuid: string;
  /** Client full name */
  name: string;
  /** Client email address */
  email: string;
  /** Client phone number */
  phone?: string;
  /** Client age */
  age?: number;
  /** Client gender */
  gender?: string;
  /** Assigned therapist name */
  therapist: string;
  /** Assigned therapist UUID */
  therapist_uuid: string;
  /** Number of screenings for this client */
  screening_count: number;
  /** Client creation date */
  created_at: string;
}

export interface PMClientListResponse {
  message: string;
  /** Array of client records */
  data: PMClientListItemData[];
  meta: PaginationMeta;
}

export type CreatePMClientDtoGender =
  (typeof CreatePMClientDtoGender)[keyof typeof CreatePMClientDtoGender];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CreatePMClientDtoGender = {
  Male: "Male",
  Female: "Female",
  Other: "Other",
} as const;

export interface CreatePMClientDto {
  /**
   * @minLength 2
   * @maxLength 100
   * @pattern /^[^<>]*$/
   */
  name: string;
  email: string;
  phone?: string;
  /**
   * @minimum 18
   * @maximum 120
   */
  age?: number;
  gender: CreatePMClientDtoGender;
  /** UUID of therapist to assign client to */
  therapist_uuid?: string;
}

/**
 * Client gender
 */
export type PMCreateClientDataGender =
  (typeof PMCreateClientDataGender)[keyof typeof PMCreateClientDataGender];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PMCreateClientDataGender = {
  male: "male",
  female: "female",
  other: "other",
} as const;

export interface PMCreateClientData {
  /** Client UUID */
  uuid: string;
  /** Client full name */
  name: string;
  /** Client email address */
  email: string;
  /** Client phone number */
  phone?: string;
  /** Client age */
  age?: number;
  /** Client gender */
  gender: PMCreateClientDataGender;
}

export interface PMCreateClientResponse {
  message: string;
  data: PMCreateClientData;
}

export interface PMSendInvitationResponse {
  message: string;
}

export interface PMSendReminderResponse {
  message: string;
}

/**
 * Screening status
 */
export type PMClientScreeningDataStatus =
  (typeof PMClientScreeningDataStatus)[keyof typeof PMClientScreeningDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PMClientScreeningDataStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

export interface PMClientScreeningData {
  /** Screening UUID */
  uuid: string;
  /** Screening status */
  status: PMClientScreeningDataStatus;
  /** Screening start timestamp */
  started_at?: string;
  /** Screening completion timestamp */
  completed_at?: string;
  /** Screening creation date */
  created_at: string;
  /** Highest risk level identified in screening */
  highest_risk?: string;
}

export interface PMClientScreeningsResponse {
  message: string;
  /** Array of screening records */
  data: PMClientScreeningData[];
  meta: PaginationMeta;
}

export interface PMDashboardStatsData {
  /** Total number of therapists in the practice */
  total_therapists: number;
  /** Maximum number of therapists allowed by the subscription */
  therapist_limit: number;
  /** Total number of clients across all therapists */
  total_clients: number;
  /** Total number of completed screenings */
  screens_completed: number;
  /** Number of screenings pending completion */
  pending_screens: number;
  /** Number of high-risk cases identified */
  high_risk_cases: number;
}

export interface PMDashboardStatsResponse {
  message: string;
  data: PMDashboardStatsData;
}

export interface PMChartDataPoint {
  /** Label for the data point */
  label: string;
  /** Value for the data point */
  value: number;
}

export interface PMChartData {
  /** Chart period type */
  period: string;
  /** Year of the chart data */
  year: number;
  /** Array of chart data points */
  chart_data: PMChartDataPoint[];
  /** Total count for the period */
  total: number;
}

export interface PMScreeningsChartResponse {
  message: string;
  data: PMChartData;
}

export interface PMClientsChartResponse {
  message: string;
  data: PMChartData;
}

export interface PMHighRiskCaseData {
  /** Client UUID */
  client_uuid?: string;
  /** Client name */
  client_name?: string;
  /** Client email */
  client_email?: string;
  /** Client phone number */
  mobile_number?: string;
  /** Screening UUID */
  screening_uuid: string;
  /** Screening completion date */
  screening_date: string;
  /** Suicide risk category */
  suicide_risk_category: string;
}

export interface PMHighRiskCasesResponse {
  message: string;
  /** Array of high-risk cases */
  data: PMHighRiskCaseData[];
  meta: PaginationMeta;
}

export interface PMPendingScreeningData {
  /** Client UUID */
  client_uuid?: string;
  /** Client name */
  client_name?: string;
  /** Client email */
  client_email?: string;
  /** Client phone number */
  mobile_number?: string;
  /** Client gender */
  gender?: string;
  /** Client age */
  age?: number;
  /** Screening UUID */
  screening_uuid: string;
  /** Screening creation date */
  created_at: string;
}

export interface PMPendingScreeningsResponse {
  message: string;
  /** Array of pending screenings */
  data: PMPendingScreeningData[];
  meta: PaginationMeta;
}

export interface PMCompletedScreeningData {
  /** Client UUID */
  client_uuid?: string;
  /** Client name */
  client_name?: string;
  /** Client email */
  client_email?: string;
  /** Client phone number */
  mobile_number?: string;
  /** Client gender */
  gender?: string;
  /** Client age */
  age?: number;
  /** Screening UUID */
  screening_uuid: string;
  /** Screening completion date */
  completed_at: string;
  /** Suicide risk category */
  suicide_risk_category: string;
}

export interface PMCompletedScreeningsResponse {
  message: string;
  /** Array of completed screenings */
  data: PMCompletedScreeningData[];
  meta: PaginationMeta;
}

/**
 * Team member status
 */
export type TherapistListItemDataStatus =
  (typeof TherapistListItemDataStatus)[keyof typeof TherapistListItemDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const TherapistListItemDataStatus = {
  invited: "invited",
  active: "active",
  deactivated: "deactivated",
  declined: "declined",
} as const;

export interface TherapistListItemData {
  /** Team member UUID */
  uuid: string;
  /** Therapist user UUID */
  member_uuid: string;
  /** Therapist full name */
  name: string;
  /** Therapist email address */
  email: string;
  /** Therapist phone number */
  phone?: string;
  /** Profile photo URL */
  profile_photo?: string;
  /** Number of assigned clients */
  total_clients: number;
  /** Total completed screenings */
  screenings: number;
  /** Team member status */
  status: TherapistListItemDataStatus;
  /** Date the therapist joined */
  joined_at?: string;
  /** Record creation date */
  created_at: string;
}

export interface TherapistListResponse {
  message: string;
  /** Array of therapist records */
  data: TherapistListItemData[];
  meta: PaginationMeta;
}

export interface InviteTherapistDto {
  /**
   * @minLength 2
   * @maxLength 100
   * @pattern /^[^<>]*$/
   */
  name: string;
  email: string;
  /** @pattern /^\+?[\d\s\-().]{7,20}$/ */
  phone?: string;
}

/**
 * Team member status
 */
export type InviteTherapistDataStatus =
  (typeof InviteTherapistDataStatus)[keyof typeof InviteTherapistDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const InviteTherapistDataStatus = {
  invited: "invited",
  active: "active",
  deactivated: "deactivated",
  declined: "declined",
} as const;

export interface InviteTherapistData {
  /** Team member UUID */
  uuid: string;
  /** Team member status */
  status: InviteTherapistDataStatus;
}

export interface InviteTherapistResponse {
  message: string;
  data: InviteTherapistData;
}

export interface UpdateTherapistDto {
  /**
   * @minLength 2
   * @maxLength 100
   */
  name?: string;
  email?: string;
  phone?: string;
}

export interface UpdateTherapistData {
  /** Team member UUID */
  uuid: string;
  /** Updated name */
  name?: string;
  /** Updated email */
  email?: string;
  /** Updated phone */
  phone?: string;
}

export interface UpdateTherapistResponse {
  message: string;
  data: UpdateTherapistData;
}

export interface RemoveTherapistResponse {
  message: string;
}

/**
 * Updated therapist status
 */
export type ToggleTherapistStatusDataStatus =
  (typeof ToggleTherapistStatusDataStatus)[keyof typeof ToggleTherapistStatusDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ToggleTherapistStatusDataStatus = {
  active: "active",
  deactivated: "deactivated",
} as const;

export interface ToggleTherapistStatusData {
  /** Updated therapist status */
  status: ToggleTherapistStatusDataStatus;
}

export interface ToggleTherapistStatusResponse {
  message: string;
  data: ToggleTherapistStatusData;
}

export interface AcceptInvitationDto {
  /** Invitation token from the email link */
  token: string;
}

export interface PMScreeningQuestionData {
  /** Question UUID */
  uuid: string;
  /** Question text in English */
  text: string;
  /** Question text in Spanish */
  text_es?: string;
  /** Display order of the question */
  order: number;
}

export interface PMScreeningQuestionsResponse {
  message: string;
  /** Array of screening questions */
  data: PMScreeningQuestionData[];
}

export interface StartScreeningDto {
  /** UUID of the client to start screening for */
  client_uuid: string;
}

/**
 * Screening status
 */
export type PMStartScreeningDataStatus =
  (typeof PMStartScreeningDataStatus)[keyof typeof PMStartScreeningDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PMStartScreeningDataStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

export interface PMStartScreeningData {
  /** Screening UUID */
  screening_uuid: string;
  /** Client UUID */
  client_uuid: string;
  /** Client full name */
  client_name: string;
  /** Screening status */
  status: PMStartScreeningDataStatus;
  /** Screening start timestamp */
  started_at: string;
}

export interface PMStartScreeningResponse {
  message: string;
  data: PMStartScreeningData;
}

export interface PMAnswerItemDto {
  /** UUID of the question being answered */
  question_uuid: string;
  /**
   * Answer value (0 = Definitely False, 1 = Mostly False, 2 = Mostly True, 3 = Definitely True)
   * @minimum 0
   * @maximum 3
   */
  answer: number;
}

export interface SubmitScreeningDto {
  /**
   * Array of answers for each question
   * @minItems 1
   */
  answers: AnswerItemDto[];
}

export interface PMScreeningResultItem {
  /** Assessment scale name */
  scale_name: string;
  /** Percentile score */
  percentile: number;
  /** Risk level classification */
  risk_level: string;
}

/**
 * Screening status
 */
export type PMSubmitScreeningResultDataStatus =
  (typeof PMSubmitScreeningResultDataStatus)[keyof typeof PMSubmitScreeningResultDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PMSubmitScreeningResultDataStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

export interface PMSubmitScreeningResultData {
  /** Screening UUID */
  uuid: string;
  /** Screening status */
  status: PMSubmitScreeningResultDataStatus;
  /** Screening start timestamp */
  started_at?: string;
  /** Screening completion timestamp */
  completed_at?: string;
  /** Array of screening results by scale */
  results: PMScreeningResultItem[];
}

export interface PMSubmitScreeningResponse {
  message: string;
  data: PMSubmitScreeningResultData;
}

export interface PMShareReportResponse {
  message: string;
}

export interface PMReportClientData {
  /** Client UUID */
  uuid: string;
  /** Client full name */
  name: string;
  /** Client email address */
  email: string;
  /** Client age */
  age?: number;
  /** Client gender */
  gender?: string;
}

export interface PMItemResponseItem {
  /** Question order number (1–29) */
  question_order: number;
  /** English question text */
  question_text: string;
  /** Snake_case scale name */
  scale_name: string;
  /** Raw answer value: 1, 2, or 3 (0 items excluded) */
  answer_value: number;
  /** "Mostly False" | "Mostly True" | "Definitely True" */
  answer_label: string;
}

/**
 * Screening status
 */
export type PMScreeningReportDataStatus =
  (typeof PMScreeningReportDataStatus)[keyof typeof PMScreeningReportDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PMScreeningReportDataStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

export interface PMScreeningReportData {
  /** Screening UUID */
  uuid: string;
  /** Screening status */
  status: PMScreeningReportDataStatus;
  /** Screening start timestamp */
  started_at?: string;
  /** Screening completion timestamp */
  completed_at?: string;
  /** Screening creation date */
  created_at: string;
  /** Client details for the screening */
  client: PMReportClientData;
  /** Suicide risk category from Joiner 24-condition algorithm */
  suicide_risk_category: string;
  /**
   * Conditional interpretive narrative for the suicide risk category (therapist version)
   * @nullable
   */
  suicide_risk_narrative: string | null;
  /** Array of screening results by scale */
  results: PMScreeningResultItem[];
  /** Total number of answers submitted */
  answers_count: number;
  /** Per-item responses (score > 0 only), sorted by canonical scale order then item_number */
  item_responses: PMItemResponseItem[];
}

export interface PMScreeningReportResponse {
  message: string;
  data: PMScreeningReportData;
}

/**
 * Notification type
 */
export type PMNotificationDataType =
  (typeof PMNotificationDataType)[keyof typeof PMNotificationDataType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PMNotificationDataType = {
  lead: "lead",
  support: "support",
  user: "user",
  screening_complete: "screening_complete",
  client_added: "client_added",
  subscription: "subscription",
  system: "system",
} as const;

/**
 * Additional notification metadata
 */
export type PMNotificationDataData = { [key: string]: unknown };

export interface PMNotificationData {
  /** Notification UUID */
  uuid: string;
  /** Notification type */
  type: PMNotificationDataType;
  /** Notification title */
  title: string;
  /** Notification message body */
  message: string;
  /** Whether the notification has been read */
  is_read: boolean;
  /** Additional notification metadata */
  data?: PMNotificationDataData;
  /** Creation timestamp */
  created_at: string;
}

export interface PMNotificationListResponse {
  message: string;
  /** Array of notifications */
  data: PMNotificationData[];
  meta: PaginationMeta;
}

export interface PMUnreadCountData {
  /** Number of unread notifications */
  unread_count: number;
}

export interface PMUnreadCountResponse {
  message: string;
  data: PMUnreadCountData;
}

export interface PMNotificationActionResponse {
  message: string;
}

export type StartScreeningDataDtoStatus =
  (typeof StartScreeningDataDtoStatus)[keyof typeof StartScreeningDataDtoStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const StartScreeningDataDtoStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

export interface StartScreeningDataDto {
  screening_uuid: string;
  client_uuid: string;
  client_name: string;
  status: StartScreeningDataDtoStatus;
  /** @nullable */
  started_at: string | null;
}

export interface StartScreeningResponseDto {
  message: string;
  data: StartScreeningDataDto;
}

export interface PractitionerScreeningQuestionData {
  /** Question UUID */
  uuid: string;
  /** Question text in English */
  text: string;
  /** Question text in Spanish */
  text_es?: string;
  /** Display order of the question */
  order: number;
  /** Response type for the question */
  response_type: string;
}

export interface PractitionerScreeningQuestionsResponse {
  message: string;
  /** Array of screening questions */
  data: PractitionerScreeningQuestionData[];
}

export interface AnswerItemDto {
  /** UUID of the question being answered */
  question_uuid: string;
  /**
   * Answer value (0 = Definitely False, 1 = Mostly False, 2 = Mostly True, 3 = Definitely True)
   * @minimum 0
   * @maximum 3
   */
  answer: number;
}

export interface PractitionerScreeningResultItem {
  /** Assessment scale name */
  scale_name: string;
  /** Raw score for this scale */
  raw_score: number;
  /** Percentile score */
  percentile: number;
  /** Risk level stored in DB */
  risk_level: string;
}

/**
 * Screening status
 */
export type PractitionerSubmitScreeningResultDataStatus =
  (typeof PractitionerSubmitScreeningResultDataStatus)[keyof typeof PractitionerSubmitScreeningResultDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PractitionerSubmitScreeningResultDataStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

export interface PractitionerSubmitScreeningResultData {
  /** Screening UUID */
  uuid: string;
  /** Screening status */
  status: PractitionerSubmitScreeningResultDataStatus;
  /** Screening start timestamp */
  started_at?: string;
  /** Screening completion timestamp */
  completed_at?: string;
  /** Array of screening results by scale (only present when screening is completed) */
  results: PractitionerScreeningResultItem[];
}

export interface PractitionerSubmitScreeningResponse {
  message: string;
  data: PractitionerSubmitScreeningResultData;
}

export interface PractitionerShareReportResponse {
  message: string;
}

export interface PractitionerReportClientData {
  uuid: string;
  name: string;
  email: string;
  age?: number;
  gender?: string;
}

export interface PractitionerItemResponseItem {
  /** Question order number (1–29) */
  question_order: number;
  question_text: string;
  scale_name: string;
  /** Raw answer value: 1, 2, or 3 (0 items excluded) */
  answer_value: number;
  answer_label: string;
}

export type PractitionerScreeningReportDataStatus =
  (typeof PractitionerScreeningReportDataStatus)[keyof typeof PractitionerScreeningReportDataStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PractitionerScreeningReportDataStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

/**
 * @nullable
 */
export type PractitionerScreeningReportDataClient =
  PractitionerReportClientData | null;

export interface PractitionerScreeningReportData {
  uuid: string;
  status: PractitionerScreeningReportDataStatus;
  started_at?: string;
  completed_at?: string;
  created_at: string;
  /** @nullable */
  client: PractitionerScreeningReportDataClient;
  /** Suicide risk category from Joiner 24-condition algorithm */
  suicide_risk_category: string;
  /**
   * Conditional interpretive narrative for the suicide risk category (therapist version)
   * @nullable
   */
  suicide_risk_narrative: string | null;
  results: PractitionerScreeningResultItem[];
  answers_count: number;
  item_responses: PractitionerItemResponseItem[];
}

export interface PractitionerScreeningReportResponse {
  message: string;
  data: PractitionerScreeningReportData;
}

export type AdminPlanDataSubscriptionType =
  (typeof AdminPlanDataSubscriptionType)[keyof typeof AdminPlanDataSubscriptionType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AdminPlanDataSubscriptionType = {
  individual: "individual",
  group: "group",
} as const;

/**
 * @nullable
 */
export type AdminPlanDataFeatures = { [key: string]: unknown } | null;

export interface AdminPlanData {
  /** Plan ID */
  id: number;
  uuid: string;
  name: string;
  /** @nullable */
  name_es?: string | null;
  /** @nullable */
  description?: string | null;
  /** @nullable */
  description_es?: string | null;
  price_monthly: number;
  price_yearly: number;
  subscription_type: AdminPlanDataSubscriptionType;
  is_active: boolean;
  /**
   * null for Individual plans
   * @nullable
   */
  max_practitioners?: number | null;
  /** @nullable */
  stripe_product_id?: string | null;
  /** @nullable */
  stripe_price_id_monthly?: string | null;
  /** @nullable */
  stripe_price_id_annual?: string | null;
  /** @nullable */
  features?: AdminPlanDataFeatures;
  /** @nullable */
  deleted_at?: string | null;
  created_at: string;
  updated_at: string;
}

export interface AdminPlansListResponse {
  data: AdminPlanData[];
}

export interface CreatePlanFeaturesDto {
  monthly?: string[];
  yearly?: string[];
  monthly_es?: string[];
  yearly_es?: string[];
}

export type CreatePlanDtoSubscriptionType =
  (typeof CreatePlanDtoSubscriptionType)[keyof typeof CreatePlanDtoSubscriptionType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const CreatePlanDtoSubscriptionType = {
  individual: "individual",
  group: "group",
} as const;

export interface CreatePlanDto {
  name: string;
  name_es?: string;
  description?: string;
  description_es?: string;
  /** @minimum 0 */
  price_monthly: number;
  /** @minimum 0 */
  price_yearly: number;
  subscription_type: CreatePlanDtoSubscriptionType;
  /**
   * null for Individual plans
   * @minimum 1
   */
  max_practitioners?: number;
  is_active?: boolean;
  features?: CreatePlanFeaturesDto;
}

export interface AdminPlanResponse {
  message: string;
  data: AdminPlanData;
}

export type UpdatePlanDtoSubscriptionType =
  (typeof UpdatePlanDtoSubscriptionType)[keyof typeof UpdatePlanDtoSubscriptionType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const UpdatePlanDtoSubscriptionType = {
  individual: "individual",
  group: "group",
} as const;

export interface UpdatePlanDto {
  name?: string;
  name_es?: string;
  description?: string;
  description_es?: string;
  /** @minimum 0 */
  price_monthly?: number;
  /** @minimum 0 */
  price_yearly?: number;
  subscription_type?: UpdatePlanDtoSubscriptionType;
  /**
   * null for Individual plans
   * @minimum 1
   */
  max_practitioners?: number;
  is_active?: boolean;
  features?: CreatePlanFeaturesDto;
}

export interface AdminPlanDeleteResponse {
  message: string;
}

export interface DocumentItem {
  uuid: string;
  title: string;
  description?: string;
  file_name: string;
  file_type: string;
  /** File size in bytes */
  file_size: number;
  /** ID of the user who uploaded; null for system documents */
  uploaded_by?: number;
  created_at?: string;
}

export interface DocumentListMeta {
  total: number;
  page: number;
  limit: number;
  totalPages: number;
}

export interface DocumentListResponse {
  data: DocumentItem[];
  meta: DocumentListMeta;
}

export interface UploadDocumentResponse {
  data: DocumentItem;
}

export type ApiLogsControllerGetLogsV1Params = {
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
  /**
   * Filter by HTTP status code e.g. 404, 500
   */
  status_code?: number;
  /**
   * Filter by HTTP method
   */
  method?: ApiLogsControllerGetLogsV1Method;
  /**
   * Filter by actor (user/admin) ID
   */
  actor_id?: number;
  /**
   * Filter from date (ISO 8601) e.g. 2026-01-01
   */
  date_from?: string;
  /**
   * Filter to date (ISO 8601) e.g. 2026-12-31
   */
  date_to?: string;
  /**
   * Filter by actor name (partial match)
   */
  actor_name?: string;
};

export type ApiLogsControllerGetLogsV1Method =
  (typeof ApiLogsControllerGetLogsV1Method)[keyof typeof ApiLogsControllerGetLogsV1Method];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ApiLogsControllerGetLogsV1Method = {
  GET: "GET",
  POST: "POST",
  PUT: "PUT",
  PATCH: "PATCH",
  DELETE: "DELETE",
} as const;
export type UploadProfilePhotoBody = {
  file?: Blob;
};

export type ProfileControllerUploadProfilePhotoV1Body = {
  file?: Blob;
};

export type SubscriptionControllerGetSubscriptionsV1Params = {
  /**
   * Search by user name or email
   */
  search?: string;
  sort_field?: SubscriptionControllerGetSubscriptionsV1SortField;
  sort_direction?: SubscriptionControllerGetSubscriptionsV1SortDirection;
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
  billing_cycle?: SubscriptionControllerGetSubscriptionsV1BillingCycle;
  status?: SubscriptionControllerGetSubscriptionsV1Status;
  role?: SubscriptionControllerGetSubscriptionsV1Role;
  /**
   * Filter by subscription type
   */
  subscription_type?: SubscriptionControllerGetSubscriptionsV1SubscriptionType;
};

export type SubscriptionControllerGetSubscriptionsV1SortField =
  (typeof SubscriptionControllerGetSubscriptionsV1SortField)[keyof typeof SubscriptionControllerGetSubscriptionsV1SortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionControllerGetSubscriptionsV1SortField = {
  created_at: "created_at",
  updated_at: "updated_at",
  renewal_date: "renewal_date",
  amount: "amount",
  status: "status",
  billing_cycle: "billing_cycle",
} as const;

export type SubscriptionControllerGetSubscriptionsV1SortDirection =
  (typeof SubscriptionControllerGetSubscriptionsV1SortDirection)[keyof typeof SubscriptionControllerGetSubscriptionsV1SortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionControllerGetSubscriptionsV1SortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type SubscriptionControllerGetSubscriptionsV1BillingCycle =
  (typeof SubscriptionControllerGetSubscriptionsV1BillingCycle)[keyof typeof SubscriptionControllerGetSubscriptionsV1BillingCycle];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionControllerGetSubscriptionsV1BillingCycle = {
  monthly: "monthly",
  yearly: "yearly",
  none: "none",
  one_time: "one_time",
} as const;

export type SubscriptionControllerGetSubscriptionsV1Status =
  (typeof SubscriptionControllerGetSubscriptionsV1Status)[keyof typeof SubscriptionControllerGetSubscriptionsV1Status];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionControllerGetSubscriptionsV1Status = {
  active: "active",
  cancelled: "cancelled",
  past_due: "past_due",
  incomplete: "incomplete",
  paused: "paused",
  expired: "expired",
} as const;

export type SubscriptionControllerGetSubscriptionsV1Role =
  (typeof SubscriptionControllerGetSubscriptionsV1Role)[keyof typeof SubscriptionControllerGetSubscriptionsV1Role];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionControllerGetSubscriptionsV1Role = {
  Practitioners: "Practitioners",
  Individuals: "Individuals",
} as const;

export type SubscriptionControllerGetSubscriptionsV1SubscriptionType =
  (typeof SubscriptionControllerGetSubscriptionsV1SubscriptionType)[keyof typeof SubscriptionControllerGetSubscriptionsV1SubscriptionType];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubscriptionControllerGetSubscriptionsV1SubscriptionType = {
  individual: "individual",
  group: "group",
} as const;

export type UserControllerGetUsersV1Params = {
  search?: string;
  sort_field?: UserControllerGetUsersV1SortField;
  sort_direction?: UserControllerGetUsersV1SortDirection;
  filters?: FilterDTO[];
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
};

export type UserControllerGetUsersV1SortField =
  (typeof UserControllerGetUsersV1SortField)[keyof typeof UserControllerGetUsersV1SortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const UserControllerGetUsersV1SortField = {
  created_at: "created_at",
  title: "title",
  slug: "slug",
  content: "content",
  updated_at: "updated_at",
} as const;

export type UserControllerGetUsersV1SortDirection =
  (typeof UserControllerGetUsersV1SortDirection)[keyof typeof UserControllerGetUsersV1SortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const UserControllerGetUsersV1SortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;
export type ContentPageControllerFindAllV1Params = {
  sort_field?: ContentPageControllerFindAllV1SortField;
  sort_direction?: ContentPageControllerFindAllV1SortDirection;
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
};

export type ContentPageControllerFindAllV1SortField =
  (typeof ContentPageControllerFindAllV1SortField)[keyof typeof ContentPageControllerFindAllV1SortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ContentPageControllerFindAllV1SortField = {
  created_at: "created_at",
  title: "title",
  slug: "slug",
  content: "content",
} as const;

export type ContentPageControllerFindAllV1SortDirection =
  (typeof ContentPageControllerFindAllV1SortDirection)[keyof typeof ContentPageControllerFindAllV1SortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ContentPageControllerFindAllV1SortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type PermissionsControllerFindAllV1Params = {
  search?: string;
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
  sort_field?: PermissionsControllerFindAllV1SortField;
  sort_direction?: PermissionsControllerFindAllV1SortDirection;
};

export type PermissionsControllerFindAllV1SortField =
  (typeof PermissionsControllerFindAllV1SortField)[keyof typeof PermissionsControllerFindAllV1SortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PermissionsControllerFindAllV1SortField = {
  created_at: "created_at",
  updated_at: "updated_at",
  name: "name",
} as const;

export type PermissionsControllerFindAllV1SortDirection =
  (typeof PermissionsControllerFindAllV1SortDirection)[keyof typeof PermissionsControllerFindAllV1SortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PermissionsControllerFindAllV1SortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type RolesControllerFindAllV1Params = {
  search?: string;
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
  sort_field?: RolesControllerFindAllV1SortField;
  sort_direction?: RolesControllerFindAllV1SortDirection;
};

export type RolesControllerFindAllV1SortField =
  (typeof RolesControllerFindAllV1SortField)[keyof typeof RolesControllerFindAllV1SortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const RolesControllerFindAllV1SortField = {
  created_at: "created_at",
  updated_at: "updated_at",
  name: "name",
} as const;

export type RolesControllerFindAllV1SortDirection =
  (typeof RolesControllerFindAllV1SortDirection)[keyof typeof RolesControllerFindAllV1SortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const RolesControllerFindAllV1SortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type SubAdminControllerFindAllV1Params = {
  search?: string;
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
  sort_field?: SubAdminControllerFindAllV1SortField;
  sort_direction?: SubAdminControllerFindAllV1SortDirection;
};

export type SubAdminControllerFindAllV1SortField =
  (typeof SubAdminControllerFindAllV1SortField)[keyof typeof SubAdminControllerFindAllV1SortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubAdminControllerFindAllV1SortField = {
  created_at: "created_at",
  updated_at: "updated_at",
  name: "name",
} as const;

export type SubAdminControllerFindAllV1SortDirection =
  (typeof SubAdminControllerFindAllV1SortDirection)[keyof typeof SubAdminControllerFindAllV1SortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SubAdminControllerFindAllV1SortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type PaymentControllerVerifyPaymentV1Params = {
  session_id: string;
};

export type GetBillingHistoryParams = {
  /**
   * Page number
   * @minimum 1
   */
  page?: number;
  /**
   * Number of items per page
   * @minimum 1
   */
  limit?: number;
  /**
   * Field to sort by
   */
  sort_field?: GetBillingHistorySortField;
  /**
   * Sort direction
   */
  sort_direction?: GetBillingHistorySortDirection;
};

export type GetBillingHistorySortField =
  (typeof GetBillingHistorySortField)[keyof typeof GetBillingHistorySortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GetBillingHistorySortField = {
  created_at: "created_at",
  paid_at: "paid_at",
  amount: "amount",
} as const;

export type GetBillingHistorySortDirection =
  (typeof GetBillingHistorySortDirection)[keyof typeof GetBillingHistorySortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GetBillingHistorySortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type DownloadInvoice200 = {
  url?: string;
};

export type GetScreeningsParams = {
  /**
   * Page number
   * @minimum 1
   */
  page?: number;
  /**
   * Number of items per page
   * @minimum 1
   */
  limit?: number;
  /**
   * Filter by status
   */
  status?: GetScreeningsStatus;
  /**
   * Field to sort by
   */
  sort_field?: GetScreeningsSortField;
  /**
   * Sort direction
   */
  sort_direction?: GetScreeningsSortDirection;
};

export type GetScreeningsStatus =
  (typeof GetScreeningsStatus)[keyof typeof GetScreeningsStatus];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GetScreeningsStatus = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
  paid: "paid",
} as const;

export type GetScreeningsSortField =
  (typeof GetScreeningsSortField)[keyof typeof GetScreeningsSortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GetScreeningsSortField = {
  created_at: "created_at",
  completed_at: "completed_at",
} as const;

export type GetScreeningsSortDirection =
  (typeof GetScreeningsSortDirection)[keyof typeof GetScreeningsSortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GetScreeningsSortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type DownloadReport200 = {
  url?: string;
};

export type ClientsControllerFindAllV1Params = {
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
  /**
   * Search by name, email, or phone
   */
  search?: string;
  /**
   * Sort by field: name, created_at, updated_at
   */
  sortBy?: string;
  /**
   * Sort order: ASC or DESC
   */
  sortOrder?: Object;
};

export type DashboardControllerGetClientScreeningsV1Params = {
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
  status?: DashboardControllerGetClientScreeningsV1Status;
  sortBy?: string;
  sortOrder?: DashboardControllerGetClientScreeningsV1SortOrder;
};

export type DashboardControllerGetClientScreeningsV1Status =
  (typeof DashboardControllerGetClientScreeningsV1Status)[keyof typeof DashboardControllerGetClientScreeningsV1Status];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const DashboardControllerGetClientScreeningsV1Status = {
  all: "all",
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
} as const;

export type DashboardControllerGetClientScreeningsV1SortOrder =
  (typeof DashboardControllerGetClientScreeningsV1SortOrder)[keyof typeof DashboardControllerGetClientScreeningsV1SortOrder];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const DashboardControllerGetClientScreeningsV1SortOrder = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type DashboardControllerDownloadScreeningPdfV1200 = {
  url?: string;
};

export type PractitionerDashboardControllerGetScreeningsChartV1Params = {
  /**
   * Chart data period
   */
  period?: PractitionerDashboardControllerGetScreeningsChartV1Period;
  /**
   * Year to fetch data for
   * @minimum 2020
   * @maximum 2100
   */
  year?: number;
};

export type PractitionerDashboardControllerGetScreeningsChartV1Period =
  (typeof PractitionerDashboardControllerGetScreeningsChartV1Period)[keyof typeof PractitionerDashboardControllerGetScreeningsChartV1Period];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PractitionerDashboardControllerGetScreeningsChartV1Period = {
  daily: "daily",
  weekly: "weekly",
  monthly: "monthly",
} as const;

export type PractitionerDashboardControllerGetClientsChartV1Params = {
  /**
   * Chart data period
   */
  period?: PractitionerDashboardControllerGetClientsChartV1Period;
  /**
   * Year to fetch data for
   * @minimum 2020
   * @maximum 2100
   */
  year?: number;
};

export type PractitionerDashboardControllerGetClientsChartV1Period =
  (typeof PractitionerDashboardControllerGetClientsChartV1Period)[keyof typeof PractitionerDashboardControllerGetClientsChartV1Period];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PractitionerDashboardControllerGetClientsChartV1Period = {
  daily: "daily",
  weekly: "weekly",
  monthly: "monthly",
} as const;

export type PractitionerDashboardControllerGetHighRiskCasesV1Params = {
  /**
   * Page number
   * @minimum 1
   */
  page?: number;
  /**
   * Items per page
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
};

export type PractitionerDashboardControllerGetPendingScreeningsV1Params = {
  /**
   * Page number
   * @minimum 1
   */
  page?: number;
  /**
   * Items per page
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
};

export type PractitionerDashboardControllerGetCompletedScreeningsV1Params = {
  /**
   * Page number
   * @minimum 1
   */
  page?: number;
  /**
   * Items per page
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
  /**
   * Filter by suicide risk level
   */
  risk_level?: PractitionerDashboardControllerGetCompletedScreeningsV1RiskLevel;
};

export type PractitionerDashboardControllerGetCompletedScreeningsV1RiskLevel =
  (typeof PractitionerDashboardControllerGetCompletedScreeningsV1RiskLevel)[keyof typeof PractitionerDashboardControllerGetCompletedScreeningsV1RiskLevel];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PractitionerDashboardControllerGetCompletedScreeningsV1RiskLevel =
  {
    low: "low",
    mild: "mild",
    moderate: "moderate",
    high: "high",
  } as const;

export type ProgressControllerCompareScreeningsV1Params = {
  /**
   * First screening ID to compare
   */
  screening1_id: number;
  /**
   * Second screening ID to compare
   */
  screening2_id: number;
};

export type AssessmentLinksControllerGetLinksV1Params = {
  /**
   * Page number
   * @minimum 1
   */
  page?: number;
  /**
   * Items per page
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
  /**
   * Filter by status
   */
  status?: AssessmentLinksControllerGetLinksV1Status;
};

export type AssessmentLinksControllerGetLinksV1Status =
  (typeof AssessmentLinksControllerGetLinksV1Status)[keyof typeof AssessmentLinksControllerGetLinksV1Status];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AssessmentLinksControllerGetLinksV1Status = {
  pending: "pending",
  in_progress: "in_progress",
  completed: "completed",
  expired: "expired",
} as const;

export type DashboardControllerGetEarningsChartV1Params = {
  /**
   * Chart period
   */
  period?: DashboardControllerGetEarningsChartV1Period;
  /**
   * Year for data
   * @minimum 2020
   */
  year?: number;
};

export type DashboardControllerGetEarningsChartV1Period =
  (typeof DashboardControllerGetEarningsChartV1Period)[keyof typeof DashboardControllerGetEarningsChartV1Period];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const DashboardControllerGetEarningsChartV1Period = {
  daily: "daily",
  weekly: "weekly",
  monthly: "monthly",
} as const;
export type TransactionControllerGetTransactionsV1Params = {
  /**
   * Search by user name or email
   */
  search?: string;
  /**
   * Filter by transaction source
   */
  source?: TransactionControllerGetTransactionsV1Source;
  /**
   * Inclusive lower bound on paid_at (ISO date)
   */
  date_from?: string;
  /**
   * Inclusive upper bound on paid_at (ISO date)
   */
  date_to?: string;
  sort_field?: TransactionControllerGetTransactionsV1SortField;
  sort_direction?: TransactionControllerGetTransactionsV1SortDirection;
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   * @maximum 500
   */
  limit?: number;
};

export type TransactionControllerGetTransactionsV1Source =
  (typeof TransactionControllerGetTransactionsV1Source)[keyof typeof TransactionControllerGetTransactionsV1Source];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const TransactionControllerGetTransactionsV1Source = {
  payment: "payment",
  subscription: "subscription",
} as const;

export type TransactionControllerGetTransactionsV1SortField =
  (typeof TransactionControllerGetTransactionsV1SortField)[keyof typeof TransactionControllerGetTransactionsV1SortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const TransactionControllerGetTransactionsV1SortField = {
  paid_at: "paid_at",
  amount: "amount",
} as const;

export type TransactionControllerGetTransactionsV1SortDirection =
  (typeof TransactionControllerGetTransactionsV1SortDirection)[keyof typeof TransactionControllerGetTransactionsV1SortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const TransactionControllerGetTransactionsV1SortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type LeadControllerGetLeadsV1Params = {
  /**
   * Search by name, email, or subject
   */
  search?: string;
  sort_field?: LeadControllerGetLeadsV1SortField;
  sort_direction?: LeadControllerGetLeadsV1SortDirection;
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
  status?: LeadControllerGetLeadsV1Status;
  /**
   * Filter by processed status
   */
  is_processed?: boolean;
};

export type LeadControllerGetLeadsV1SortField =
  (typeof LeadControllerGetLeadsV1SortField)[keyof typeof LeadControllerGetLeadsV1SortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const LeadControllerGetLeadsV1SortField = {
  created_at: "created_at",
  updated_at: "updated_at",
  name: "name",
  email: "email",
  subject: "subject",
  status: "status",
} as const;

export type LeadControllerGetLeadsV1SortDirection =
  (typeof LeadControllerGetLeadsV1SortDirection)[keyof typeof LeadControllerGetLeadsV1SortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const LeadControllerGetLeadsV1SortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type LeadControllerGetLeadsV1Status =
  (typeof LeadControllerGetLeadsV1Status)[keyof typeof LeadControllerGetLeadsV1Status];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const LeadControllerGetLeadsV1Status = {
  new: "new",
  contacted: "contacted",
  qualified: "qualified",
  converted: "converted",
  closed: "closed",
  processed: "processed",
  unprocessed: "unprocessed",
} as const;

export type SupportTicketControllerGetSupportTicketsV1Params = {
  /**
   * Search by ticket number, email, or subject
   */
  search?: string;
  sort_field?: SupportTicketControllerGetSupportTicketsV1SortField;
  sort_direction?: SupportTicketControllerGetSupportTicketsV1SortDirection;
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
  status?: SupportTicketControllerGetSupportTicketsV1Status;
  priority?: SupportTicketControllerGetSupportTicketsV1Priority;
};

export type SupportTicketControllerGetSupportTicketsV1SortField =
  (typeof SupportTicketControllerGetSupportTicketsV1SortField)[keyof typeof SupportTicketControllerGetSupportTicketsV1SortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SupportTicketControllerGetSupportTicketsV1SortField = {
  created_at: "created_at",
  updated_at: "updated_at",
  resolved_at: "resolved_at",
  status: "status",
  priority: "priority",
} as const;

export type SupportTicketControllerGetSupportTicketsV1SortDirection =
  (typeof SupportTicketControllerGetSupportTicketsV1SortDirection)[keyof typeof SupportTicketControllerGetSupportTicketsV1SortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SupportTicketControllerGetSupportTicketsV1SortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type SupportTicketControllerGetSupportTicketsV1Status =
  (typeof SupportTicketControllerGetSupportTicketsV1Status)[keyof typeof SupportTicketControllerGetSupportTicketsV1Status];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SupportTicketControllerGetSupportTicketsV1Status = {
  open: "open",
  in_progress: "in_progress",
  resolved: "resolved",
  closed: "closed",
} as const;

export type SupportTicketControllerGetSupportTicketsV1Priority =
  (typeof SupportTicketControllerGetSupportTicketsV1Priority)[keyof typeof SupportTicketControllerGetSupportTicketsV1Priority];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const SupportTicketControllerGetSupportTicketsV1Priority = {
  low: "low",
  medium: "medium",
  high: "high",
  urgent: "urgent",
} as const;

export type NotificationControllerGetNotificationsV1Params = {
  /**
   * Filter by notification type
   */
  type?: NotificationControllerGetNotificationsV1Type;
  /**
   * Filter by read status
   */
  is_read?: boolean;
  sort_field?: NotificationControllerGetNotificationsV1SortField;
  sort_direction?: NotificationControllerGetNotificationsV1SortDirection;
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   */
  limit?: number;
};

export type NotificationControllerGetNotificationsV1Type =
  (typeof NotificationControllerGetNotificationsV1Type)[keyof typeof NotificationControllerGetNotificationsV1Type];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NotificationControllerGetNotificationsV1Type = {
  lead: "lead",
  support: "support",
  user: "user",
  screening_complete: "screening_complete",
  client_added: "client_added",
  subscription: "subscription",
  system: "system",
} as const;

export type NotificationControllerGetNotificationsV1SortField =
  (typeof NotificationControllerGetNotificationsV1SortField)[keyof typeof NotificationControllerGetNotificationsV1SortField];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NotificationControllerGetNotificationsV1SortField = {
  created_at: "created_at",
} as const;

export type NotificationControllerGetNotificationsV1SortDirection =
  (typeof NotificationControllerGetNotificationsV1SortDirection)[keyof typeof NotificationControllerGetNotificationsV1SortDirection];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NotificationControllerGetNotificationsV1SortDirection = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type PMClientsControllerListClientsV1Params = {
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
  /**
   * Search by client name or email
   */
  search?: string;
  /**
   * Filter by therapist UUID
   */
  therapist?: string;
  sort_by?: PMClientsControllerListClientsV1SortBy;
  sort_order?: PMClientsControllerListClientsV1SortOrder;
};

export type PMClientsControllerListClientsV1SortBy =
  (typeof PMClientsControllerListClientsV1SortBy)[keyof typeof PMClientsControllerListClientsV1SortBy];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PMClientsControllerListClientsV1SortBy = {
  name: "name",
  email: "email",
  created_at: "created_at",
  age: "age",
} as const;

export type PMClientsControllerListClientsV1SortOrder =
  (typeof PMClientsControllerListClientsV1SortOrder)[keyof typeof PMClientsControllerListClientsV1SortOrder];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PMClientsControllerListClientsV1SortOrder = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type PMClientsControllerGetClientScreeningsV1Params = {
  page: number;
  limit: number;
};

export type DashboardControllerGetScreeningsChartV1Params = {
  /**
   * Chart data period
   */
  period?: DashboardControllerGetScreeningsChartV1Period;
  /**
   * Year to fetch data for
   * @minimum 2020
   * @maximum 2100
   */
  year?: number;
};

export type DashboardControllerGetScreeningsChartV1Period =
  (typeof DashboardControllerGetScreeningsChartV1Period)[keyof typeof DashboardControllerGetScreeningsChartV1Period];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const DashboardControllerGetScreeningsChartV1Period = {
  daily: "daily",
  weekly: "weekly",
  monthly: "monthly",
} as const;

export type DashboardControllerGetClientsChartV1Params = {
  /**
   * Chart data period
   */
  period?: DashboardControllerGetClientsChartV1Period;
  /**
   * Year to fetch data for
   * @minimum 2020
   * @maximum 2100
   */
  year?: number;
};

export type DashboardControllerGetClientsChartV1Period =
  (typeof DashboardControllerGetClientsChartV1Period)[keyof typeof DashboardControllerGetClientsChartV1Period];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const DashboardControllerGetClientsChartV1Period = {
  daily: "daily",
  weekly: "weekly",
  monthly: "monthly",
} as const;

export type DashboardControllerGetHighRiskCasesV1Params = {
  /**
   * Page number
   * @minimum 1
   */
  page?: number;
  /**
   * Items per page
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
};

export type DashboardControllerGetPendingScreeningsV1Params = {
  /**
   * Page number
   * @minimum 1
   */
  page?: number;
  /**
   * Items per page
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
};

export type DashboardControllerGetCompletedScreeningsV1Params = {
  /**
   * Page number
   * @minimum 1
   */
  page?: number;
  /**
   * Items per page
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
  /**
   * Filter by suicide risk level
   */
  risk_level?: DashboardControllerGetCompletedScreeningsV1RiskLevel;
};

export type DashboardControllerGetCompletedScreeningsV1RiskLevel =
  (typeof DashboardControllerGetCompletedScreeningsV1RiskLevel)[keyof typeof DashboardControllerGetCompletedScreeningsV1RiskLevel];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const DashboardControllerGetCompletedScreeningsV1RiskLevel = {
  low: "low",
  mild: "mild",
  moderate: "moderate",
  high: "high",
} as const;

export type TherapistsControllerListTherapistsV1Params = {
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
  search?: string;
  sort_by?: TherapistsControllerListTherapistsV1SortBy;
  sort_order?: TherapistsControllerListTherapistsV1SortOrder;
};

export type TherapistsControllerListTherapistsV1SortBy =
  (typeof TherapistsControllerListTherapistsV1SortBy)[keyof typeof TherapistsControllerListTherapistsV1SortBy];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const TherapistsControllerListTherapistsV1SortBy = {
  name: "name",
  email: "email",
  created_at: "created_at",
} as const;

export type TherapistsControllerListTherapistsV1SortOrder =
  (typeof TherapistsControllerListTherapistsV1SortOrder)[keyof typeof TherapistsControllerListTherapistsV1SortOrder];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const TherapistsControllerListTherapistsV1SortOrder = {
  ASC: "ASC",
  DESC: "DESC",
} as const;

export type PMScreeningControllerGetReportUrlV1200 = {
  url?: string;
};

export type PMNotificationControllerGetNotificationsV1Params = {
  /**
   * Page number
   * @minimum 1
   */
  page?: number;
  /**
   * Number of items per page
   * @minimum 1
   */
  limit?: number;
  /**
   * Filter by read status
   */
  is_read?: boolean;
  /**
   * Filter by notification type
   */
  type?: PMNotificationControllerGetNotificationsV1Type;
};

export type PMNotificationControllerGetNotificationsV1Type =
  (typeof PMNotificationControllerGetNotificationsV1Type)[keyof typeof PMNotificationControllerGetNotificationsV1Type];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const PMNotificationControllerGetNotificationsV1Type = {
  lead: "lead",
  support: "support",
  user: "user",
  screening_complete: "screening_complete",
  client_added: "client_added",
  subscription: "subscription",
  system: "system",
} as const;

export type DocumentsControllerListDocumentsV1Params = {
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
  /**
   * Search by title
   */
  search?: string;
  /**
   * Sort by field: title, created_at
   */
  sortBy?: string;
  /**
   * ASC or DESC
   */
  sortOrder?: Object;
};

export type DocumentsControllerGetDocumentUrlV1Params = {
  /**
   * JWT token as query param — use this with window.open() which cannot send headers
   */
  token?: unknown;
};

export type DocumentsControllerGetDocumentUrlV1200 = {
  url?: string;
};

export type AdminDocumentsControllerListDocumentsV1Params = {
  /**
   * @minimum 1
   */
  page?: number;
  /**
   * @minimum 1
   * @maximum 100
   */
  limit?: number;
  /**
   * Search by title
   */
  search?: string;
  /**
   * Sort by field: title, created_at
   */
  sortBy?: AdminDocumentsControllerListDocumentsV1SortBy;
  /**
   * ASC or DESC
   */
  sortOrder?: Object;
};

export type AdminDocumentsControllerListDocumentsV1SortBy =
  (typeof AdminDocumentsControllerListDocumentsV1SortBy)[keyof typeof AdminDocumentsControllerListDocumentsV1SortBy];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const AdminDocumentsControllerListDocumentsV1SortBy = {
  title: "title",
  created_at: "created_at",
} as const;

export type AdminDocumentsControllerUploadDocumentV1Body = {
  /** PDF or Word file (max 10 MB) */
  file: Blob;
  title: string;
  description?: string;
};

export type AdminDocumentsControllerUpdateDocumentV1Body = {
  /** Optional new file — replaces the existing one (PDF or Word, max 10 MB) */
  file?: Blob;
  title?: string;
  description?: string;
};

export type AdminDocumentsControllerGetDocumentUrlV1200 = {
  url?: string;
};

export type AdminBibliographyControllerListBibliographyV1200Item = {
  uuid?: string;
  citation?: string;
  /** @nullable */
  annotation?: string | null;
  /** @nullable */
  pdf_file_name?: string | null;
  /** @nullable */
  pdf_url?: string | null;
  /** @nullable */
  doi?: string | null;
  display_order?: number;
  is_active?: boolean;
  created_at?: string;
};

export type AdminBibliographyControllerCreateEntryV1Body = {
  /** Optional PDF file (max 10 MB) */
  file?: Blob;
  citation: string;
  annotation?: string;
  doi?: string;
  display_order?: number;
};

export type AdminBibliographyControllerUpdateEntryV1Body = {
  /** Optional new PDF — replaces the existing one (max 10 MB) */
  file?: Blob;
  citation?: string;
  annotation?: string;
  doi?: string;
  display_order?: number;
  is_active?: boolean;
};

export type AdminBibliographyControllerGetPdfUrlV1200 = {
  url?: string;
};

export type BibliographyControllerListBibliographyV1200Item = {
  id?: number;
  title?: string;
  authors?: string;
  year?: number;
  apa_citation?: string;
  annotation?: string;
  pdf_file_name?: string;
  pdf_url?: string;
  /** @nullable */
  doi?: string | null;
};
