summaryrefslogtreecommitdiff
path: root/config/dashboard-table.ts
blob: e1856aabdd8c7c4778801933314025d0f7797596 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import { TableConfig } from "@/types/dashboard";

export const DASHBOARD_TABLES: TableConfig[] = [
    {
        tableName: 'b_rfqs',
        displayName: '검토용 견적',
        domain: 'procurement',
        statusField: 'status',
        statusMapping: {
          'DRAFT': 'pending',
          'Doc. Received': 'in_progress',
          'PIC Assigned': 'in_progress',
          'Doc. Confirmed': 'in_progress',
          'Init. RFQ Sent': 'in_progress',
          'Init. RFQ Answered': 'in_progress',
          'TBE started': 'in_progress',
          'TBE finished': 'in_progress',
          'Final RFQ Sent': 'in_progress',
          'Quotation Received': 'in_progress',
          'Vendor Selected': 'completed'
        },
        userFields: {
          creator: 'created_by',
          updater: 'updated_by',
          // assignee: 'sent_by'
        }
      },
    {
      tableName: 'procurement_rfqs',
      displayName: 'RFQ',
      domain: 'procurement',
      statusField: 'status',
      statusMapping: {
        'RFQ Created': 'pending',
        'RFQ Vendor Assignned': 'in_progress',
        'RFQ Sent': 'in_progress',
        'Quotation Analysis': 'in_progress',
        'PO Transfer': 'completed',
        'PO Create': 'completed'
      },
      userFields: {
        creator: 'sent_by',
        updater: 'updated_by',
        // assignee: 'sent_by'
      }
    },
    {
        tableName: 'evaluation_targets',
        displayName: '협력업체 평가대상 관리',
        domain: 'procurement',
        statusField: 'status',
        statusMapping: {
          'PENDING': 'pending',
          'EXCLUDED': 'completed',
          'CONFIRMED': 'completed'
        },
        userFields: {
          creator: 'confirmed_by',
        //   updater: 'updated_by',
        //   assignee: 'confirmed_by'
        }
      },

      {
        tableName: 'tech_sales_rfqs',
        displayName: '기술영업 RFQ',
        domain: 'sales',
        statusField: 'status',
        statusMapping: {
          'RFQ Created': 'pending',
          'RFQ Vendor Assignned': 'in_progress',
          'RFQ Sent': 'in_progress',
          'Quotation Analysist': 'in_progress',
          'Closed': 'completed'
        },
        userFields: {
          creator: 'created_by',
          updater: 'updated_by',
        //   assignee: 'confirmed_by'
        }
      },

          // 기술영업 벤더 견적
    {
      tableName: 'tech_sales_vendor_quotations',
      displayName: '기술영업 RFQ Quotations',
      domain: 'sales',
      statusField: 'status',
      statusMapping: {
        'Assigned': 'pending',
        'Draft': 'in_progress',
        'Submitted': 'completed',
        'Accepted': 'completed',
        'Rejected': 'completed',
      },
      userFields: {
        creator: 'created_by',
        updater: 'updated_by',
      }
  },
      
      
  ];


  export const getTablesByDomain = (domain: string): TableConfig[] => {
    if (domain === 'evcp') {
      return DASHBOARD_TABLES; // 모든 테이블 반환
    }
    return DASHBOARD_TABLES.filter(table => table.domain === domain);
  };
  
  export const getAllDomains = (): string[] => {
    return [...new Set(DASHBOARD_TABLES.map(table => table.domain))];
  };