scheduler-node-models 1.2.38 → 1.2.40
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/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Team } from "../teams";
|
|
1
|
+
import { ITeam, Team } from "../teams";
|
|
2
2
|
import { ExcelRow } from "./excelRow";
|
|
3
3
|
export declare class SAPIngest {
|
|
4
4
|
files: File[];
|
|
5
|
-
teamid: string;
|
|
6
5
|
team: Team;
|
|
7
|
-
constructor(files?: File[], team?:
|
|
6
|
+
constructor(files?: File[], team?: ITeam);
|
|
7
|
+
Process(): Promise<ExcelRow[]>;
|
|
8
8
|
processFile(file: File): Promise<ExcelRow[]>;
|
|
9
9
|
}
|
|
@@ -6,12 +6,22 @@ const excelRow_1 = require("./excelRow");
|
|
|
6
6
|
const exceljs_1 = require("exceljs");
|
|
7
7
|
class SAPIngest {
|
|
8
8
|
files;
|
|
9
|
-
teamid;
|
|
10
9
|
team;
|
|
11
10
|
constructor(files, team) {
|
|
12
11
|
this.files = (files) ? files : [];
|
|
13
|
-
this.
|
|
14
|
-
|
|
12
|
+
this.team = (team) ? new teams_1.Team(team) : new teams_1.Team();
|
|
13
|
+
}
|
|
14
|
+
async Process() {
|
|
15
|
+
const result = [];
|
|
16
|
+
if (this.files.length > 0) {
|
|
17
|
+
const allfiles = this.files.map(async (file, f) => {
|
|
18
|
+
const results = await this.processFile(file);
|
|
19
|
+
result.push(...results);
|
|
20
|
+
});
|
|
21
|
+
await Promise.allSettled(allfiles);
|
|
22
|
+
}
|
|
23
|
+
result.sort((a, b) => a.compareTo(b));
|
|
24
|
+
return result;
|
|
15
25
|
}
|
|
16
26
|
async processFile(file) {
|
|
17
27
|
const result = [];
|
|
@@ -46,7 +56,7 @@ class SAPIngest {
|
|
|
46
56
|
// get the data from the worksheet
|
|
47
57
|
worksheet.eachRow((row, r) => {
|
|
48
58
|
let value = row.getCell(explanation);
|
|
49
|
-
if (value && !value.toString().toLowerCase().includes('total')) {
|
|
59
|
+
if (r > 0 && value && !value.toString().toLowerCase().includes('total')) {
|
|
50
60
|
// this row is pertainent data, so complete an excelrow object for the data
|
|
51
61
|
// in the row
|
|
52
62
|
const eRow = new excelRow_1.ExcelRow();
|