// Shared types for fullstack project
// Auto-generated — used by both apps/web and apps/api

// ─── Entities ────────────────────────────────────────
export interface User {
  id?: string;
  username: string;
  passwordHash: string;
  nickname?: string;
  role?: string;
  phone?: string;
  avatarUrl?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Contract {
  id?: string;
  userId: string;
  title: string;
  partyA?: string;
  partyB?: string;
  amount?: number;
  signedAt?: string;
  expiresAt?: string;
  status?: string;
  fileUrl?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Approval {
  id?: string;
  userId: string;
  entityType: string;
  entityId?: string;
  applicantId: string;
  status?: string;
  formData?: Record<string, unknown>;
  createdAt?: string;
  updatedAt?: string;
}

export interface Customer {
  id?: string;
  userId: string;
  name: string;
  email?: string;
  phone?: string;
  company?: string;
  source?: string;
  tags?: Record<string, unknown>;
  createdAt?: string;
  updatedAt?: string;
}

export interface Reminder {
  id?: string;
  userId: string;
  entityType: string;
  entityId?: string;
  remindAt: string;
  message?: string;
  sent?: boolean;
  createdAt?: string;
  updatedAt?: string;
}

export interface Boards {
  id: string;
  userId?: string;
  name: string;
  description?: string;
  color?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Tasks {
  id: string;
  userId?: string;
  boardId?: string;
  title: string;
  description?: string;
  status?: string;
  priority?: string;
  dueDate?: string;
  assigneeId?: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface Items {
  id: string;
  userId?: string;
  title: string;
  description?: string;
  status?: string;
  data?: Record<string, unknown>;
  createdAt?: string;
  updatedAt?: string;
}

// ─── API Response Wrappers ───────────────────────────
export interface ApiResponse<T> {
  data: T;
  message?: string;
}

export interface PaginatedResponse<T> {
  data: T[];
  total: number;
  page: number;
  pageSize: number;
}

export interface ErrorResponse {
  error: string;
  message: string;
  statusCode: number;
}
