// Import and re-export shared entity types
import type {
  User,
  Pet,
  Schedules,
  Records,
  Albums,
  Hospitals,
  Items,
  Daily-logs,
  ApiResponse,
  PaginatedResponse,
  ErrorResponse,
} from "@shared/types";

export type {
  User,
  Pet,
  Schedules,
  Records,
  Albums,
  Hospitals,
  Items,
  Daily-logs,
  ApiResponse,
  PaginatedResponse,
  ErrorResponse,
};

// Auto-generated types (from Model Contract)

export interface CreateUserInput {
  username: string;
  passwordHash: string;
  nickname?: string;
  role?: string;
  phone?: string;
  avatarUrl?: string;
}

export interface CreatePetInput {
  userId: string;
  name: string;
  species?: string;
  breed?: string;
  birthDate?: string;
  weightKg?: number;
  avatarUrl?: string;
}

export interface CreateSchedulesInput {
  userId?: string;
  courseId?: string;
  classroomId?: string;
  instructorId?: string;
  dayOfWeek?: number;
  startTime?: string;
  endTime?: string;
}

export interface CreateRecordsInput {
  userId?: string;
  title: string;
  description?: string;
  data?: Record<string, unknown>;
}

export interface CreateAlbumsInput {
  userId?: string;
  title?: string;
  imageUrl: string;
  caption?: string;
  takenAt?: string;
}

export interface CreateHospitalsInput {
  userId?: string;
  name: string;
  address?: string;
  phone?: string;
  rating?: number;
  lat?: number;
  lng?: number;
}

export interface CreateItemsInput {
  userId?: string;
  title: string;
  description?: string;
  data?: Record<string, unknown>;
}

export interface CreateDaily-logsInput {
  userId?: string;
  title: string;
  data?: Record<string, unknown>;
}

export interface UpdateUserInput {
  username?: string;
  passwordHash?: string;
  nickname?: string;
  role?: string;
  phone?: string;
  avatarUrl?: string;
}

export interface UpdatePetInput {
  userId?: string;
  name?: string;
  species?: string;
  breed?: string;
  birthDate?: string;
  weightKg?: number;
  avatarUrl?: string;
}

export interface UpdateSchedulesInput {
  userId?: string;
  courseId?: string;
  classroomId?: string;
  instructorId?: string;
  dayOfWeek?: number;
  startTime?: string;
  endTime?: string;
}

export interface UpdateRecordsInput {
  userId?: string;
  title?: string;
  description?: string;
  data?: Record<string, unknown>;
}

export interface UpdateAlbumsInput {
  userId?: string;
  title?: string;
  imageUrl?: string;
  caption?: string;
  takenAt?: string;
}

export interface UpdateHospitalsInput {
  userId?: string;
  name?: string;
  address?: string;
  phone?: string;
  rating?: number;
  lat?: number;
  lng?: number;
}

export interface UpdateItemsInput {
  userId?: string;
  title?: string;
  description?: string;
  data?: Record<string, unknown>;
}

export interface UpdateDaily-logsInput {
  userId?: string;
  title?: string;
  data?: Record<string, unknown>;
}

// ─── Auth ───────────────────────────────────────────
export interface LoginInput {
  username: string;
  password: string;
}

export interface RegisterInput {
  username: string;
  password: string;
  nickname?: string;
}

export interface AuthResponse {
  token: string;
  user: User;
}

// ─── API ────────────────────────────────────────────
// ─── JWT ────────────────────────────────────────────
export interface JwtPayload {
  userId: string;
  username: string;
  role: string;
  iat?: number;
  exp?: number;
}
