gm-mcp 2.0.10 → 2.0.11
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.
|
@@ -70,12 +70,12 @@ exports.EMPLOYEE_STATUS_MAPS = {
|
|
|
70
70
|
SUSPEND__DEFAULT: "Tạm nghỉ",
|
|
71
71
|
INACTIVE: "Nghỉ việc",
|
|
72
72
|
};
|
|
73
|
-
const
|
|
73
|
+
const CUSTOMER_EWA_STATUS_MAPS = {
|
|
74
74
|
ACTIVE: "Hoạt động",
|
|
75
75
|
DEACTIVATE: "Tạm ngưng",
|
|
76
76
|
};
|
|
77
77
|
const BASE_REQUIRED_CRITERIA = {
|
|
78
|
-
ewa_status:
|
|
78
|
+
ewa_status: CUSTOMER_EWA_STATUS_MAPS.ACTIVE,
|
|
79
79
|
seniority: ">= 0.3 year",
|
|
80
80
|
working_status: exports.EMPLOYEE_STATUS_MAPS.ACTIVE,
|
|
81
81
|
longest_overdue_bill: "<=10 days",
|
|
@@ -93,7 +93,7 @@ const formatter = (record) => {
|
|
|
93
93
|
};
|
|
94
94
|
function elgibilityTool(phoneNumber) {
|
|
95
95
|
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
var _a, _b;
|
|
96
|
+
var _a, _b, _c, _d;
|
|
97
97
|
try {
|
|
98
98
|
const accessToken = yield (0, gimo_service_1.getAccessToken)();
|
|
99
99
|
const customer = yield (0, gimo_service_1.findCustomerEWAByPhonenumber)(phoneNumber, { accessToken });
|
|
@@ -123,7 +123,7 @@ function elgibilityTool(phoneNumber) {
|
|
|
123
123
|
partner_onboard_method: onboard_method || "",
|
|
124
124
|
});
|
|
125
125
|
const currentInformation = {
|
|
126
|
-
ewa_status: customer === null || customer === void 0 ? void 0 : customer.ewa_status,
|
|
126
|
+
ewa_status: (_d = CUSTOMER_EWA_STATUS_MAPS[(_c = customer === null || customer === void 0 ? void 0 : customer.ewa_status) !== null && _c !== void 0 ? _c : ""]) !== null && _d !== void 0 ? _d : "",
|
|
127
127
|
dda: customer === null || customer === void 0 ? void 0 : customer.dda_status,
|
|
128
128
|
seniority: employee === null || employee === void 0 ? void 0 : employee.seniority,
|
|
129
129
|
working_status: exports.EMPLOYEE_STATUS_MAPS[(employee === null || employee === void 0 ? void 0 : employee.status) || "ACTIVE"],
|
|
@@ -146,7 +146,10 @@ function elgibilityTool(phoneNumber) {
|
|
|
146
146
|
return BASE_REQUIRED_CRITERIA;
|
|
147
147
|
};
|
|
148
148
|
const requiredCriteria = getRequriedCriteria(productType);
|
|
149
|
-
const reasons = [
|
|
149
|
+
const reasons = [];
|
|
150
|
+
if (ewaDeactiveReason) {
|
|
151
|
+
reasons.push(`Reason for ewa status: ${ewaDeactiveReason}`);
|
|
152
|
+
}
|
|
150
153
|
const result = `
|
|
151
154
|
Customer ${customer.customer_full_name}, partner name ${customer.partner_name} has these information: ${formatter(currentInformation)}
|
|
152
155
|
Eligibility Criteria for Salary Advance: ${formatter(requiredCriteria)}
|
package/package.json
CHANGED
|
@@ -75,13 +75,13 @@ export const EMPLOYEE_STATUS_MAPS: Record<string, any> = {
|
|
|
75
75
|
INACTIVE: "Nghỉ việc",
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
const
|
|
78
|
+
const CUSTOMER_EWA_STATUS_MAPS: Record<string, any> = {
|
|
79
79
|
ACTIVE: "Hoạt động",
|
|
80
80
|
DEACTIVATE: "Tạm ngưng",
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
const BASE_REQUIRED_CRITERIA = {
|
|
84
|
-
ewa_status:
|
|
84
|
+
ewa_status: CUSTOMER_EWA_STATUS_MAPS.ACTIVE,
|
|
85
85
|
seniority: ">= 0.3 year",
|
|
86
86
|
working_status: EMPLOYEE_STATUS_MAPS.ACTIVE,
|
|
87
87
|
longest_overdue_bill: "<=10 days",
|
|
@@ -142,7 +142,7 @@ export async function elgibilityTool(phoneNumber: string): Promise<CallToolResul
|
|
|
142
142
|
});
|
|
143
143
|
|
|
144
144
|
const currentInformation = {
|
|
145
|
-
ewa_status: customer?.ewa_status,
|
|
145
|
+
ewa_status: CUSTOMER_EWA_STATUS_MAPS[customer?.ewa_status ?? ""] ?? "",
|
|
146
146
|
dda: customer?.dda_status,
|
|
147
147
|
seniority: employee?.seniority,
|
|
148
148
|
working_status: EMPLOYEE_STATUS_MAPS[employee?.status || "ACTIVE"],
|
|
@@ -168,7 +168,10 @@ export async function elgibilityTool(phoneNumber: string): Promise<CallToolResul
|
|
|
168
168
|
|
|
169
169
|
const requiredCriteria: Record<string, any> = getRequriedCriteria(productType);
|
|
170
170
|
|
|
171
|
-
const reasons = [
|
|
171
|
+
const reasons: string[] = [];
|
|
172
|
+
if (ewaDeactiveReason) {
|
|
173
|
+
reasons.push(`Reason for ewa status: ${ewaDeactiveReason}`);
|
|
174
|
+
}
|
|
172
175
|
|
|
173
176
|
const result = `
|
|
174
177
|
Customer ${customer.customer_full_name}, partner name ${customer.partner_name} has these information: ${formatter(currentInformation)}
|