av6-core 1.7.0 → 1.7.1
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.
- package/dist/index.js +8 -7
- package/dist/index.mjs +8 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1983,12 +1983,13 @@ var commonService = (serviceDeps) => {
|
|
|
1983
1983
|
},
|
|
1984
1984
|
async commonExcelImport(searchParams) {
|
|
1985
1985
|
logger.info("entering::commonExcelImport::service");
|
|
1986
|
-
const
|
|
1987
|
-
if (!
|
|
1988
|
-
throw new Error("No file
|
|
1986
|
+
const file = searchParams.file;
|
|
1987
|
+
if (!file?.buffer) {
|
|
1988
|
+
throw new Error("No file buffer provided for Excel import");
|
|
1989
1989
|
}
|
|
1990
1990
|
const workbook = new import_exceljs.default.Workbook();
|
|
1991
|
-
|
|
1991
|
+
const buffer = searchParams.file.buffer;
|
|
1992
|
+
await workbook.xlsx.load(buffer);
|
|
1992
1993
|
const worksheet = workbook.worksheets[0];
|
|
1993
1994
|
if (!worksheet) {
|
|
1994
1995
|
throw new Error("No worksheet found in Excel file");
|
|
@@ -3064,7 +3065,7 @@ var getStaffInfoFromStaffIds = async (args) => {
|
|
|
3064
3065
|
select: { id: true, email: true, contactNo: true }
|
|
3065
3066
|
});
|
|
3066
3067
|
staffById = new Map(
|
|
3067
|
-
staffRows.map((s) => [s.id, { email: s.email ?? null, contactNo: s.contactNo ?? null, userId:
|
|
3068
|
+
staffRows.map((s) => [s.id, { email: s.email ?? null, contactNo: s.contactNo ?? null, userId: s.id }])
|
|
3068
3069
|
);
|
|
3069
3070
|
break;
|
|
3070
3071
|
case "LEVEL2": {
|
|
@@ -3082,7 +3083,7 @@ var getStaffInfoFromStaffIds = async (args) => {
|
|
|
3082
3083
|
}
|
|
3083
3084
|
});
|
|
3084
3085
|
staffById = new Map(
|
|
3085
|
-
result2.map((s) => [s.id, { email: s.email ?? null, contactNo: s.phoneNumber ?? null, userId:
|
|
3086
|
+
result2.map((s) => [s.id, { email: s.email ?? null, contactNo: s.phoneNumber ?? null, userId: s.id }])
|
|
3086
3087
|
);
|
|
3087
3088
|
break;
|
|
3088
3089
|
}
|
|
@@ -3101,7 +3102,7 @@ var getStaffInfoFromStaffIds = async (args) => {
|
|
|
3101
3102
|
}
|
|
3102
3103
|
});
|
|
3103
3104
|
staffById = new Map(
|
|
3104
|
-
result.map((s) => [s.id, { email: s.email ?? null, contactNo: s.phoneNumber ?? null, userId:
|
|
3105
|
+
result.map((s) => [s.id, { email: s.email ?? null, contactNo: s.phoneNumber ?? null, userId: s.id }])
|
|
3105
3106
|
);
|
|
3106
3107
|
break;
|
|
3107
3108
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1932,12 +1932,13 @@ var commonService = (serviceDeps) => {
|
|
|
1932
1932
|
},
|
|
1933
1933
|
async commonExcelImport(searchParams) {
|
|
1934
1934
|
logger.info("entering::commonExcelImport::service");
|
|
1935
|
-
const
|
|
1936
|
-
if (!
|
|
1937
|
-
throw new Error("No file
|
|
1935
|
+
const file = searchParams.file;
|
|
1936
|
+
if (!file?.buffer) {
|
|
1937
|
+
throw new Error("No file buffer provided for Excel import");
|
|
1938
1938
|
}
|
|
1939
1939
|
const workbook = new ExcelJs.Workbook();
|
|
1940
|
-
|
|
1940
|
+
const buffer = searchParams.file.buffer;
|
|
1941
|
+
await workbook.xlsx.load(buffer);
|
|
1941
1942
|
const worksheet = workbook.worksheets[0];
|
|
1942
1943
|
if (!worksheet) {
|
|
1943
1944
|
throw new Error("No worksheet found in Excel file");
|
|
@@ -3013,7 +3014,7 @@ var getStaffInfoFromStaffIds = async (args) => {
|
|
|
3013
3014
|
select: { id: true, email: true, contactNo: true }
|
|
3014
3015
|
});
|
|
3015
3016
|
staffById = new Map(
|
|
3016
|
-
staffRows.map((s) => [s.id, { email: s.email ?? null, contactNo: s.contactNo ?? null, userId:
|
|
3017
|
+
staffRows.map((s) => [s.id, { email: s.email ?? null, contactNo: s.contactNo ?? null, userId: s.id }])
|
|
3017
3018
|
);
|
|
3018
3019
|
break;
|
|
3019
3020
|
case "LEVEL2": {
|
|
@@ -3031,7 +3032,7 @@ var getStaffInfoFromStaffIds = async (args) => {
|
|
|
3031
3032
|
}
|
|
3032
3033
|
});
|
|
3033
3034
|
staffById = new Map(
|
|
3034
|
-
result2.map((s) => [s.id, { email: s.email ?? null, contactNo: s.phoneNumber ?? null, userId:
|
|
3035
|
+
result2.map((s) => [s.id, { email: s.email ?? null, contactNo: s.phoneNumber ?? null, userId: s.id }])
|
|
3035
3036
|
);
|
|
3036
3037
|
break;
|
|
3037
3038
|
}
|
|
@@ -3050,7 +3051,7 @@ var getStaffInfoFromStaffIds = async (args) => {
|
|
|
3050
3051
|
}
|
|
3051
3052
|
});
|
|
3052
3053
|
staffById = new Map(
|
|
3053
|
-
result.map((s) => [s.id, { email: s.email ?? null, contactNo: s.phoneNumber ?? null, userId:
|
|
3054
|
+
result.map((s) => [s.id, { email: s.email ?? null, contactNo: s.phoneNumber ?? null, userId: s.id }])
|
|
3054
3055
|
);
|
|
3055
3056
|
break;
|
|
3056
3057
|
}
|