gm-mcp 2.0.8 → 2.0.10
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.
|
@@ -25,6 +25,6 @@ export declare function findCustomerEWAById(id: number): Promise<Gimo.CustomerEW
|
|
|
25
25
|
export declare function getCustomerStatusChange(ewaCustomerId: number, options?: {
|
|
26
26
|
accessToken?: string;
|
|
27
27
|
}): Promise<CustomerEwaStatusChangeLogs[]>;
|
|
28
|
-
export declare function getCurrentPayperiodInfo(
|
|
28
|
+
export declare function getCurrentPayperiodInfo(employeeId: number, options?: {
|
|
29
29
|
accessToken?: string;
|
|
30
30
|
}): Promise<PayperiodInfo>;
|
|
@@ -163,14 +163,14 @@ function getCustomerStatusChange(ewaCustomerId, options) {
|
|
|
163
163
|
return res;
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
function getCurrentPayperiodInfo(
|
|
166
|
+
function getCurrentPayperiodInfo(employeeId, options) {
|
|
167
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
168
168
|
const { accessToken } = options || {};
|
|
169
169
|
let access_token = accessToken;
|
|
170
170
|
if (!access_token) {
|
|
171
171
|
access_token = yield getAccessToken();
|
|
172
172
|
}
|
|
173
|
-
const url = `${(0, env_1.getEnv)().DASH_URL}/api/v1/admin/employees/${
|
|
173
|
+
const url = `${(0, env_1.getEnv)().DASH_URL}/api/v1/admin/employees/${employeeId}/current-pay-period-info`;
|
|
174
174
|
const res = yield axios_1.default
|
|
175
175
|
.get(url, {
|
|
176
176
|
headers: {
|
|
@@ -110,7 +110,7 @@ function elgibilityTool(phoneNumber) {
|
|
|
110
110
|
if (payPeriods === null || payPeriods === void 0 ? void 0 : payPeriods.length) {
|
|
111
111
|
periods = payPeriods;
|
|
112
112
|
timeSheets = yield (0, gimo_service_1.getTimeSheets)({ payPeriodId: payPeriods[0].id, employeeId: employee.id }, { accessToken });
|
|
113
|
-
currentPayperiodInfo = yield (0, gimo_service_1.getCurrentPayperiodInfo)(
|
|
113
|
+
currentPayperiodInfo = yield (0, gimo_service_1.getCurrentPayperiodInfo)(employee.id, { accessToken });
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
if (customer.ewa_status === "DEACTIVATE") {
|
|
@@ -159,7 +159,7 @@ function elgibilityTool(phoneNumber) {
|
|
|
159
159
|
content: [
|
|
160
160
|
{
|
|
161
161
|
type: "text",
|
|
162
|
-
text: "Oh no,có rồi, thử lại nhé " + error,
|
|
162
|
+
text: "Oh no,có rồi, thử lại nhé " + JSON.stringify(error),
|
|
163
163
|
},
|
|
164
164
|
],
|
|
165
165
|
};
|
package/package.json
CHANGED
|
@@ -143,13 +143,13 @@ export async function getCustomerStatusChange(ewaCustomerId: number, options?: {
|
|
|
143
143
|
return res;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
export async function getCurrentPayperiodInfo(
|
|
146
|
+
export async function getCurrentPayperiodInfo(employeeId: number, options?: { accessToken?: string }) {
|
|
147
147
|
const { accessToken } = options || {};
|
|
148
148
|
let access_token = accessToken;
|
|
149
149
|
if (!access_token) {
|
|
150
150
|
access_token = await getAccessToken();
|
|
151
151
|
}
|
|
152
|
-
const url = `${getEnv().DASH_URL}/api/v1/admin/employees/${
|
|
152
|
+
const url = `${getEnv().DASH_URL}/api/v1/admin/employees/${employeeId}/current-pay-period-info`;
|
|
153
153
|
const res = await axios
|
|
154
154
|
.get<PayperiodInfo>(url, {
|
|
155
155
|
headers: {
|
|
@@ -127,7 +127,7 @@ export async function elgibilityTool(phoneNumber: string): Promise<CallToolResul
|
|
|
127
127
|
if (payPeriods?.length) {
|
|
128
128
|
periods = payPeriods;
|
|
129
129
|
timeSheets = await getTimeSheets({ payPeriodId: payPeriods[0].id, employeeId: employee.id }, { accessToken });
|
|
130
|
-
currentPayperiodInfo = await getCurrentPayperiodInfo(
|
|
130
|
+
currentPayperiodInfo = await getCurrentPayperiodInfo(employee.id, { accessToken });
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
if (customer.ewa_status === "DEACTIVATE") {
|
|
@@ -182,7 +182,7 @@ export async function elgibilityTool(phoneNumber: string): Promise<CallToolResul
|
|
|
182
182
|
content: [
|
|
183
183
|
{
|
|
184
184
|
type: "text",
|
|
185
|
-
text: "Oh no,có rồi, thử lại nhé " + error,
|
|
185
|
+
text: "Oh no,có rồi, thử lại nhé " + JSON.stringify(error),
|
|
186
186
|
},
|
|
187
187
|
],
|
|
188
188
|
};
|