scheduler-node-models 1.0.81 → 1.0.83
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/general/emailer.d.ts +1 -0
- package/general/emailer.js +31 -0
- package/general/general.d.ts +12 -0
- package/general/general.js +2 -0
- package/general/index.d.ts +4 -0
- package/general/index.js +20 -0
- package/general/report.d.ts +12 -0
- package/general/report.js +70 -0
- package/general/reportStyle.d.ts +0 -0
- package/general/reportStyle.js +1 -0
- package/general/viewstate.d.ts +5 -0
- package/general/viewstate.js +9 -0
- package/index.d.ts +0 -0
- package/metrics/images.d.ts +22 -0
- package/metrics/images.js +33 -0
- package/metrics/index.d.ts +5 -0
- package/metrics/index.js +21 -0
- package/metrics/mission.d.ts +47 -0
- package/metrics/mission.js +81 -0
- package/metrics/missionSensorOutage.d.ts +11 -0
- package/metrics/missionSensorOutage.js +14 -0
- package/metrics/missionsensor.d.ts +67 -0
- package/metrics/missionsensor.js +128 -0
- package/metrics/outage.d.ts +43 -0
- package/metrics/outage.js +55 -0
- package/metrics/reports/drawSummary.d.ts +24 -0
- package/metrics/reports/drawSummary.js +311 -0
- package/metrics/reports/index.d.ts +5 -0
- package/metrics/reports/index.js +21 -0
- package/metrics/reports/missionDay.d.ts +8 -0
- package/metrics/reports/missionDay.js +23 -0
- package/metrics/reports/missionSummary.d.ts +25 -0
- package/metrics/reports/missionSummary.js +421 -0
- package/metrics/reports/missionType.d.ts +20 -0
- package/metrics/reports/missionType.js +314 -0
- package/metrics/reports/outageDay.d.ts +8 -0
- package/metrics/reports/outageDay.js +23 -0
- package/metrics/systemdata/classifications.d.ts +18 -0
- package/metrics/systemdata/classifications.js +23 -0
- package/metrics/systemdata/communications.d.ts +21 -0
- package/metrics/systemdata/communications.js +40 -0
- package/metrics/systemdata/dcgs.d.ts +19 -0
- package/metrics/systemdata/dcgs.js +29 -0
- package/metrics/systemdata/exploitations.d.ts +18 -0
- package/metrics/systemdata/exploitations.js +23 -0
- package/metrics/systemdata/groundSystems.d.ts +86 -0
- package/metrics/systemdata/groundSystems.js +143 -0
- package/metrics/systemdata/index.d.ts +7 -0
- package/metrics/systemdata/index.js +23 -0
- package/metrics/systemdata/platform.d.ts +124 -0
- package/metrics/systemdata/platform.js +176 -0
- package/metrics/systemdata/systeminfo.d.ts +28 -0
- package/metrics/systemdata/systeminfo.js +64 -0
- package/package.json +2 -2
- package/scheduler/employees/assignment.d.ts +139 -0
- package/scheduler/employees/assignment.js +304 -0
- package/scheduler/employees/balance.d.ts +35 -0
- package/scheduler/employees/balance.js +39 -0
- package/scheduler/employees/companyinfo.d.ts +16 -0
- package/scheduler/employees/companyinfo.js +6 -0
- package/scheduler/employees/contact.d.ts +36 -0
- package/scheduler/employees/contact.js +40 -0
- package/scheduler/employees/employee.d.ts +420 -0
- package/scheduler/employees/employee.js +1862 -0
- package/scheduler/employees/employeename.d.ts +48 -0
- package/scheduler/employees/employeename.js +97 -0
- package/scheduler/employees/index.d.ts +14 -0
- package/scheduler/employees/index.js +30 -0
- package/scheduler/employees/labor.d.ts +31 -0
- package/scheduler/employees/labor.js +39 -0
- package/scheduler/employees/leave.d.ts +58 -0
- package/scheduler/employees/leave.js +73 -0
- package/scheduler/employees/leaverequest.d.ts +105 -0
- package/scheduler/employees/leaverequest.js +226 -0
- package/scheduler/employees/specialty.d.ts +35 -0
- package/scheduler/employees/specialty.js +40 -0
- package/scheduler/employees/variation.d.ts +80 -0
- package/scheduler/employees/variation.js +132 -0
- package/scheduler/employees/web.d.ts +6 -0
- package/scheduler/employees/web.js +2 -0
- package/scheduler/employees/work.d.ts +96 -0
- package/scheduler/employees/work.js +133 -0
- package/scheduler/employees/workday.d.ts +91 -0
- package/scheduler/employees/workday.js +170 -0
- package/scheduler/labor/index.d.ts +2 -0
- package/scheduler/labor/index.js +18 -0
- package/scheduler/labor/laborcode.d.ts +33 -0
- package/scheduler/labor/laborcode.js +55 -0
- package/scheduler/labor/workcode.d.ts +28 -0
- package/scheduler/labor/workcode.js +35 -0
- package/scheduler/reports/chargeStatus.d.ts +66 -0
- package/scheduler/reports/chargeStatus.js +702 -0
- package/scheduler/reports/cofsReports.d.ts +11 -0
- package/scheduler/reports/cofsReports.js +36 -0
- package/scheduler/reports/enterpriseSchedule.d.ts +18 -0
- package/scheduler/reports/enterpriseSchedule.js +159 -0
- package/scheduler/reports/index.d.ts +4 -0
- package/scheduler/reports/index.js +20 -0
- package/scheduler/reports/scheduleReport.d.ts +17 -0
- package/scheduler/reports/scheduleReport.js +311 -0
- package/scheduler/sites/index.d.ts +1 -0
- package/scheduler/sites/index.js +17 -0
- package/scheduler/sites/reports/cofsReport.d.ts +41 -0
- package/scheduler/sites/reports/cofsReport.js +104 -0
- package/scheduler/sites/reports/forecast.d.ts +57 -0
- package/scheduler/sites/reports/forecast.js +205 -0
- package/scheduler/sites/reports/index.d.ts +4 -0
- package/scheduler/sites/reports/index.js +20 -0
- package/scheduler/sites/reports/period.d.ts +11 -0
- package/scheduler/sites/reports/period.js +27 -0
- package/scheduler/sites/reports/section.d.ts +63 -0
- package/scheduler/sites/reports/section.js +174 -0
- package/scheduler/sites/site.d.ts +39 -0
- package/scheduler/sites/site.js +61 -0
- package/scheduler/sites/workcenters/index.d.ts +3 -0
- package/scheduler/sites/workcenters/index.js +19 -0
- package/scheduler/sites/workcenters/position.d.ts +27 -0
- package/scheduler/sites/workcenters/position.js +36 -0
- package/scheduler/sites/workcenters/shift.d.ts +32 -0
- package/scheduler/sites/workcenters/shift.js +47 -0
- package/scheduler/sites/workcenters/workcenter.d.ts +43 -0
- package/scheduler/sites/workcenters/workcenter.js +123 -0
- package/scheduler/teams/company/company.d.ts +99 -0
- package/scheduler/teams/company/company.js +256 -0
- package/scheduler/teams/company/holiday.d.ts +55 -0
- package/scheduler/teams/company/holiday.js +108 -0
- package/scheduler/teams/company/index.d.ts +3 -0
- package/scheduler/teams/company/index.js +19 -0
- package/scheduler/teams/company/modperiod.d.ts +21 -0
- package/scheduler/teams/company/modperiod.js +24 -0
- package/scheduler/teams/contact.d.ts +18 -0
- package/scheduler/teams/contact.js +23 -0
- package/scheduler/teams/index.d.ts +3 -0
- package/scheduler/teams/index.js +19 -0
- package/scheduler/teams/specialty.d.ts +18 -0
- package/scheduler/teams/specialty.js +23 -0
- package/scheduler/teams/team.d.ts +95 -0
- package/scheduler/teams/team.js +351 -0
- package/users/index.d.ts +2 -0
- package/users/index.js +18 -0
- package/users/user.d.ts +130 -0
- package/users/user.js +254 -0
- package/users/web.d.ts +22 -0
- package/users/web.js +2 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
import { Employee } from "../employees";
|
2
|
+
import { ILaborCode, LaborCode } from "../labor";
|
3
|
+
import { CofSReport, ICofSReport } from "./reports/cofsReport";
|
4
|
+
import { Forecast, IForecast } from "./reports/forecast";
|
5
|
+
import { IWorkcenter, Workcenter } from "./workcenters/workcenter";
|
6
|
+
/**
|
7
|
+
* This interface defined the data members for a team site.
|
8
|
+
*/
|
9
|
+
export interface ISite {
|
10
|
+
id: string;
|
11
|
+
name: string;
|
12
|
+
utcOffset: number;
|
13
|
+
showMids: boolean;
|
14
|
+
workcenters?: IWorkcenter[];
|
15
|
+
laborCodes?: ILaborCode[];
|
16
|
+
forecasts?: IForecast[];
|
17
|
+
cofs?: ICofSReport[];
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* This class implements the Site interface data members and actions.
|
21
|
+
*/
|
22
|
+
export declare class Site implements ISite {
|
23
|
+
id: string;
|
24
|
+
name: string;
|
25
|
+
utcOffset: number;
|
26
|
+
showMids: boolean;
|
27
|
+
workcenters: Workcenter[];
|
28
|
+
laborCodes: LaborCode[];
|
29
|
+
forecasts: Forecast[];
|
30
|
+
cofs: CofSReport[];
|
31
|
+
employees?: Employee[];
|
32
|
+
constructor(site?: ISite);
|
33
|
+
/**
|
34
|
+
* This function is used for sorting sites
|
35
|
+
* @param other another site object to use in comparison
|
36
|
+
* @returns A numeric value for the relative position of this site to another.
|
37
|
+
*/
|
38
|
+
compareTo(other?: Site): number;
|
39
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Site = void 0;
|
4
|
+
const labor_1 = require("../labor");
|
5
|
+
const forecast_1 = require("./reports/forecast");
|
6
|
+
const workcenter_1 = require("./workcenters/workcenter");
|
7
|
+
/**
|
8
|
+
* This class implements the Site interface data members and actions.
|
9
|
+
*/
|
10
|
+
class Site {
|
11
|
+
id;
|
12
|
+
name;
|
13
|
+
utcOffset;
|
14
|
+
showMids;
|
15
|
+
workcenters;
|
16
|
+
laborCodes;
|
17
|
+
forecasts;
|
18
|
+
cofs;
|
19
|
+
employees;
|
20
|
+
constructor(site) {
|
21
|
+
this.id = (site) ? site.id : '';
|
22
|
+
this.name = (site) ? site.name : '';
|
23
|
+
this.utcOffset = (site) ? site.utcOffset : 0;
|
24
|
+
this.showMids = (site) ? site.showMids : false;
|
25
|
+
this.workcenters = [];
|
26
|
+
if (site && site.workcenters) {
|
27
|
+
site.workcenters.forEach(wc => {
|
28
|
+
this.workcenters.push(new workcenter_1.Workcenter(wc));
|
29
|
+
});
|
30
|
+
this.workcenters.sort((a, b) => a.compareTo(b));
|
31
|
+
}
|
32
|
+
this.laborCodes = [];
|
33
|
+
if (site && site.laborCodes) {
|
34
|
+
site.laborCodes.forEach(lc => {
|
35
|
+
this.laborCodes.push(new labor_1.LaborCode(lc));
|
36
|
+
});
|
37
|
+
this.laborCodes.sort((a, b) => a.compareTo(b));
|
38
|
+
}
|
39
|
+
this.forecasts = [];
|
40
|
+
if (site && site.forecasts) {
|
41
|
+
site.forecasts.forEach(fcst => {
|
42
|
+
this.forecasts.push(new forecast_1.Forecast(fcst));
|
43
|
+
});
|
44
|
+
this.forecasts.sort((a, b) => a.compareTo(b));
|
45
|
+
}
|
46
|
+
this.cofs = [];
|
47
|
+
this.employees = [];
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* This function is used for sorting sites
|
51
|
+
* @param other another site object to use in comparison
|
52
|
+
* @returns A numeric value for the relative position of this site to another.
|
53
|
+
*/
|
54
|
+
compareTo(other) {
|
55
|
+
if (other) {
|
56
|
+
return (this.name < other.name) ? -1 : 1;
|
57
|
+
}
|
58
|
+
return -1;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
exports.Site = Site;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./position"), exports);
|
18
|
+
__exportStar(require("./shift"), exports);
|
19
|
+
__exportStar(require("./workcenter"), exports);
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { Employee } from "../../employees";
|
2
|
+
/**
|
3
|
+
* This interface defines the data members for a duty position
|
4
|
+
*/
|
5
|
+
export interface IPosition {
|
6
|
+
id: string;
|
7
|
+
name: string;
|
8
|
+
sort: number;
|
9
|
+
assigned: string[];
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* This class implements the basic duty position definition plus actions.
|
13
|
+
*/
|
14
|
+
export declare class Position implements IPosition {
|
15
|
+
id: string;
|
16
|
+
name: string;
|
17
|
+
sort: number;
|
18
|
+
assigned: string[];
|
19
|
+
employees?: Employee[];
|
20
|
+
constructor(pos?: IPosition);
|
21
|
+
/**
|
22
|
+
* This function will be used to sort duty positions within a list
|
23
|
+
* @param other A position object to compare against this one.
|
24
|
+
* @returns A numeric value for its relative position to the other.
|
25
|
+
*/
|
26
|
+
compareTo(other?: Position): number;
|
27
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Position = void 0;
|
4
|
+
/**
|
5
|
+
* This class implements the basic duty position definition plus actions.
|
6
|
+
*/
|
7
|
+
class Position {
|
8
|
+
id;
|
9
|
+
name;
|
10
|
+
sort;
|
11
|
+
assigned;
|
12
|
+
employees;
|
13
|
+
constructor(pos) {
|
14
|
+
this.id = (pos) ? pos.id : '';
|
15
|
+
this.name = (pos) ? pos.name : '';
|
16
|
+
this.sort = (pos) ? pos.sort : 0;
|
17
|
+
this.assigned = [];
|
18
|
+
if (pos) {
|
19
|
+
pos.assigned.forEach(emp => {
|
20
|
+
this.assigned.push(emp);
|
21
|
+
});
|
22
|
+
}
|
23
|
+
}
|
24
|
+
/**
|
25
|
+
* This function will be used to sort duty positions within a list
|
26
|
+
* @param other A position object to compare against this one.
|
27
|
+
* @returns A numeric value for its relative position to the other.
|
28
|
+
*/
|
29
|
+
compareTo(other) {
|
30
|
+
if (other) {
|
31
|
+
return (this.sort < other.sort) ? -1 : 1;
|
32
|
+
}
|
33
|
+
return -1;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
exports.Position = Position;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { Employee } from "../../employees";
|
2
|
+
/**
|
3
|
+
* This interface defines the data members associated with a shift
|
4
|
+
*/
|
5
|
+
export interface IShift {
|
6
|
+
id: string;
|
7
|
+
name: string;
|
8
|
+
sort: number;
|
9
|
+
associatedCodes: string[];
|
10
|
+
payCode: number;
|
11
|
+
minimums: number;
|
12
|
+
}
|
13
|
+
/**
|
14
|
+
* This class definition implements the basic shift object plus actions.
|
15
|
+
*/
|
16
|
+
export declare class Shift implements IShift {
|
17
|
+
id: string;
|
18
|
+
name: string;
|
19
|
+
sort: number;
|
20
|
+
associatedCodes: string[];
|
21
|
+
payCode: number;
|
22
|
+
minimums: number;
|
23
|
+
employees?: Employee[];
|
24
|
+
constructor(shft?: IShift);
|
25
|
+
/**
|
26
|
+
* This function will be used to sort this shift with others.
|
27
|
+
* @param other A Shift object to compare against
|
28
|
+
* @returns A numeric value for the relative position to the other.
|
29
|
+
*/
|
30
|
+
compareTo(other?: Shift): number;
|
31
|
+
belowMinimums(): boolean;
|
32
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Shift = void 0;
|
4
|
+
/**
|
5
|
+
* This class definition implements the basic shift object plus actions.
|
6
|
+
*/
|
7
|
+
class Shift {
|
8
|
+
id;
|
9
|
+
name;
|
10
|
+
sort;
|
11
|
+
associatedCodes;
|
12
|
+
payCode;
|
13
|
+
minimums;
|
14
|
+
employees;
|
15
|
+
constructor(shft) {
|
16
|
+
this.id = (shft) ? shft.id : '';
|
17
|
+
this.name = (shft) ? shft.name : '';
|
18
|
+
this.sort = (shft) ? shft.sort : 0;
|
19
|
+
this.associatedCodes = [];
|
20
|
+
if (shft) {
|
21
|
+
shft.associatedCodes.forEach(code => {
|
22
|
+
this.associatedCodes.push(code);
|
23
|
+
});
|
24
|
+
this.associatedCodes.sort();
|
25
|
+
}
|
26
|
+
this.payCode = (shft) ? shft.payCode : 1;
|
27
|
+
this.minimums = (shft) ? shft.minimums : 1;
|
28
|
+
}
|
29
|
+
/**
|
30
|
+
* This function will be used to sort this shift with others.
|
31
|
+
* @param other A Shift object to compare against
|
32
|
+
* @returns A numeric value for the relative position to the other.
|
33
|
+
*/
|
34
|
+
compareTo(other) {
|
35
|
+
if (other) {
|
36
|
+
return (this.sort < other.sort) ? -1 : 1;
|
37
|
+
}
|
38
|
+
return -1;
|
39
|
+
}
|
40
|
+
belowMinimums() {
|
41
|
+
if (this.employees) {
|
42
|
+
return this.employees.length < this.minimums;
|
43
|
+
}
|
44
|
+
return (this.minimums > 0);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
exports.Shift = Shift;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { Employee } from "../../employees";
|
2
|
+
import { IPosition, Position } from "./position";
|
3
|
+
import { IShift, Shift } from "./shift";
|
4
|
+
/**
|
5
|
+
* This interface will define a workcenter.
|
6
|
+
*/
|
7
|
+
export interface IWorkcenter {
|
8
|
+
id: string;
|
9
|
+
name: string;
|
10
|
+
sort: number;
|
11
|
+
shifts?: IShift[];
|
12
|
+
positions?: IPosition[];
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* This class defines a workcenter with its data members and actions
|
16
|
+
*/
|
17
|
+
export declare class Workcenter implements IWorkcenter {
|
18
|
+
id: string;
|
19
|
+
name: string;
|
20
|
+
sort: number;
|
21
|
+
shifts?: Shift[];
|
22
|
+
positions?: Position[];
|
23
|
+
constructor(wc?: IWorkcenter);
|
24
|
+
/**
|
25
|
+
* This function is used to sort this workcenter in relation to another
|
26
|
+
* @param other The workcenter object used in comparison.
|
27
|
+
* @returns A numeric value for the relative position between two workcenters.
|
28
|
+
*/
|
29
|
+
compareTo(other?: Workcenter): number;
|
30
|
+
/**
|
31
|
+
* This function will be used to assign the employee to either a position or a shift
|
32
|
+
* based the positions assignment list or their workday code.
|
33
|
+
* @param emp The employee object to assign to one of the workcenter's postions or
|
34
|
+
* shifts.
|
35
|
+
* @param date The date object to used to find the employee's workday.
|
36
|
+
*/
|
37
|
+
assign(emp: Employee, date: Date): void;
|
38
|
+
/**
|
39
|
+
* This function will clear the employees' lists from the workcenter positions and
|
40
|
+
* shifts.
|
41
|
+
*/
|
42
|
+
clearEmployees(): void;
|
43
|
+
}
|
@@ -0,0 +1,123 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Workcenter = void 0;
|
4
|
+
const employees_1 = require("../../employees");
|
5
|
+
const position_1 = require("./position");
|
6
|
+
const shift_1 = require("./shift");
|
7
|
+
/**
|
8
|
+
* This class defines a workcenter with its data members and actions
|
9
|
+
*/
|
10
|
+
class Workcenter {
|
11
|
+
id;
|
12
|
+
name;
|
13
|
+
sort;
|
14
|
+
shifts;
|
15
|
+
positions;
|
16
|
+
constructor(wc) {
|
17
|
+
this.id = (wc) ? wc.id : '';
|
18
|
+
this.name = (wc) ? wc.name : '';
|
19
|
+
this.sort = (wc) ? wc.sort : 0;
|
20
|
+
if (wc && wc.shifts && wc.shifts.length > 0) {
|
21
|
+
this.shifts = [];
|
22
|
+
wc.shifts.forEach(shft => {
|
23
|
+
if (this.shifts) {
|
24
|
+
this.shifts.push(new shift_1.Shift(shft));
|
25
|
+
}
|
26
|
+
});
|
27
|
+
this.shifts.sort((a, b) => a.compareTo(b));
|
28
|
+
}
|
29
|
+
if (wc && wc.positions && wc.positions.length > 0) {
|
30
|
+
this.positions = [];
|
31
|
+
wc.positions.forEach(pos => {
|
32
|
+
this.positions?.push(new position_1.Position(pos));
|
33
|
+
});
|
34
|
+
this.positions.sort((a, b) => a.compareTo(b));
|
35
|
+
}
|
36
|
+
}
|
37
|
+
/**
|
38
|
+
* This function is used to sort this workcenter in relation to another
|
39
|
+
* @param other The workcenter object used in comparison.
|
40
|
+
* @returns A numeric value for the relative position between two workcenters.
|
41
|
+
*/
|
42
|
+
compareTo(other) {
|
43
|
+
if (other) {
|
44
|
+
return (this.sort < other.sort) ? -1 : 1;
|
45
|
+
}
|
46
|
+
return -1;
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* This function will be used to assign the employee to either a position or a shift
|
50
|
+
* based the positions assignment list or their workday code.
|
51
|
+
* @param emp The employee object to assign to one of the workcenter's postions or
|
52
|
+
* shifts.
|
53
|
+
* @param date The date object to used to find the employee's workday.
|
54
|
+
*/
|
55
|
+
assign(emp, date) {
|
56
|
+
// first check to see if the employee is assigned to a position
|
57
|
+
let bPosition = false;
|
58
|
+
if (this.positions) {
|
59
|
+
this.positions.forEach((pos, p) => {
|
60
|
+
pos.assigned.forEach(asgn => {
|
61
|
+
if (emp.id === asgn) {
|
62
|
+
bPosition = true;
|
63
|
+
if (!pos.employees) {
|
64
|
+
pos.employees = [];
|
65
|
+
pos.employees.push(new employees_1.Employee(emp));
|
66
|
+
}
|
67
|
+
else {
|
68
|
+
pos.employees.push(new employees_1.Employee(emp));
|
69
|
+
pos.employees.sort((a, b) => a.compareTo(b));
|
70
|
+
}
|
71
|
+
}
|
72
|
+
});
|
73
|
+
if (bPosition && this.positions) {
|
74
|
+
this.positions[p] = pos;
|
75
|
+
}
|
76
|
+
});
|
77
|
+
}
|
78
|
+
// if not assigned to a position, find their shift and assign to a shift.
|
79
|
+
if (!bPosition && this.shifts) {
|
80
|
+
let wd = emp.getWorkday(date);
|
81
|
+
this.shifts.forEach((shft, s) => {
|
82
|
+
shft.associatedCodes.forEach(cd => {
|
83
|
+
if (cd.toLowerCase() === wd?.code.toLowerCase()) {
|
84
|
+
if (!shft.employees) {
|
85
|
+
shft.employees = [];
|
86
|
+
shft.employees.push(new employees_1.Employee(emp));
|
87
|
+
}
|
88
|
+
else {
|
89
|
+
shft.employees.push(new employees_1.Employee(emp));
|
90
|
+
shft.employees.sort((a, b) => a.compareTo(b));
|
91
|
+
}
|
92
|
+
}
|
93
|
+
});
|
94
|
+
if (this.shifts) {
|
95
|
+
this.shifts[s] = shft;
|
96
|
+
}
|
97
|
+
});
|
98
|
+
}
|
99
|
+
}
|
100
|
+
/**
|
101
|
+
* This function will clear the employees' lists from the workcenter positions and
|
102
|
+
* shifts.
|
103
|
+
*/
|
104
|
+
clearEmployees() {
|
105
|
+
if (this.positions) {
|
106
|
+
this.positions.forEach((pos, p) => {
|
107
|
+
pos.employees = undefined;
|
108
|
+
if (this.positions) {
|
109
|
+
this.positions[p] = pos;
|
110
|
+
}
|
111
|
+
});
|
112
|
+
}
|
113
|
+
if (this.shifts) {
|
114
|
+
this.shifts.forEach((shft, s) => {
|
115
|
+
shft.employees = undefined;
|
116
|
+
if (this.shifts) {
|
117
|
+
this.shifts[s] = shft;
|
118
|
+
}
|
119
|
+
});
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
exports.Workcenter = Workcenter;
|
@@ -0,0 +1,99 @@
|
|
1
|
+
import { Holiday, HolidayType, IHoliday } from "./holiday";
|
2
|
+
import { IModPeriod, ModPeriod } from "./modperiod";
|
3
|
+
/**
|
4
|
+
* This interface defines the data members to describe the company information. The
|
5
|
+
* ingest type, period, start day, and password information are necessary to ingess the
|
6
|
+
* company's timecard information for various reports.
|
7
|
+
*/
|
8
|
+
export interface ICompany {
|
9
|
+
id: string;
|
10
|
+
name: string;
|
11
|
+
ingest: string;
|
12
|
+
ingestPeriod?: number;
|
13
|
+
startDay?: number;
|
14
|
+
ingestPwd: string;
|
15
|
+
holidays?: IHoliday[];
|
16
|
+
modperiods?: IModPeriod[];
|
17
|
+
}
|
18
|
+
/**
|
19
|
+
* This class definition implements the company interface, plus necessary actions to
|
20
|
+
* manipulate the object.
|
21
|
+
*/
|
22
|
+
export declare class Company implements ICompany {
|
23
|
+
id: string;
|
24
|
+
name: string;
|
25
|
+
ingest: string;
|
26
|
+
ingestPeriod?: number | undefined;
|
27
|
+
startDay?: number | undefined;
|
28
|
+
ingestPwd: string;
|
29
|
+
holidays: Holiday[];
|
30
|
+
modperiods: ModPeriod[];
|
31
|
+
constructor(co?: ICompany);
|
32
|
+
/**
|
33
|
+
* This function is used in sorting this company with another.
|
34
|
+
* @param other The company object used in the comparison.
|
35
|
+
* @returns a numeric value to show relative position between the objects
|
36
|
+
*/
|
37
|
+
compareTo(other?: Company): number;
|
38
|
+
/**
|
39
|
+
* This function is used to purge any old data from the company record, mainly holiday
|
40
|
+
* actual dates.
|
41
|
+
* @param date A date object used as the cutoff date.
|
42
|
+
*/
|
43
|
+
purge(date: Date): void;
|
44
|
+
/**
|
45
|
+
* The function checks the company's list of mod periods to see if one of them fits
|
46
|
+
* within its start and end dates.
|
47
|
+
* @param date The date object for checking mod periods.
|
48
|
+
* @returns A boolean value to indicate if the list contains a mod period for the date.
|
49
|
+
*/
|
50
|
+
hasModPeriod(date: Date): boolean;
|
51
|
+
/**
|
52
|
+
* This function will add a new mod period to the company's mod period list.
|
53
|
+
* @param year numeric value for the full year.
|
54
|
+
* @param start The date object to specify the first day of the company's mod period.
|
55
|
+
* @param end The date object to specify the last day of the company's mod period.
|
56
|
+
*/
|
57
|
+
addModPeriod(year: number, start: Date, end: Date): void;
|
58
|
+
/**
|
59
|
+
* This function is used update either the start or end dates.
|
60
|
+
* @param year A numeric value for the mod period's year value
|
61
|
+
* @param field A string value to designate which date field to update
|
62
|
+
* @param value A date object used in the update.
|
63
|
+
*/
|
64
|
+
updateModPeriod(year: number, field: string, value: Date): void;
|
65
|
+
/**
|
66
|
+
* This function will remove a mod period from the company's list.
|
67
|
+
* @param year a numeric value for the year to delete.
|
68
|
+
*/
|
69
|
+
deleteModPeriod(year: number): void;
|
70
|
+
/**
|
71
|
+
* This function checks whether a particular holiday based on a combined identifier of
|
72
|
+
* holiday type and a sort value is present in the company's list.
|
73
|
+
* @param type The holiday type value for comparison to the list
|
74
|
+
* @param sort A numeric value for the second part of the identifier.
|
75
|
+
* @returns A boolean value to signify if the holiday is present in the company's list.
|
76
|
+
*/
|
77
|
+
hasHoliday(type: HolidayType, sort: number): boolean;
|
78
|
+
/**
|
79
|
+
* This function will add a new holiday, after checking for the name given.
|
80
|
+
* @param type The holiday type value for the new holiday
|
81
|
+
* @param name A string value for the name of the new holiday
|
82
|
+
* @returns A holiday object with the type and name.
|
83
|
+
*/
|
84
|
+
addHoliday(type: HolidayType, name: string): Holiday;
|
85
|
+
/**
|
86
|
+
* This function is used to update a company holiday.
|
87
|
+
* @param type The holiday type value for the holiday to update
|
88
|
+
* @param sort The sort value for the holiday to update
|
89
|
+
* @param field The string value to point to which field to update within the holiday.
|
90
|
+
* @param value The string value for the new value to update to.
|
91
|
+
*/
|
92
|
+
updateHoliday(type: HolidayType, sort: number, field: string, value: string): void;
|
93
|
+
/**
|
94
|
+
* This function will remove the company holiday based on the type and identifier.
|
95
|
+
* @param type The holiday type to look for
|
96
|
+
* @param sort The numeric identifier for the holiday type.
|
97
|
+
*/
|
98
|
+
deleteHoliday(type: HolidayType, sort: number): void;
|
99
|
+
}
|