/**
 * Generated by orval v8.23.0 🍺
 * Do not edit manually.
 * Api
 * API operativa de Y.E. Transport & Constructors
 * OpenAPI spec version: 1.0.0
 */
export interface PlatformRecord {
  id: string;
  createdAt?: string;
  updatedAt?: string;
  [key: string]: unknown;
 }

export interface PlatformRecordInput { [key: string]: unknown }

export interface HealthStatus {
  status: string;
}

export interface PublicOverview {
  companyName: string;
  tagline: string;
  location: string;
  serviceAreas: string[];
  fleetCount: number;
  activeProjects: number;
  /** @nullable */
  featuredImage?: string | null;
}

export interface PublicContent {[key: string]: string}

export type PublicEntryKind = typeof PublicEntryKind[keyof typeof PublicEntryKind];


export const PublicEntryKind = {
  showcase: 'showcase',
  post: 'post',
  legal: 'legal',
} as const;

export type PublicEntryStatus = typeof PublicEntryStatus[keyof typeof PublicEntryStatus];


export const PublicEntryStatus = {
  published: 'published',
  draft: 'draft',
  archived: 'archived',
} as const;

export type PublicEntryGalleryItem = {
  url: string;
  altEs: string;
  altEn: string;
};

export interface PublicEntry {
  id: string;
  kind: PublicEntryKind;
  slug: string;
  category: string;
  status: PublicEntryStatus;
  titleEs: string;
  titleEn: string;
  summaryEs: string;
  summaryEn: string;
  bodyEs: string;
  bodyEn: string;
  /** @nullable */
  imageUrl?: string | null;
  imageAltEs: string;
  imageAltEn: string;
  gallery: PublicEntryGalleryItem[];
  seoTitleEs: string;
  seoTitleEn: string;
  seoDescriptionEs: string;
  seoDescriptionEn: string;
  published: boolean;
  featured: boolean;
  sortOrder: number;
  createdAt?: string;
  updatedAt?: string;
}

export type PublicEntryInputKind = typeof PublicEntryInputKind[keyof typeof PublicEntryInputKind];


export const PublicEntryInputKind = {
  showcase: 'showcase',
  post: 'post',
  legal: 'legal',
} as const;

export type PublicEntryInputStatus = typeof PublicEntryInputStatus[keyof typeof PublicEntryInputStatus];


export const PublicEntryInputStatus = {
  published: 'published',
  draft: 'draft',
  archived: 'archived',
} as const;

export type PublicEntryInputGalleryItem = {
  url: string;
  altEs: string;
  altEn: string;
};

export interface PublicEntryInput {
  kind: PublicEntryInputKind;
  /** @minLength 1 */
  slug: string;
  /** @minLength 1 */
  category: string;
  status?: PublicEntryInputStatus;
  /** @minLength 1 */
  titleEs: string;
  /** @minLength 1 */
  titleEn: string;
  summaryEs?: string;
  summaryEn?: string;
  bodyEs?: string;
  bodyEn?: string;
  imageUrl?: string;
  imageAltEs?: string;
  imageAltEn?: string;
  gallery?: PublicEntryInputGalleryItem[];
  seoTitleEs?: string;
  seoTitleEn?: string;
  seoDescriptionEs?: string;
  seoDescriptionEn?: string;
  published?: boolean;
  featured?: boolean;
  sortOrder?: number;
}

export type PublicEntryUpdateKind = typeof PublicEntryUpdateKind[keyof typeof PublicEntryUpdateKind];


export const PublicEntryUpdateKind = {
  showcase: 'showcase',
  post: 'post',
  legal: 'legal',
} as const;

export type PublicEntryUpdateStatus = typeof PublicEntryUpdateStatus[keyof typeof PublicEntryUpdateStatus];


export const PublicEntryUpdateStatus = {
  published: 'published',
  draft: 'draft',
  archived: 'archived',
} as const;

export type PublicEntryUpdateGalleryItem = {
  url: string;
  altEs: string;
  altEn: string;
};

export interface PublicEntryUpdate {
  kind?: PublicEntryUpdateKind;
  /** @minLength 1 */
  slug?: string;
  category?: string;
  status?: PublicEntryUpdateStatus;
  /** @minLength 1 */
  titleEs?: string;
  /** @minLength 1 */
  titleEn?: string;
  summaryEs?: string;
  summaryEn?: string;
  bodyEs?: string;
  bodyEn?: string;
  /** @nullable */
  imageUrl?: string | null;
  imageAltEs?: string;
  imageAltEn?: string;
  gallery?: PublicEntryUpdateGalleryItem[];
  seoTitleEs?: string;
  seoTitleEn?: string;
  seoDescriptionEs?: string;
  seoDescriptionEn?: string;
  published?: boolean;
  featured?: boolean;
  sortOrder?: number;
}

export type CurrentUserRole = typeof CurrentUserRole[keyof typeof CurrentUserRole];


export const CurrentUserRole = {
  Web_Master: 'Web Master',
  super_admin: 'super_admin',
  admin: 'admin',
  hr: 'hr',
  secretary: 'secretary',
  accounting: 'accounting',
  supervisor: 'supervisor',
  employee: 'employee',
} as const;

export interface CurrentUser {
  id: string;
  name: string;
  email: string;
  role: CurrentUserRole;
  initials?: string;
  permissions?: string[];
}

export type MobileUserRole = typeof MobileUserRole[keyof typeof MobileUserRole];


export const MobileUserRole = {
  Web_Master: 'Web Master',
  super_admin: 'super_admin',
  admin: 'admin',
  hr: 'hr',
  secretary: 'secretary',
  accounting: 'accounting',
  supervisor: 'supervisor',
  employee: 'employee',
} as const;

export interface MobileUser {
  id: string;
  name: string;
  role: MobileUserRole;
  initials?: string;
  permissions?: string[];
}

export type LoginInputClient = typeof LoginInputClient[keyof typeof LoginInputClient];


export const LoginInputClient = {
  web: 'web',
  mobile: 'mobile',
} as const;

export interface AdminSecondFactorInput {
  challengeId?: string;
  /**
     * @minLength 1
     * @maxLength 128
     */
  code?: string;
}

export interface LoginInput {
  email: string;
  /** @minLength 8 */
  password: string;
  client?: LoginInputClient;
  secondFactor?: AdminSecondFactorInput;
}

export type AuthSecondFactorRequiredResponseMethod = typeof AuthSecondFactorRequiredResponseMethod[keyof typeof AuthSecondFactorRequiredResponseMethod];


export const AuthSecondFactorRequiredResponseMethod = {
  daily_code: 'daily_code',
  simple_math: 'simple_math',
  captcha: 'captcha',
} as const;

export interface AuthSecondFactorRequiredResponse {
  requiresSecondFactor: true;
  method: AuthSecondFactorRequiredResponseMethod;
  challengeId: string;
  challenge?: string;
  expiresAt: string;
}

export interface AdminSecondFactorCodeIssued {
  challengeId: string;
  /**
     * @minLength 6
     * @maxLength 32
     */
  code: string;
  expiresAt: string;
  shownOnce: true;
}

export type MobileLoginInputPlatform = typeof MobileLoginInputPlatform[keyof typeof MobileLoginInputPlatform];


export const MobileLoginInputPlatform = {
  ios: 'ios',
  android: 'android',
} as const;

export interface MobileLoginInput {
  /**
     * Código aleatorio emitido por personal corporativo; nunca es un correo, SSN de 9 dígitos ni una secuencia débil.
     * @minLength 6
     * @maxLength 20
     * @pattern ^[A-Za-z0-9_-]+$
     */
  employeeCode: string;
  /**
     * @minLength 16
     * @maxLength 255
     */
  installationId: string;
  /**
     * Requerida al volver a iniciar sesión con un dispositivo ya enrolado y aprobado.
     * @minLength 32
     * @maxLength 255
     */
  deviceCredential?: string;
  platform: MobileLoginInputPlatform;
  /** @maxLength 190 */
  model?: string;
  /** @maxLength 80 */
  osVersion?: string;
  /** @maxLength 80 */
  appVersion?: string;
}

export type DeviceStatusStatus = typeof DeviceStatusStatus[keyof typeof DeviceStatusStatus];


export const DeviceStatusStatus = {
  pending: 'pending',
  approved: 'approved',
  revoked: 'revoked',
  replaced: 'replaced',
  rejected: 'rejected',
} as const;

export type DeviceStatusPlatform = typeof DeviceStatusPlatform[keyof typeof DeviceStatusPlatform];


export const DeviceStatusPlatform = {
  ios: 'ios',
  android: 'android',
} as const;

export interface DeviceStatus {
  id: string;
  status: DeviceStatusStatus;
  platform: DeviceStatusPlatform;
  /** @nullable */
  model?: string | null;
  /** @nullable */
  osVersion?: string | null;
  /** @nullable */
  appVersion?: string | null;
  /** @nullable */
  approvedAt?: string | null;
  /** @nullable */
  revokedAt?: string | null;
  /** @nullable */
  lastActivity?: string | null;
}

export interface MobileLoginResponse {
  user: MobileUser;
  /** Credencial de sesión opaca; nunca se almacena sin hash. */
  token: string;
  device: DeviceStatus;
  /** Credencial opaca de dispositivo mostrada únicamente durante el primer registro. */
  deviceCredential?: string;
}

export interface MobileCredentialIssueInput {
  /**
     * Opcional; si se omite se genera un código aleatorio de 12 a 20 caracteres. Rechaza SSN y secuencias débiles.
     * @minLength 6
     * @maxLength 20
     * @pattern ^[A-Za-z0-9_-]+$
     */
  employeeCode?: string;
}

export interface MobileCredentialIssued {
  credentialId: string;
  /**
     * @minLength 6
     * @maxLength 20
     */
  employeeCode: string;
  shownOnce: true;
}

export type DeviceRegistrationInputPlatform = typeof DeviceRegistrationInputPlatform[keyof typeof DeviceRegistrationInputPlatform];


export const DeviceRegistrationInputPlatform = {
  ios: 'ios',
  android: 'android',
} as const;

export interface DeviceRegistrationInput {
  /**
     * @minLength 16
     * @maxLength 255
     */
  installationId: string;
  platform: DeviceRegistrationInputPlatform;
  /** @maxLength 190 */
  model?: string;
  /** @maxLength 80 */
  osVersion?: string;
  /** @maxLength 80 */
  appVersion?: string;
}

export interface DeviceDecisionInput {
  /**
     * @minLength 3
     * @maxLength 500
     */
  reason?: string;
  replace?: boolean;
}

export type ProjectQrResourceStatus = typeof ProjectQrResourceStatus[keyof typeof ProjectQrResourceStatus];


export const ProjectQrResourceStatus = {
  active: 'active',
  revoked: 'revoked',
  rotated: 'rotated',
} as const;

export interface ProjectQrResource {
  id: string;
  projectId: string;
  /** @nullable */
  worksiteId?: string | null;
  keyVersion: string;
  status: ProjectQrResourceStatus;
  /** True only for authorized corporate users; never available to employee or supervisor mobile roles. */
  printable: boolean;
  /** @nullable */
  printUrl?: string | null;
}

export type QrDisplayChallengeWatermarkMetadata = {
  seed: string;
  /** @minimum 100 */
  frameIntervalMs: number;
};

export interface QrDisplayChallenge {
  /** Opaque signed challenge payload */
  challenge: string;
  /** Server signature */
  signature: string;
  projectId: string;
  worksiteId: string;
  displaySessionId: string;
  keyVersion: string;
  issuedAt: string;
  expiresAt: string;
  watermarkMetadata: QrDisplayChallengeWatermarkMetadata;
}

export type AttendanceScanInputAction = typeof AttendanceScanInputAction[keyof typeof AttendanceScanInputAction];


export const AttendanceScanInputAction = {
  check_in: 'check_in',
  check_out: 'check_out',
} as const;

export type AttendanceScanInputPlatform = typeof AttendanceScanInputPlatform[keyof typeof AttendanceScanInputPlatform];


export const AttendanceScanInputPlatform = {
  ios: 'ios',
  android: 'android',
} as const;

export interface AttendanceScanInput {
  challenge: string;
  signature: string;
  action: AttendanceScanInputAction;
  /**
     * @minimum -90
     * @maximum 90
     */
  latitude: number;
  /**
     * @minimum -180
     * @maximum 180
     */
  longitude: number;
  platform: AttendanceScanInputPlatform;
  /** @minLength 32 */
  deviceCredential: string;
  clientTime?: string;
}

export type AttendanceScanResultStatus = typeof AttendanceScanResultStatus[keyof typeof AttendanceScanResultStatus];


export const AttendanceScanResultStatus = {
  accepted: 'accepted',
  rejected: 'rejected',
  pending: 'pending',
} as const;

export interface AttendanceScanResult {
  attendanceId: string;
  status: AttendanceScanResultStatus;
  serverTime: string;
  /**
     * @minimum 0
     * @maximum 100
     */
  riskScore: number;
  /** @nullable */
  reason?: string | null;
}

export type SecurityAttemptResult = typeof SecurityAttemptResult[keyof typeof SecurityAttemptResult];


export const SecurityAttemptResult = {
  accepted: 'accepted',
  rejected: 'rejected',
  pending: 'pending',
} as const;

export interface SecurityAttempt {
  id: string;
  /** @nullable */
  employeeId?: string | null;
  /** @nullable */
  employeeNumber?: string | null;
  /** @nullable */
  projectId?: string | null;
  /** @nullable */
  worksiteId?: string | null;
  /** @nullable */
  deviceId?: string | null;
  /** @nullable */
  platform?: string | null;
  result: SecurityAttemptResult;
  reason: string;
  /** @nullable */
  latitude?: number | null;
  /** @nullable */
  longitude?: number | null;
  /**
     * @minimum 0
     * @maximum 100
     */
  riskScore: number;
  createdAt: string;
}

export interface WorksiteSecurityConfig {
  /**
     * @minimum -90
     * @maximum 90
     */
  latitude: number;
  /**
     * @minimum -180
     * @maximum 180
     */
  longitude: number;
  /**
     * @minimum 25
     * @maximum 5000
     */
  geofenceRadiusMeters: number;
  /**
     * @nullable
     * @pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$
     */
  scheduleStart?: string | null;
  /**
     * @nullable
     * @pattern ^([01][0-9]|2[0-3]):[0-5][0-9]$
     */
  scheduleEnd?: string | null;
  /**
     * @minimum 0
     * @maximum 180
     */
  scheduleGraceMinutes: number;
  qrDisplayAuthorized?: boolean;
}

export interface AuthLoginResponse {
  user: CurrentUser;
  /** Opaque bearer token, returned only for mobile clients. */
  token?: string;
  /** CSRF token for web state-changing requests. */
  csrfToken?: string;
}

export type EmployeeStatus = typeof EmployeeStatus[keyof typeof EmployeeStatus];


export const EmployeeStatus = {
  active: 'active',
  on_leave: 'on_leave',
  inactive: 'inactive',
} as const;

export type EmployeeEmploymentType = typeof EmployeeEmploymentType[keyof typeof EmployeeEmploymentType];


export const EmployeeEmploymentType = {
  full_time: 'full_time',
  part_time: 'part_time',
  contractor: 'contractor',
} as const;

export type EmployeeEmergencyContactsItem = {
  name: string;
  relationship: string;
  phone: string;
};

export interface Employee {
  id: string;
  employeeNumber: string;
  name: string;
  role: string;
  phone: string;
  status: EmployeeStatus;
  /** @nullable */
  assignedWorksite: string | null;
  hireDate?: string;
  profileImage: string;
  department: string;
  position: string;
  email: string;
  address: string;
  emergencyContacts: EmployeeEmergencyContactsItem[];
  employmentType: EmployeeEmploymentType;
  appAccess: boolean;
  readOnly: boolean;
  /** @nullable */
  userId?: string | null;
}

export type WorksiteStatus = typeof WorksiteStatus[keyof typeof WorksiteStatus];


export const WorksiteStatus = {
  active: 'active',
  paused: 'paused',
  complete: 'complete',
} as const;

export interface Worksite {
  id: string;
  projectId: string;
  projectNumber: string;
  name: string;
  address: string;
  status: WorksiteStatus;
  areasCount: number;
  /** @nullable */
  supervisorName?: string | null;
}

export type AttendanceRecordAction = typeof AttendanceRecordAction[keyof typeof AttendanceRecordAction];


export const AttendanceRecordAction = {
  check_in: 'check_in',
  check_out: 'check_out',
} as const;

export type AttendanceRecordValidation = {[key: string]: boolean};

export interface AttendanceRecord {
  id: string;
  employeeName: string;
  employeeNumber: string;
  worksiteName: string;
  action: AttendanceRecordAction;
  capturedAt: string;
  validation: AttendanceRecordValidation;
}

export type SecurityEventSeverity = typeof SecurityEventSeverity[keyof typeof SecurityEventSeverity];


export const SecurityEventSeverity = {
  info: 'info',
  warning: 'warning',
  critical: 'critical',
} as const;

export interface SecurityEvent {
  id: string;
  type: string;
  message: string;
  severity: SecurityEventSeverity;
  /** @nullable */
  worksiteName?: string | null;
  createdAt: string;
  resolved: boolean;
}

export interface SupervisorSummary {
  employees: Employee[];
  worksites: Worksite[];
  attendance: AttendanceRecord[];
  alerts: PlatformRecord[];
  securityEvents: SecurityEvent[];
  leaveRequests: PlatformRecord[];
}

export type SupervisorAttendanceCorrectionAction = typeof SupervisorAttendanceCorrectionAction[keyof typeof SupervisorAttendanceCorrectionAction];


export const SupervisorAttendanceCorrectionAction = {
  check_in: 'check_in',
  check_out: 'check_out',
} as const;

export interface SupervisorAttendanceCorrection {
  action?: SupervisorAttendanceCorrectionAction;
  capturedAt?: string;
  /** @nullable */
  worksiteId?: string | null;
}

export type SupervisorLeaveReviewStatus = typeof SupervisorLeaveReviewStatus[keyof typeof SupervisorLeaveReviewStatus];


export const SupervisorLeaveReviewStatus = {
  approved: 'approved',
  denied: 'denied',
} as const;

export interface SupervisorLeaveReview {
  status: SupervisorLeaveReviewStatus;
}

export interface CsrfResponse {
  csrfToken: string;
}

export type ActivityItemSeverity = typeof ActivityItemSeverity[keyof typeof ActivityItemSeverity];


export const ActivityItemSeverity = {
  info: 'info',
  warning: 'warning',
  critical: 'critical',
} as const;

export interface ActivityItem {
  id: string;
  action: string;
  actor: string;
  timestamp: string;
  severity: ActivityItemSeverity;
}

export interface DashboardSummary {
  activeProjects: number;
  activeWorksites: number;
  openQuotes: number;
  fleetAvailable: number;
  checkedInToday: number;
  securityEvents: number;
  maintenanceDue: number;
  recentActivity: ActivityItem[];
}

export type QuoteStatus = typeof QuoteStatus[keyof typeof QuoteStatus];


export const QuoteStatus = {
  new: 'new',
  reviewing: 'reviewing',
  sent: 'sent',
  approved: 'approved',
  declined: 'declined',
  archived: 'archived',
} as const;

export type QuotePriority = typeof QuotePriority[keyof typeof QuotePriority];


export const QuotePriority = {
  low: 'low',
  normal: 'normal',
  high: 'high',
} as const;

export interface Quote {
  id: string;
  quoteNumber: string;
  clientName: string;
  /** @nullable */
  company?: string | null;
  email?: string;
  /** @nullable */
  phone?: string | null;
  service: string;
  message?: string;
  status: QuoteStatus;
  /** @nullable */
  amount?: number | null;
  priority: QuotePriority;
  createdAt: string;
  updatedAt?: string;
}

export type QuoteInputPriority = typeof QuoteInputPriority[keyof typeof QuoteInputPriority];


export const QuoteInputPriority = {
  low: 'low',
  normal: 'normal',
  high: 'high',
} as const;

export interface QuoteInput {
  /** @minLength 2 */
  clientName: string;
  company?: string;
  email: string;
  phone?: string;
  service: string;
  /** @minLength 10 */
  message: string;
  priority?: QuoteInputPriority;
  amount?: number;
}

export type QuoteUpdateStatus = typeof QuoteUpdateStatus[keyof typeof QuoteUpdateStatus];


export const QuoteUpdateStatus = {
  new: 'new',
  reviewing: 'reviewing',
  sent: 'sent',
  approved: 'approved',
  declined: 'declined',
  archived: 'archived',
} as const;

export type QuoteUpdatePriority = typeof QuoteUpdatePriority[keyof typeof QuoteUpdatePriority];


export const QuoteUpdatePriority = {
  low: 'low',
  normal: 'normal',
  high: 'high',
} as const;

export interface QuoteUpdate {
  status?: QuoteUpdateStatus;
  priority?: QuoteUpdatePriority;
  amount?: number;
  message?: string;
}

export interface ContactInput {
  /** @minLength 2 */
  name: string;
  email: string;
  phone?: string;
  /** @minLength 5 */
  message: string;
}

export interface LeadReceipt {
  id: string;
  receivedAt: string;
}

export type ClientStatus = typeof ClientStatus[keyof typeof ClientStatus];


export const ClientStatus = {
  active: 'active',
  prospect: 'prospect',
  inactive: 'inactive',
} as const;

export interface Client {
  id: string;
  name: string;
  company: string;
  email: string;
  phone: string;
  status: ClientStatus;
  projectsCount: number;
  createdAt: string;
}

export type ClientInputStatus = typeof ClientInputStatus[keyof typeof ClientInputStatus];


export const ClientInputStatus = {
  active: 'active',
  prospect: 'prospect',
  inactive: 'inactive',
} as const;

export interface ClientInput {
  name: string;
  company: string;
  email: string;
  phone: string;
  status?: ClientInputStatus;
}

export type ClientUpdateStatus = typeof ClientUpdateStatus[keyof typeof ClientUpdateStatus];


export const ClientUpdateStatus = {
  active: 'active',
  prospect: 'prospect',
  inactive: 'inactive',
} as const;

export interface ClientUpdate {
  name?: string;
  company?: string;
  email?: string;
  phone?: string;
  status?: ClientUpdateStatus;
}

export type ProjectStatus = typeof ProjectStatus[keyof typeof ProjectStatus];


export const ProjectStatus = {
  planning: 'planning',
  active: 'active',
  paused: 'paused',
  complete: 'complete',
  archived: 'archived',
} as const;

export interface Project {
  id: string;
  projectNumber: string;
  name: string;
  status: ProjectStatus;
  address: string;
  clientName: string;
  worksitesCount: number;
  /**
     * @minimum 0
     * @maximum 100
     */
  progress: number;
  updatedAt: string;
}

export type ProjectInputStatus = typeof ProjectInputStatus[keyof typeof ProjectInputStatus];


export const ProjectInputStatus = {
  planning: 'planning',
  active: 'active',
  paused: 'paused',
  complete: 'complete',
  archived: 'archived',
} as const;

export interface ProjectInput {
  projectNumber: string;
  name: string;
  address: string;
  clientId?: string;
  status?: ProjectInputStatus;
  /**
     * @minimum 0
     * @maximum 100
     */
  progress?: number;
}

export type ProjectUpdateStatus = typeof ProjectUpdateStatus[keyof typeof ProjectUpdateStatus];


export const ProjectUpdateStatus = {
  planning: 'planning',
  active: 'active',
  paused: 'paused',
  complete: 'complete',
  archived: 'archived',
} as const;

export interface ProjectUpdate {
  name?: string;
  address?: string;
  clientId?: string;
  status?: ProjectUpdateStatus;
  /**
     * @minimum 0
     * @maximum 100
     */
  progress?: number;
}

export type ProjectDetail = Project & {
  worksites: Worksite[];
};

export type WorksiteInputStatus = typeof WorksiteInputStatus[keyof typeof WorksiteInputStatus];


export const WorksiteInputStatus = {
  active: 'active',
  paused: 'paused',
  complete: 'complete',
} as const;

export interface WorksiteInput {
  projectId: string;
  name: string;
  address: string;
  status?: WorksiteInputStatus;
  supervisorId?: string;
}

export type WorksiteUpdateStatus = typeof WorksiteUpdateStatus[keyof typeof WorksiteUpdateStatus];


export const WorksiteUpdateStatus = {
  active: 'active',
  paused: 'paused',
  complete: 'complete',
} as const;

export interface WorksiteUpdate {
  name?: string;
  address?: string;
  status?: WorksiteUpdateStatus;
  supervisorId?: string;
}

export type EquipmentStatus = typeof EquipmentStatus[keyof typeof EquipmentStatus];


export const EquipmentStatus = {
  available: 'available',
  rented: 'rented',
  maintenance: 'maintenance',
  inactive: 'inactive',
} as const;

export interface Equipment {
  id: string;
  assetNumber: string;
  name: string;
  category: string;
  status: EquipmentStatus;
  location: string;
  nextMaintenance: string;
  /** @nullable */
  hourlyRate?: number | null;
}

export type EquipmentInputStatus = typeof EquipmentInputStatus[keyof typeof EquipmentInputStatus];


export const EquipmentInputStatus = {
  available: 'available',
  rented: 'rented',
  maintenance: 'maintenance',
  inactive: 'inactive',
} as const;

export interface EquipmentInput {
  assetNumber: string;
  name: string;
  category: string;
  location: string;
  status?: EquipmentInputStatus;
  nextMaintenance?: string;
  hourlyRate?: number;
}

export type EquipmentUpdateStatus = typeof EquipmentUpdateStatus[keyof typeof EquipmentUpdateStatus];


export const EquipmentUpdateStatus = {
  available: 'available',
  rented: 'rented',
  maintenance: 'maintenance',
  inactive: 'inactive',
} as const;

export interface EquipmentUpdate {
  name?: string;
  category?: string;
  location?: string;
  status?: EquipmentUpdateStatus;
  nextMaintenance?: string;
  hourlyRate?: number;
}

export type MaterialStatus = typeof MaterialStatus[keyof typeof MaterialStatus];


export const MaterialStatus = {
  in_stock: 'in_stock',
  low: 'low',
  out_of_stock: 'out_of_stock',
} as const;

export interface Material {
  id: string;
  sku: string;
  name: string;
  category: string;
  stock: number;
  unit: string;
  reorderLevel: number;
  status: MaterialStatus;
}

export interface MaterialInput {
  sku: string;
  name: string;
  category: string;
  stock: number;
  unit: string;
  reorderLevel: number;
}

export interface MaterialUpdate {
  name?: string;
  category?: string;
  stock?: number;
  unit?: string;
  reorderLevel?: number;
}

export type EmployeeInputStatus = typeof EmployeeInputStatus[keyof typeof EmployeeInputStatus];


export const EmployeeInputStatus = {
  active: 'active',
  on_leave: 'on_leave',
  inactive: 'inactive',
} as const;

export type EmployeeInputEmergencyContactsItem = {
  name: string;
  relationship: string;
  phone: string;
};

export type EmployeeInputEmploymentType = typeof EmployeeInputEmploymentType[keyof typeof EmployeeInputEmploymentType];


export const EmployeeInputEmploymentType = {
  full_time: 'full_time',
  part_time: 'part_time',
  contractor: 'contractor',
} as const;

export interface EmployeeInput {
  employeeNumber: string;
  name: string;
  role: string;
  phone: string;
  status?: EmployeeInputStatus;
  assignedWorksite?: string;
  hireDate?: string;
  profileImage?: string;
  department: string;
  position: string;
  email: string;
  address: string;
  emergencyContacts?: EmployeeInputEmergencyContactsItem[];
  employmentType: EmployeeInputEmploymentType;
  appAccess?: boolean;
  readOnly?: boolean;
  userId?: string;
}

export type EmployeeUpdateStatus = typeof EmployeeUpdateStatus[keyof typeof EmployeeUpdateStatus];


export const EmployeeUpdateStatus = {
  active: 'active',
  on_leave: 'on_leave',
  inactive: 'inactive',
} as const;

export type EmployeeUpdateEmergencyContactsItem = {
  name: string;
  relationship: string;
  phone: string;
};

export type EmployeeUpdateEmploymentType = typeof EmployeeUpdateEmploymentType[keyof typeof EmployeeUpdateEmploymentType];


export const EmployeeUpdateEmploymentType = {
  full_time: 'full_time',
  part_time: 'part_time',
  contractor: 'contractor',
} as const;

export interface EmployeeUpdate {
  name?: string;
  role?: string;
  phone?: string;
  status?: EmployeeUpdateStatus;
  assignedWorksite?: string;
  profileImage?: string;
  department?: string;
  position?: string;
  email?: string;
  address?: string;
  emergencyContacts?: EmployeeUpdateEmergencyContactsItem[];
  employmentType?: EmployeeUpdateEmploymentType;
  appAccess?: boolean;
  readOnly?: boolean;
  userId?: string;
}

export type AttendanceInputAction = typeof AttendanceInputAction[keyof typeof AttendanceInputAction];


export const AttendanceInputAction = {
  check_in: 'check_in',
  check_out: 'check_out',
} as const;

export interface AttendanceInput {
  employeeId: string;
  worksiteId: string;
  deviceId?: string;
  qrToken?: string;
  latitude?: number;
  longitude?: number;
  capturedAt: string;
  action: AttendanceInputAction;
}

export type PolicyStatus = typeof PolicyStatus[keyof typeof PolicyStatus];


export const PolicyStatus = {
  published: 'published',
  draft: 'draft',
  archived: 'archived',
} as const;

export interface Policy {
  id: string;
  title: string;
  version: string;
  summary: string;
  category: string;
  status: PolicyStatus;
  updatedAt: string;
  requiredAcceptance: boolean;
}

export type PolicyInputStatus = typeof PolicyInputStatus[keyof typeof PolicyInputStatus];


export const PolicyInputStatus = {
  published: 'published',
  draft: 'draft',
  archived: 'archived',
} as const;

export interface PolicyInput {
  title: string;
  version: string;
  summary: string;
  category: string;
  status?: PolicyInputStatus;
  requiredAcceptance?: boolean;
}

export type PolicyUpdateStatus = typeof PolicyUpdateStatus[keyof typeof PolicyUpdateStatus];


export const PolicyUpdateStatus = {
  published: 'published',
  draft: 'draft',
  archived: 'archived',
} as const;

export interface PolicyUpdate {
  title?: string;
  version?: string;
  summary?: string;
  category?: string;
  status?: PolicyUpdateStatus;
  requiredAcceptance?: boolean;
}

export type DocumentStatus = typeof DocumentStatus[keyof typeof DocumentStatus];


export const DocumentStatus = {
  current: 'current',
  expiring: 'expiring',
  expired: 'expired',
  archived: 'archived',
} as const;

export interface Document {
  id: string;
  name: string;
  category: string;
  status: DocumentStatus;
  owner: string;
  /** @nullable */
  expiresAt?: string | null;
  /** @nullable */
  fileUrl?: string | null;
  updatedAt: string;
}

export type DocumentInputStatus = typeof DocumentInputStatus[keyof typeof DocumentInputStatus];


export const DocumentInputStatus = {
  current: 'current',
  expiring: 'expiring',
  expired: 'expired',
  archived: 'archived',
} as const;

export interface DocumentInput {
  name: string;
  category: string;
  owner: string;
  status?: DocumentInputStatus;
  expiresAt?: string;
  fileUrl?: string;
}

export type DocumentUpdateStatus = typeof DocumentUpdateStatus[keyof typeof DocumentUpdateStatus];


export const DocumentUpdateStatus = {
  current: 'current',
  expiring: 'expiring',
  expired: 'expired',
  archived: 'archived',
} as const;

export interface DocumentUpdate {
  name?: string;
  category?: string;
  owner?: string;
  status?: DocumentUpdateStatus;
  expiresAt?: string;
  fileUrl?: string;
}

export type SettingsDefaultLanguage = typeof SettingsDefaultLanguage[keyof typeof SettingsDefaultLanguage];


export const SettingsDefaultLanguage = {
  es: 'es',
  en: 'en',
} as const;

export type SettingsSiteContent = {[key: string]: string};

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

export type SettingsAdminSecondFactorMethod = typeof SettingsAdminSecondFactorMethod[keyof typeof SettingsAdminSecondFactorMethod];


export const SettingsAdminSecondFactorMethod = {
  daily_code: 'daily_code',
  simple_math: 'simple_math',
  captcha: 'captcha',
} as const;

export interface Settings {
  companyName: string;
  legalName: string;
  phone: string;
  email: string;
  address: string;
  defaultLanguage: SettingsDefaultLanguage;
  quoteNotificationEmail?: string;
  siteContent: SettingsSiteContent;
  integrationSettings: SettingsIntegrationSettings;
  adminSecondFactorEnabled: boolean;
  adminSecondFactorMethod: SettingsAdminSecondFactorMethod;
}

export type SettingsUpdateDefaultLanguage = typeof SettingsUpdateDefaultLanguage[keyof typeof SettingsUpdateDefaultLanguage];


export const SettingsUpdateDefaultLanguage = {
  es: 'es',
  en: 'en',
} as const;

export type SettingsUpdateSiteContent = {[key: string]: string};

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

export type SettingsUpdateAdminSecondFactorMethod = typeof SettingsUpdateAdminSecondFactorMethod[keyof typeof SettingsUpdateAdminSecondFactorMethod];


export const SettingsUpdateAdminSecondFactorMethod = {
  daily_code: 'daily_code',
  simple_math: 'simple_math',
  captcha: 'captcha',
} as const;

export interface SettingsUpdate {
  companyName?: string;
  legalName?: string;
  phone?: string;
  email?: string;
  address?: string;
  defaultLanguage?: SettingsUpdateDefaultLanguage;
  quoteNotificationEmail?: string;
  siteContent?: SettingsUpdateSiteContent;
  integrationSettings?: SettingsUpdateIntegrationSettings;
  adminSecondFactorEnabled?: boolean;
  adminSecondFactorMethod?: SettingsUpdateAdminSecondFactorMethod;
}

export interface StartImpersonationInput {
  employeeId: string;
}

export interface ImpersonationSession {
  token: string;
  csrfToken: string;
  expiresAt: string;
  user: CurrentUser;
}

export type ListEmployeesParams = {
/**
 * Busca por nombre, apellido, ID, correo, teléfono, departamento, puesto, dirección o SSN si existe en el registro corporativo.
 */
q?: string;
};

