ERP-node/frontend/types/commonCode.ts

108 lines
2.3 KiB
TypeScript
Raw Normal View History

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;
}
// 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;
// 기존 필드 (하위 호환성을 위해 유지)
code_category?: string;
code_value?: string;
code_name?: string;
code_name_eng?: string | null;
sort_order?: number;
is_active?: string;
2025-09-02 13:18:46 +09:00
created_date?: string | null;
created_by?: string | null;
updated_date?: string | 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?: "Y" | "N"; // 백엔드에서 기대하는 문자열 타입
2025-09-02 13:18:46 +09:00
}
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?: "Y" | "N"; // 백엔드에서 기대하는 문자열 타입
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;
}