summaryrefslogtreecommitdiff
path: root/lib/vendor-rfq-response/types.ts
blob: 5dadc89ba27905d01c5e0f96b199054947a58ae3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// RFQ 아이템 타입
export interface RfqResponseItem {
  id: number;
  itemCode: string;
  itemName: string;
  quantity?: number;
  uom?: string;
  description?: string | null;
}

// RFQ 첨부 파일 타입
export interface RfqResponseAttachment {
  id: number;
  fileName: string;
  filePath: string;
  vendorId?: number | null;
  evaluationId?: number | null;
}

// RFQ 코멘트 타입
export interface RfqResponseComment {
  id: number;
  commentText: string;
  vendorId?: number | null;
  evaluationId?: number | null;
  createdAt: Date;
  commentedBy?: number;
}

// 최종 RfqResponse 타입 - RFQ 참여 응답만 포함하도록 간소화
export interface RfqResponse {
  // 응답 정보
  responseId: number;
  responseStatus: "INVITED" | "ACCEPTED" | "DECLINED" | "REVIEWING" | "RESPONDED";
  respondedAt: Date;
  
  // RFQ 기본 정보
  rfqId: number;
  rfqCode: string;
  rfqDescription?: string | null;
  rfqDueDate?: Date | null;
  rfqStatus: string;
  rfqType?: string | null;
  rfqCreatedAt: Date;
  rfqUpdatedAt: Date;
  rfqCreatedBy?: number | null;
  
  // 프로젝트 정보
  projectId?: number | null;
  projectCode?: string | null;
  projectName?: string | null;
  
  // 벤더 정보
  vendorId: number;
  vendorName: string;
  vendorCode?: string | null;
  
  // RFQ 관련 데이터
  items: RfqResponseItem[];
  attachments: RfqResponseAttachment[];
  comments: RfqResponseComment[];
}

// DataTable 등에서 사용할 수 있도록 id 필드를 추가한 확장 타입
export interface RfqResponseWithId extends RfqResponse {
  id: number; // rfqId와 동일하게 사용
}

// 페이지네이션 결과 타입
export interface RfqResponsesResult {
  data: RfqResponseWithId[];
  pageCount: number;
}

// 이전 버전과의 호환성을 위한 RfqWithAll 타입 (이름만 유지)
export type RfqWithAll = RfqResponseWithId;