diff options
Diffstat (limited to 'lib/avl/types.ts')
| -rw-r--r-- | lib/avl/types.ts | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/lib/avl/types.ts b/lib/avl/types.ts new file mode 100644 index 00000000..6a7b5143 --- /dev/null +++ b/lib/avl/types.ts @@ -0,0 +1,163 @@ +// AVL 관련 타입 정의 +import { AvlList, AvlVendorInfo } from "@/db/schema/avl/avl"; + +// AVL 리스트 아이템 (UI에서 사용하는 타입) +export interface AvlListItem extends Omit<AvlList, 'createdAt' | 'updatedAt'> { + no: number; + selected: boolean; + createdAt: string; // UI에서 사용하기 위해 string으로 변환 + updatedAt: string; // UI에서 사용하기 위해 string으로 변환 + vendorInfoSnapshot?: any; // JSON 데이터 + + // 추가 표시용 필드들 (실제로는 AvlVendorInfo에서 가져와야 함) + projectInfo?: string; + shipType?: string; + avlType?: string; + htDivision?: string; + rev?: number; + pkg?: string; + materialGroup?: string; + vendor?: string; + tier?: string; + ownerSuggestion?: string; + shiSuggestion?: string; + registrant?: string; + lastModifier?: string; +} + +// AVL 상세 아이템 (UI에서 사용하는 타입) +export interface AvlDetailItem extends Omit<AvlVendorInfo, 'createdAt' | 'updatedAt'> { + no: number; + selected: boolean; + createdAt: string; + updatedAt: string; + + // UI 표시용 추가 필드들 + equipBulkDivision: 'EQUIP' | 'BULK'; // UI에서 표시하기 위한 변환 + faTarget: boolean; // UI에서 표시하기 위한 변환 + faStatus: string; + agentStatus: string; // UI에서 표시하기 위한 변환 + shiAvl: boolean; // hasAvl로 매핑 + shiBlacklist: boolean; // isBlacklist로 매핑 + shiBcc: boolean; // isBcc로 매핑 + salesQuoteNumber: string; // techQuoteNumber로 매핑 + quoteCode: string; // quoteCode로 매핑 + salesVendorInfo: string; // quoteVendorName으로 매핑 + salesCountry: string; // quoteCountry로 매핑 + totalAmount: string; // quoteTotalAmount로 매핑 (string으로 변환) + quoteReceivedDate: string; // quoteReceivedDate로 매핑 + recentQuoteDate: string; // recentQuoteDate로 매핑 + recentQuoteNumber: string; // recentQuoteNumber로 매핑 + recentOrderDate: string; // recentOrderDate로 매핑 + recentOrderNumber: string; // recentOrderNumber로 매핑 + remarks: string; // remark으로 매핑 +} + +// AVL 생성을 위한 입력 타입 +export interface CreateAvlListInput extends Omit<AvlList, 'id' | 'createdAt' | 'updatedAt' | 'vendorInfoSnapshot'> { + // UI에서 입력받을 추가 필드들 + projectInfo?: string; + shipType?: string; + avlType?: string; + vendorInfoSnapshot?: any; // JSON 데이터, 선택적 속성 +} + +// AVL 업데이트를 위한 입력 타입 +export interface UpdateAvlListInput extends Partial<CreateAvlListInput> { + id: number; +} + + +// AVL Vendor Info UI 입력을 위한 인터페이스 +export interface AvlVendorInfoInput { + // AVL 타입 구분 + isTemplate?: boolean; // false: 프로젝트 AVL, true: 표준 AVL + + // 표준 AVL용 필드들 (isTemplate=true일 경우) + constructionSector?: string; // 공사부문 + shipType?: string; // 선종 + avlKind?: string; // AVL 종류 + htDivision?: string; // H/T 구분 + + // 프로젝트 코드 (나중에 AVL 리스트와 연결할 때 사용) + projectCode?: string; + + // AVL 리스트 ID (생성 시 필수, UI에서는 선택적으로 사용) + avlListId?: number; + + // 설계 정보 + equipBulkDivision: 'EQUIP' | 'BULK'; + disciplineCode?: string; + disciplineName: string; + + // 자재 정보 + materialNameCustomerSide: string; + + // 패키지 정보 + packageCode?: string; + packageName?: string; + + // 자재그룹 정보 + materialGroupCode?: string; + materialGroupName?: string; + + // 협력업체 정보 + vendorId?: number; + vendorName?: string; + vendorCode?: string; + + // AVL 정보 + avlVendorName?: string; + tier?: string; + + // 제안방향 + ownerSuggestion?: boolean; + shiSuggestion?: boolean; + + // 위치 정보 + headquarterLocation?: string; + manufacturingLocation?: string; + + // FA 정보 + faTarget?: boolean; + faStatus?: string; + + // Agent 정보 + isAgent?: boolean; + + // 계약 서명주체 + contractSignerId?: number; + contractSignerName?: string; + contractSignerCode?: string; + + // SHI Qualification + shiAvl?: boolean; + shiBlacklist?: boolean; + shiBcc?: boolean; + + // 기술영업 견적결과 + salesQuoteNumber?: string; + quoteCode?: string; + quoteVendorId?: number; + salesVendorInfo?: string; + quoteVendorCode?: string; + salesCountry?: string; + totalAmount?: string; + quoteReceivedDate?: string; + + // 업체 실적 현황 + recentQuoteDate?: string; + recentQuoteNumber?: string; + recentOrderDate?: string; + recentOrderNumber?: string; + + // 기타 + remarks?: string; +} + +// 액션 처리 결과 타입 +export interface ActionResult { + success: boolean; + message: string; + data?: any; +} |
