gm-mcp 2.0.13 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,12 +20,15 @@ const FIELD_LABELS = {
20
20
  dda: "Trạng thái DDA",
21
21
  seniority: "Thâm niên làm việc",
22
22
  working_status: "Trạng thái làm việc",
23
- longest_overdue_bill: "Số ngày quá hạn thanh toán dài nhất",
23
+ longest_overdue_bill: "Bill quá hạn lâu nhất",
24
24
  outstanding_balance: "Số dư nợ",
25
25
  parnter_contract_expirity: "Hạn hợp đồng đối tác",
26
- time_sheet: "Dữ liệu chấm công",
26
+ time_sheet: "Công ca",
27
27
  product_type: "Loại sản phẩm",
28
28
  opreation_note: "Ghi chú vận hành",
29
+ employee_status: "Trạng thái nhân sự",
30
+ available_balance: "Số dư khả dụng",
31
+ wage: "Mức lương",
29
32
  };
30
33
  const PRODUCT_TYPE = {
31
34
  EWA_01: "EWA_01",
@@ -182,22 +185,13 @@ function elgibilityToolV2(phoneNumber) {
182
185
  requiredLabel: `>= 0.3 năm`,
183
186
  pass: !!(employee === null || employee === void 0 ? void 0 : employee.seniority) && employee.seniority >= 0.3,
184
187
  },
185
- {
186
- key: "seniority",
187
- current: employee === null || employee === void 0 ? void 0 : employee.seniority,
188
- currentLabel: `${employee === null || employee === void 0 ? void 0 : employee.seniority} năm`,
189
- required: ">= 0.3",
190
- requiredLabel: `>= 0.3 năm`,
191
- pass: !!(employee === null || employee === void 0 ? void 0 : employee.seniority) && employee.seniority >= 0.3,
192
- reason: ewaDeactiveReason,
193
- },
194
188
  {
195
189
  key: "employee_status",
196
190
  current: employee === null || employee === void 0 ? void 0 : employee.status,
197
191
  currentLabel: ((_g = employee_1.EMPLOYEE_STATUS_MAPS[(employee === null || employee === void 0 ? void 0 : employee.status) || ""]) === null || _g === void 0 ? void 0 : _g.label) || "",
198
192
  required: employee_1.EmployeeStatus.ACTIVE,
199
193
  requiredLabel: employee_1.EMPLOYEE_STATUS_MAPS.ACTIVE.label,
200
- pass: ((_h = employee === null || employee === void 0 ? void 0 : employee.status) === null || _h === void 0 ? void 0 : _h.toLowerCase()) === employee_1.EmployeeStatus.ACTIVE,
194
+ pass: ((_h = employee === null || employee === void 0 ? void 0 : employee.status) === null || _h === void 0 ? void 0 : _h.toLowerCase()) === employee_1.EmployeeStatus.ACTIVE.toLocaleLowerCase(),
201
195
  reason: employee === null || employee === void 0 ? void 0 : employee.reason,
202
196
  },
203
197
  {
@@ -256,9 +250,9 @@ function elgibilityToolV2(phoneNumber) {
256
250
  if (ewaDeactiveReason) {
257
251
  reasons.push(`Reason for ewa status: ${ewaDeactiveReason}`);
258
252
  }
259
- const criteriaText = compareResult.map(formatter2).join('\n');
253
+ const criteriaText = compareResult.map(formatter2).join("\n");
260
254
  const result = `
261
- Customer ${customer.customer_full_name}, partner name ${customer.partner_name} has criteria: ${criteriaText}
255
+ Customer ${customer.customer_full_name}, partner name ${customer.partner_name}, product type: ${productType} has criteria: ${criteriaText}
262
256
  `;
263
257
  return { content: [{ type: "text", text: result }] };
264
258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-mcp",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "Mcp server for Gm",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -19,12 +19,15 @@ const FIELD_LABELS: Record<string, string> = {
19
19
  dda: "Trạng thái DDA",
20
20
  seniority: "Thâm niên làm việc",
21
21
  working_status: "Trạng thái làm việc",
22
- longest_overdue_bill: "Số ngày quá hạn thanh toán dài nhất",
22
+ longest_overdue_bill: "Bill quá hạn lâu nhất",
23
23
  outstanding_balance: "Số dư nợ",
24
24
  parnter_contract_expirity: "Hạn hợp đồng đối tác",
25
- time_sheet: "Dữ liệu chấm công",
25
+ time_sheet: "Công ca",
26
26
  product_type: "Loại sản phẩm",
27
27
  opreation_note: "Ghi chú vận hành",
28
+ employee_status: "Trạng thái nhân sự",
29
+ available_balance: "Số dư khả dụng",
30
+ wage: "Mức lương",
28
31
  };
29
32
 
30
33
  const PRODUCT_TYPE = {
@@ -215,22 +218,14 @@ export async function elgibilityToolV2(phoneNumber: string): Promise<CallToolRes
215
218
  requiredLabel: `>= 0.3 năm`,
216
219
  pass: !!employee?.seniority && employee.seniority >= 0.3,
217
220
  },
218
- {
219
- key: "seniority",
220
- current: employee?.seniority,
221
- currentLabel: `${employee?.seniority} năm`,
222
- required: ">= 0.3",
223
- requiredLabel: `>= 0.3 năm`,
224
- pass: !!employee?.seniority && employee.seniority >= 0.3,
225
- reason: ewaDeactiveReason,
226
- },
221
+
227
222
  {
228
223
  key: "employee_status",
229
224
  current: employee?.status,
230
225
  currentLabel: EMPLOYEE_STATUS_MAPS[employee?.status || ""]?.label || "",
231
226
  required: EmployeeStatus.ACTIVE,
232
227
  requiredLabel: EMPLOYEE_STATUS_MAPS.ACTIVE.label,
233
- pass: employee?.status?.toLowerCase() === EmployeeStatus.ACTIVE,
228
+ pass: employee?.status?.toLowerCase() === EmployeeStatus.ACTIVE.toLocaleLowerCase(),
234
229
  reason: employee?.reason,
235
230
  },
236
231
  {
@@ -292,10 +287,10 @@ export async function elgibilityToolV2(phoneNumber: string): Promise<CallToolRes
292
287
  reasons.push(`Reason for ewa status: ${ewaDeactiveReason}`);
293
288
  }
294
289
 
295
- const criteriaText = compareResult.map(formatter2).join('\n');
290
+ const criteriaText = compareResult.map(formatter2).join("\n");
296
291
 
297
292
  const result = `
298
- Customer ${customer.customer_full_name}, partner name ${customer.partner_name} has criteria: ${criteriaText}
293
+ Customer ${customer.customer_full_name}, partner name ${customer.partner_name}, product type: ${productType} has criteria: ${criteriaText}
299
294
  `;
300
295
 
301
296
  return { content: [{ type: "text", text: result }] };