// 공통코드 관련 타입 정의

export interface CodeCategory {
  category_code: string;
  category_name: string;
  category_name_eng?: string | null;
  description?: string | null;
  sort_order: number;
  is_active: string;
  created_date?: Date | null;
  created_by?: string | null;
  updated_date?: Date | null;
  updated_by?: string | null;
}

export interface CodeInfo {
  code_category: string;
  code_value: string;
  code_name: string;
  code_name_eng?: string | null;
  description?: string | null;
  sort_order: number;
  is_active: string;
  created_date?: Date | null;
  created_by?: string | null;
  updated_date?: Date | null;
  updated_by?: string | null;
}

export interface CreateCategoryRequest {
  categoryCode: string;
  categoryName: string;
  categoryNameEng?: string;
  description?: string;
  sortOrder?: number;
}

export interface UpdateCategoryRequest {
  categoryName?: string;
  categoryNameEng?: string;
  description?: string;
  sortOrder?: number;
  isActive?: boolean;
}

export interface CreateCodeRequest {
  codeValue: string;
  codeName: string;
  codeNameEng?: string;
  description?: string;
  sortOrder?: number;
}

export interface UpdateCodeRequest {
  codeName?: string;
  codeNameEng?: string;
  description?: string;
  sortOrder?: number;
  isActive?: boolean;
}

export interface CodeOption {
  value: string;
  label: string;
  labelEng?: string | null;
}

export interface ReorderCodesRequest {
  codes: Array<{
    codeValue: string;
    sortOrder: number;
  }>;
}

export interface GetCategoriesQuery {
  search?: string;
  isActive?: string;
  page?: string;
  size?: string;
}

export interface GetCodesQuery {
  search?: string;
  isActive?: string;
}

export interface ApiResponse<T = any> {
  success: boolean;
  data?: T;
  message: string;
  error?: string;
  total?: number;
}
