From ee77f36b1ceece1236d45fba102c3ea410acebc1 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Thu, 11 Sep 2025 11:20:42 +0000 Subject: (최겸) 구매 계약 메인 및 상세 기능 개발(템플릿 연동 및 계약 전달 개발 필요) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/general-contracts/types.ts | 138 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 lib/general-contracts/types.ts (limited to 'lib/general-contracts/types.ts') diff --git a/lib/general-contracts/types.ts b/lib/general-contracts/types.ts new file mode 100644 index 00000000..16f35dd5 --- /dev/null +++ b/lib/general-contracts/types.ts @@ -0,0 +1,138 @@ +// 일반계약 관련 타입 정의 + +// 1. 계약구분 +export const GENERAL_CONTRACT_CATEGORIES = [ + '단가계약', + '일반계약', + '매각계약' +] as const; + +export type GeneralContractCategory = typeof GENERAL_CONTRACT_CATEGORIES[number]; + +// 2. 계약종류 +export const GENERAL_CONTRACT_TYPES = [ + 'UP', // 자재단가계약 + 'LE', // 임대차계약 + 'IL', // 개별운송계약 + 'AL', // 연간운송계약 + 'OS', // 외주용역계약 + 'OW', // 도급계약 + 'IS', // 검사계약 + 'LO', // LOI (의향서) + 'FA', // FA (Frame Agreement) + 'SC', // 납품합의계약 (Supply Contract) + 'OF', // 클레임상계계약 (Offset Agreement) + 'AW', // 사전작업합의 (Advanced Work) + 'AD', // 사전납품합의 (Advanced Delivery) + 'AM', // 설계계약 + 'SC_SELL' // 폐기물매각계약 (Scrap) - 납품합의계약과 코드 중복으로 별도 명명 +] as const; + +export type GeneralContractType = typeof GENERAL_CONTRACT_TYPES[number]; + +// 3. 계약상태 +export const GENERAL_CONTRACT_STATUSES = [ + 'Draft', // 임시 저장 + 'Request to Review', // 조건검토요청 + 'Confirm to Review', // 조건검토완료 + 'Contract Accept Request', // 계약승인요청 + 'Complete the Contract', // 계약체결(승인) + 'Reject to Accept Contract', // 계약승인거절 + 'Contract Delete', // 계약폐기 + 'PCR Request', // PCR요청 + 'VO Request', // VO 요청 + 'PCR Accept', // PCR승인 + 'PCR Reject' // PCR거절 +] as const; + +export type GeneralContractStatus = typeof GENERAL_CONTRACT_STATUSES[number]; + +// 4. 체결방식 +export const GENERAL_EXECUTION_METHODS = [ + '전자계약', + '오프라인계약' +] as const; + +export type GeneralExecutionMethod = typeof GENERAL_EXECUTION_METHODS[number]; + +// 5. 업체선정방법 +export const GENERAL_SELECTION_METHODS = [ + '견적', + '입찰', + '기타' // 기존 정의서의 'Null'을 '기타'로 변경, 명시적 의미 부여 +] as const; + +export type GeneralSelectionMethod = typeof GENERAL_SELECTION_METHODS[number]; + +// 6. 계약확정범위 +export const GENERAL_CONTRACT_SCOPES = [ + '단가', + '금액', + '물량', + '기타' +] as const; + +export type GeneralContractScope = typeof GENERAL_CONTRACT_SCOPES[number]; + +// 7. 납기종류 +export const GENERAL_DELIVERY_TYPES = [ + '단일납기', + '분할납기', + '구간납기' +] as const; + +export type GeneralDeliveryType = typeof GENERAL_DELIVERY_TYPES[number]; + +// 8. 연동제 적용 여부 +export const GENERAL_LINKAGE_TYPES = [ + 'Y', + 'N' +] as const; + +export type GeneralLinkageType = typeof GENERAL_LINKAGE_TYPES[number]; + +// 9. 하도급법 점검결과 +export const GENERAL_COMPLIANCE_RESULTS = [ + '준수', + '위반', + '위반의심' +] as const; + +export type GeneralComplianceResult = typeof GENERAL_COMPLIANCE_RESULTS[number]; + +// 타입 가드 함수들 +export const isGeneralContractCategory = (value: string): value is GeneralContractCategory => { + return GENERAL_CONTRACT_CATEGORIES.includes(value as GeneralContractCategory); +}; + +export const isGeneralContractType = (value: string): value is GeneralContractType => { + return GENERAL_CONTRACT_TYPES.includes(value as GeneralContractType); +}; + +export const isGeneralContractStatus = (value: string): value is GeneralContractStatus => { + return GENERAL_CONTRACT_STATUSES.includes(value as GeneralContractStatus); +}; + +export const isGeneralExecutionMethod = (value: string): value is GeneralExecutionMethod => { + return GENERAL_EXECUTION_METHODS.includes(value as GeneralExecutionMethod); +}; + +export const isGeneralSelectionMethod = (value: string): value is GeneralSelectionMethod => { + return GENERAL_SELECTION_METHODS.includes(value as GeneralSelectionMethod); +}; + +export const isGeneralContractScope = (value: string): value is GeneralContractScope => { + return GENERAL_CONTRACT_SCOPES.includes(value as GeneralContractScope); +}; + +export const isGeneralDeliveryType = (value: string): value is GeneralDeliveryType => { + return GENERAL_DELIVERY_TYPES.includes(value as GeneralDeliveryType); +}; + +export const isGeneralLinkageType = (value: string): value is GeneralLinkageType => { + return GENERAL_LINKAGE_TYPES.includes(value as GeneralLinkageType); +}; + +export const isGeneralComplianceResult = (value: string): value is GeneralComplianceResult => { + return GENERAL_COMPLIANCE_RESULTS.includes(value as GeneralComplianceResult); +}; -- cgit v1.2.3