summaryrefslogtreecommitdiff
path: root/db/schema
diff options
context:
space:
mode:
Diffstat (limited to 'db/schema')
-rw-r--r--db/schema/pq.ts32
1 files changed, 23 insertions, 9 deletions
diff --git a/db/schema/pq.ts b/db/schema/pq.ts
index 56f2cc40..b233119f 100644
--- a/db/schema/pq.ts
+++ b/db/schema/pq.ts
@@ -129,7 +129,18 @@ export const vendorPQSubmissions = pgTable("vendor_pq_submissions", {
// PQ 유형 구분을 명시적으로
type: varchar("type", { length: 20 }).notNull(), // "GENERAL" or "PROJECT" or "NON_INSPECTION"
- status: varchar("status", { length: 20 }).notNull().default("REQUESTED"),
+ status: varchar("status", {
+ length: 20,
+ enum: [
+ "REQUESTED",
+ "SUBMITTED",
+ "APPROVED",
+ "REJECTED",
+ "QM_REVIEWING", // QM 검토중
+ "QM_APPROVED", // QM 승인
+ "QM_REJECTED" // QM 거절
+ ]
+ }).notNull().default("REQUESTED"),
dueDate: timestamp("due_date"),
agreements: jsonb("agreements").notNull().default({}), // ✅ 체크 항목들을 JSON으로 저장
@@ -243,11 +254,12 @@ export const vendorInvestigations = pgTable("vendor_investigations", {
investigationStatus: varchar("investigation_status", {
length: 50,
enum: [
- "PLANNED", // 계획됨
- "IN_PROGRESS", // 진행 중
- "COMPLETED", // 완료됨
- "CANCELED", // 취소됨
- "RESULT_SENT", // 실사결과발송 - 구매담당자가 Vendor측으로 실사결과를 발송한 상태
+ "PLANNED", // 계획됨
+ "IN_PROGRESS", // 진행 중
+ "COMPLETED", // 완료됨
+ "CANCELED", // 취소됨
+ "SUPPLEMENT_REQUIRED", // 보완 요구됨 (재실사 또는 서류제출)
+ "RESULT_SENT", // 실사결과발송 - 구매담당자가 Vendor측으로 실사결과를 발송한 상태
],
})
.notNull()
@@ -291,9 +303,11 @@ export const vendorInvestigations = pgTable("vendor_investigations", {
evaluationResult: varchar("evaluation_result", {
length: 50,
enum: [
- "APPROVED", // 승인
- "SUPPLEMENT", // 보완
- "REJECTED", // 불가
+ "APPROVED", // 승인
+ "SUPPLEMENT", // 보완
+ "SUPPLEMENT_REINSPECT", // 보완-재실사 (PRODUCT_INSPECTION, SITE_VISIT_EVAL만 해당)
+ "SUPPLEMENT_DOCUMENT", // 보완-서류제출 (PRODUCT_INSPECTION, SITE_VISIT_EVAL만 해당)
+ "REJECTED", // 불가
],
}),