summaryrefslogtreecommitdiff
path: root/lib/pos/types.ts
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-09-22 19:33:16 +0900
committerjoonhoekim <26rote@gmail.com>2025-09-22 19:33:16 +0900
commit480ac58010604140d1a52fa2b839aedb6ac15941 (patch)
tree4cc45c96ea174991d59c1a058ed9da05a2a3ac8c /lib/pos/types.ts
parentba35e67845f935c8ce0151c9ef1fefa0b0510faf (diff)
(김준회) POS I/F 로직 및 UI 처리 구현
Diffstat (limited to 'lib/pos/types.ts')
-rw-r--r--lib/pos/types.ts87
1 files changed, 87 insertions, 0 deletions
diff --git a/lib/pos/types.ts b/lib/pos/types.ts
new file mode 100644
index 00000000..eb75c94b
--- /dev/null
+++ b/lib/pos/types.ts
@@ -0,0 +1,87 @@
+// POS 관련 타입 정의
+
+export interface PosFileInfo {
+ projNo: string;
+ posNo: string;
+ posRevNo: string;
+ fileSer: string;
+ fileName: string;
+ dcmtmId: string;
+}
+
+export interface GetDcmtmIdParams {
+ /**
+ * 자재코드 (MATNR)
+ * 예: 'SN2693A6410100001'
+ */
+ materialCode: string;
+}
+
+export interface GetDcmtmIdResult {
+ success: boolean;
+ files?: PosFileInfo[];
+ error?: string;
+}
+
+export interface GetEncryptDocumentumFileParams {
+ objectID: string;
+ /**
+ * 사번. 기본값: 'EVM0236' (context2.txt 기준)
+ */
+ sabun?: string;
+ /**
+ * 앱 코드. 기본값: 환경변수 POS_APP_CODE 또는 'SO13'(품질)
+ */
+ appCode?: string;
+ /**
+ * 파일 생성 모드. 기본값: 1 (context2.txt 기준)
+ * 0: PDF Rendition 우선, 실패시 원본
+ * 1: 원본 파일
+ * 2: PDF 파일
+ * 3: TIFF 파일
+ */
+ fileCreateMode?: number;
+ /**
+ * 보안 레벨. 기본값: 'SedamsClassID'
+ */
+ securityLevel?: string;
+ /**
+ * 설계파일 여부. 기본값: true (context2.txt 기준)
+ */
+ isDesign?: boolean;
+}
+
+export interface DownloadPosFileParams {
+ /**
+ * POS API에서 반환된 상대 경로
+ * 예: "asd_as_2509131735233768_OP02\asd_as_2509131735233768_OP02.tif"
+ */
+ relativePath: string;
+}
+
+export interface DownloadPosFileResult {
+ success: boolean;
+ fileName?: string;
+ fileBuffer?: Buffer;
+ mimeType?: string;
+ error?: string;
+}
+
+export interface PosFileSyncResult {
+ success: boolean;
+ processedCount: number;
+ successCount: number;
+ failedCount: number;
+ errors: string[];
+ details: {
+ materialCode: string;
+ fileName?: string;
+ status: 'success' | 'failed' | 'no_files';
+ error?: string;
+ }[];
+}
+
+// POS SOAP 엔드포인트 정보
+export const POS_SOAP_SEGMENT = '/Documentum/PlmFileBroker.asmx';
+export const POS_SOAP_BASE_URL = process.env.POS_SOAP_ENDPOINT || 'http://60.100.99.122:7700';
+export const POS_SOAP_ENDPOINT = `${POS_SOAP_BASE_URL}${POS_SOAP_SEGMENT}`;