2025-09-02 13:18:46 +09:00
|
|
|
// 공통코드 관련 타입 정의
|
|
|
|
|
|
|
|
|
|
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?: string | null;
|
|
|
|
|
created_by?: string | null;
|
|
|
|
|
updated_date?: string | null;
|
|
|
|
|
updated_by?: string | null;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-02 18:25:44 +09:00
|
|
|
// CategoryInfo는 CodeCategory의 별칭
|
|
|
|
|
export type CategoryInfo = CodeCategory;
|
|
|
|
|
|
2025-09-02 13:18:46 +09:00
|
|
|
export interface CodeInfo {
|
2025-09-30 14:28:40 +09:00
|
|
|
// 백엔드 응답 필드 (변환된 형태)
|
|
|
|
|
codeValue?: string;
|
|
|
|
|
codeName?: string;
|
|
|
|
|
codeNameEng?: string | null;
|
2025-09-02 13:18:46 +09:00
|
|
|
description?: string | null;
|
2025-09-30 14:28:40 +09:00
|
|
|
sortOrder?: number;
|
|
|
|
|
isActive?: string | boolean;
|
|
|
|
|
useYn?: string;
|
2025-12-23 09:31:18 +09:00
|
|
|
parentCodeValue?: string | null; // 계층구조: 부모 코드값
|
|
|
|
|
depth?: number; // 계층구조: 깊이 (1, 2, 3단계)
|
2025-09-30 14:28:40 +09:00
|
|
|
|
|
|
|
|
// 기존 필드 (하위 호환성을 위해 유지)
|
|
|
|
|
code_category?: string;
|
|
|
|
|
code_value?: string;
|
|
|
|
|
code_name?: string;
|
|
|
|
|
code_name_eng?: string | null;
|
|
|
|
|
sort_order?: number;
|
|
|
|
|
is_active?: string;
|
2025-12-23 09:31:18 +09:00
|
|
|
parent_code_value?: string | null; // 계층구조: 부모 코드값
|
2025-09-02 13:18:46 +09:00
|
|
|
created_date?: string | null;
|
|
|
|
|
created_by?: string | null;
|
|
|
|
|
updated_date?: string | null;
|
|
|
|
|
updated_by?: string | null;
|
2025-12-23 09:31:18 +09:00
|
|
|
|
|
|
|
|
// 트리 구조용
|
|
|
|
|
children?: CodeInfo[];
|
2025-09-02 13:18:46 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface CreateCategoryRequest {
|
|
|
|
|
categoryCode: string;
|
|
|
|
|
categoryName: string;
|
|
|
|
|
categoryNameEng?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
sortOrder?: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface UpdateCategoryRequest {
|
|
|
|
|
categoryName?: string;
|
|
|
|
|
categoryNameEng?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
sortOrder?: number;
|
2025-09-02 18:25:44 +09:00
|
|
|
isActive?: "Y" | "N"; // 백엔드에서 기대하는 문자열 타입
|
2025-09-02 13:18:46 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface CreateCodeRequest {
|
|
|
|
|
codeValue: string;
|
|
|
|
|
codeName: string;
|
|
|
|
|
codeNameEng?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
sortOrder?: number;
|
2025-12-23 09:31:18 +09:00
|
|
|
parentCodeValue?: string; // 계층구조: 부모 코드값
|
2025-09-02 13:18:46 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface UpdateCodeRequest {
|
|
|
|
|
codeName?: string;
|
|
|
|
|
codeNameEng?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
sortOrder?: number;
|
2025-09-02 18:25:44 +09:00
|
|
|
isActive?: "Y" | "N"; // 백엔드에서 기대하는 문자열 타입
|
2025-12-23 09:31:18 +09:00
|
|
|
parentCodeValue?: string; // 계층구조: 부모 코드값
|
2025-09-02 13:18:46 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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?: boolean;
|
|
|
|
|
page?: number;
|
|
|
|
|
size?: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface GetCodesQuery {
|
|
|
|
|
search?: string;
|
|
|
|
|
isActive?: boolean;
|
2025-09-03 18:23:23 +09:00
|
|
|
page?: number;
|
|
|
|
|
size?: number;
|
2025-09-02 13:18:46 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ApiResponse<T = any> {
|
|
|
|
|
success: boolean;
|
|
|
|
|
data?: T;
|
|
|
|
|
message: string;
|
|
|
|
|
error?: string;
|
|
|
|
|
total?: number;
|
|
|
|
|
}
|