scheduler-node-models 1.2.1 → 1.2.3
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 +5 -0
- package/general/index.js +21 -0
- package/general/logger.d.ts +10 -0
- package/general/logger.js +90 -0
- package/general/report.d.ts +25 -0
- package/general/report.js +76 -0
- package/general/viewstate.d.ts +5 -0
- package/general/viewstate.js +9 -0
- package/index.d.ts +0 -0
- package/index.js +1 -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/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 +4 -4
- 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 +427 -0
- package/scheduler/employees/employee.js +1887 -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/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 +186 -0
- package/scheduler/sites/site.d.ts +39 -0
- package/scheduler/sites/site.js +68 -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 +61 -0
- package/scheduler/teams/company/holiday.js +116 -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/question.d.ts +47 -0
- package/users/question.js +68 -0
- package/users/user.d.ts +150 -0
- package/users/user.js +304 -0
- package/users/web.d.ts +49 -0
- package/users/web.js +2 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { IImageType, ImageType } from "../images";
|
|
2
|
+
/**
|
|
3
|
+
* This interface will defined the data members of a sensor's standard times
|
|
4
|
+
*/
|
|
5
|
+
export interface ISensorTimes {
|
|
6
|
+
preflightMinutes: number;
|
|
7
|
+
scheduledMinutes: number;
|
|
8
|
+
postflightMinutes: number;
|
|
9
|
+
executedMinutes?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* This class defines the created object for sensor's standard times
|
|
13
|
+
*/
|
|
14
|
+
export declare class SensorTimes implements ISensorTimes {
|
|
15
|
+
preflightMinutes: number;
|
|
16
|
+
scheduledMinutes: number;
|
|
17
|
+
postflightMinutes: number;
|
|
18
|
+
executedMinutes?: number;
|
|
19
|
+
constructor(st?: ISensorTimes);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* This interface defines the data members for a sensor's exploitation record.
|
|
23
|
+
*/
|
|
24
|
+
export interface ISensorExploitation {
|
|
25
|
+
exploitation: string;
|
|
26
|
+
showOnGEOINT: boolean;
|
|
27
|
+
showOnGSEG: boolean;
|
|
28
|
+
showOnMIST: boolean;
|
|
29
|
+
showOnXINT: boolean;
|
|
30
|
+
standardTimes: ISensorTimes;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* This class defines the data members plus actions for a sensor's exploitation.
|
|
34
|
+
*/
|
|
35
|
+
export declare class SensorExploitation {
|
|
36
|
+
exploitation: string;
|
|
37
|
+
showOnGEOINT: boolean;
|
|
38
|
+
showOnGSEG: boolean;
|
|
39
|
+
showOnMIST: boolean;
|
|
40
|
+
showOnXINT: boolean;
|
|
41
|
+
standardTimes: ISensorTimes;
|
|
42
|
+
constructor(se?: ISensorExploitation);
|
|
43
|
+
compareTo(other?: SensorExploitation): number;
|
|
44
|
+
}
|
|
45
|
+
export declare enum GeneralTypes {
|
|
46
|
+
GEOINT = 1,
|
|
47
|
+
XINT = 2,
|
|
48
|
+
MIST = 3,
|
|
49
|
+
SYERS = 4,
|
|
50
|
+
ADMIN = 9,
|
|
51
|
+
OTHER = 99,
|
|
52
|
+
ALL = 9999
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* This interface defines the data members for a platform's sensor
|
|
56
|
+
*/
|
|
57
|
+
export interface IPlatformSensor {
|
|
58
|
+
id: string;
|
|
59
|
+
association: string;
|
|
60
|
+
generalType: GeneralTypes;
|
|
61
|
+
showTailNumber: boolean;
|
|
62
|
+
sortID: number;
|
|
63
|
+
exploitations?: ISensorExploitation[];
|
|
64
|
+
imageTypes?: IImageType[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* This class defines the data members and actions associated with a platform's sensor
|
|
68
|
+
*/
|
|
69
|
+
export declare class PlatformSensor {
|
|
70
|
+
id: string;
|
|
71
|
+
association: string;
|
|
72
|
+
generalType: GeneralTypes;
|
|
73
|
+
showTailNumber: boolean;
|
|
74
|
+
sortID: number;
|
|
75
|
+
exploitations?: SensorExploitation[];
|
|
76
|
+
imageTypes?: ImageType[];
|
|
77
|
+
constructor(ps?: IPlatformSensor);
|
|
78
|
+
/**
|
|
79
|
+
* This function will be used to sort this object as compared to another.
|
|
80
|
+
* @param other A Platform Sensor object to compare with
|
|
81
|
+
* @returns A numeric value to show whether this object is before or after the other.
|
|
82
|
+
*/
|
|
83
|
+
compareTo(other?: PlatformSensor): number;
|
|
84
|
+
/**
|
|
85
|
+
* This method is used to determine if this object meets the requirement for use, based
|
|
86
|
+
* on the exploitation and general type.
|
|
87
|
+
* @param exploit The string value for the exploitation.
|
|
88
|
+
* @param rpt The general type value for the sensor type for use.
|
|
89
|
+
* @returns A boolean value to indicate whether or not it should be used.
|
|
90
|
+
*/
|
|
91
|
+
use(exploit: string, rpt: GeneralTypes): boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* This interface defines the data members of a platform object.
|
|
95
|
+
*/
|
|
96
|
+
export interface IPlatform {
|
|
97
|
+
id: string;
|
|
98
|
+
sensors: IPlatformSensor[];
|
|
99
|
+
sortID: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* This class defines the data members plus actions for a platform object
|
|
103
|
+
*/
|
|
104
|
+
export declare class Platform implements IPlatform {
|
|
105
|
+
id: string;
|
|
106
|
+
sensors: PlatformSensor[];
|
|
107
|
+
sortID: number;
|
|
108
|
+
constructor(pl: IPlatform);
|
|
109
|
+
/**
|
|
110
|
+
* This function will be used in sorting this platform from other platforms
|
|
111
|
+
* @param other The platform object to be used in comparison.
|
|
112
|
+
* @returns A numeric value to indicate whether this object should be placed before the
|
|
113
|
+
* other.
|
|
114
|
+
*/
|
|
115
|
+
compareTo(other?: Platform): number;
|
|
116
|
+
/**
|
|
117
|
+
* This method is used to determine if this object meets the requirement for use, based
|
|
118
|
+
* on the exploitation and general type.
|
|
119
|
+
* @param exploit The string value for the exploitation.
|
|
120
|
+
* @param rpt The general type value for the sensor type for use.
|
|
121
|
+
* @returns A boolean value to indicate whether or not it should be used.
|
|
122
|
+
*/
|
|
123
|
+
use(exploit: string, rpt: GeneralTypes): boolean;
|
|
124
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Platform = exports.PlatformSensor = exports.GeneralTypes = exports.SensorExploitation = exports.SensorTimes = void 0;
|
|
4
|
+
const images_1 = require("../images");
|
|
5
|
+
/**
|
|
6
|
+
* This class defines the created object for sensor's standard times
|
|
7
|
+
*/
|
|
8
|
+
class SensorTimes {
|
|
9
|
+
preflightMinutes;
|
|
10
|
+
scheduledMinutes;
|
|
11
|
+
postflightMinutes;
|
|
12
|
+
executedMinutes;
|
|
13
|
+
constructor(st) {
|
|
14
|
+
this.postflightMinutes = (st) ? st.postflightMinutes : 0;
|
|
15
|
+
this.preflightMinutes = (st) ? st.preflightMinutes : 0;
|
|
16
|
+
this.scheduledMinutes = (st) ? st.scheduledMinutes : 0;
|
|
17
|
+
this.executedMinutes = (st && st.executedMinutes) ? st?.executedMinutes : undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.SensorTimes = SensorTimes;
|
|
21
|
+
/**
|
|
22
|
+
* This class defines the data members plus actions for a sensor's exploitation.
|
|
23
|
+
*/
|
|
24
|
+
class SensorExploitation {
|
|
25
|
+
exploitation;
|
|
26
|
+
showOnGEOINT;
|
|
27
|
+
showOnGSEG;
|
|
28
|
+
showOnMIST;
|
|
29
|
+
showOnXINT;
|
|
30
|
+
standardTimes;
|
|
31
|
+
constructor(se) {
|
|
32
|
+
this.exploitation = (se) ? se.exploitation : '';
|
|
33
|
+
this.showOnGEOINT = (se) ? se.showOnGEOINT : false;
|
|
34
|
+
this.showOnGSEG = (se) ? se.showOnGSEG : false;
|
|
35
|
+
this.showOnMIST = (se) ? se.showOnMIST : false;
|
|
36
|
+
this.showOnXINT = (se) ? se.showOnXINT : false;
|
|
37
|
+
this.standardTimes = (se) ? new SensorTimes(se.standardTimes) : new SensorTimes();
|
|
38
|
+
}
|
|
39
|
+
compareTo(other) {
|
|
40
|
+
if (other) {
|
|
41
|
+
return (this.exploitation < other.exploitation) ? -1 : 1;
|
|
42
|
+
}
|
|
43
|
+
return -1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.SensorExploitation = SensorExploitation;
|
|
47
|
+
var GeneralTypes;
|
|
48
|
+
(function (GeneralTypes) {
|
|
49
|
+
GeneralTypes[GeneralTypes["GEOINT"] = 1] = "GEOINT";
|
|
50
|
+
GeneralTypes[GeneralTypes["XINT"] = 2] = "XINT";
|
|
51
|
+
GeneralTypes[GeneralTypes["MIST"] = 3] = "MIST";
|
|
52
|
+
GeneralTypes[GeneralTypes["SYERS"] = 4] = "SYERS";
|
|
53
|
+
GeneralTypes[GeneralTypes["ADMIN"] = 9] = "ADMIN";
|
|
54
|
+
GeneralTypes[GeneralTypes["OTHER"] = 99] = "OTHER";
|
|
55
|
+
GeneralTypes[GeneralTypes["ALL"] = 9999] = "ALL";
|
|
56
|
+
})(GeneralTypes || (exports.GeneralTypes = GeneralTypes = {}));
|
|
57
|
+
/**
|
|
58
|
+
* This class defines the data members and actions associated with a platform's sensor
|
|
59
|
+
*/
|
|
60
|
+
class PlatformSensor {
|
|
61
|
+
id;
|
|
62
|
+
association;
|
|
63
|
+
generalType;
|
|
64
|
+
showTailNumber;
|
|
65
|
+
sortID;
|
|
66
|
+
exploitations;
|
|
67
|
+
imageTypes;
|
|
68
|
+
constructor(ps) {
|
|
69
|
+
this.id = (ps) ? ps.id : '';
|
|
70
|
+
this.association = (ps) ? ps.association : '';
|
|
71
|
+
this.generalType = (ps) ? ps.generalType : GeneralTypes.OTHER;
|
|
72
|
+
this.showTailNumber = (ps) ? ps.showTailNumber : false;
|
|
73
|
+
this.sortID = (ps) ? ps.sortID : 0;
|
|
74
|
+
if (ps && ps.exploitations) {
|
|
75
|
+
this.exploitations = [];
|
|
76
|
+
ps.exploitations.forEach(ex => {
|
|
77
|
+
this.exploitations?.push(new SensorExploitation(ex));
|
|
78
|
+
});
|
|
79
|
+
this.exploitations.sort((a, b) => a.compareTo(b));
|
|
80
|
+
}
|
|
81
|
+
if (ps && ps.imageTypes) {
|
|
82
|
+
this.imageTypes = [];
|
|
83
|
+
ps.imageTypes.forEach(it => {
|
|
84
|
+
this.imageTypes?.push(new images_1.ImageType(it));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* This function will be used to sort this object as compared to another.
|
|
90
|
+
* @param other A Platform Sensor object to compare with
|
|
91
|
+
* @returns A numeric value to show whether this object is before or after the other.
|
|
92
|
+
*/
|
|
93
|
+
compareTo(other) {
|
|
94
|
+
if (other) {
|
|
95
|
+
return (this.sortID < other.sortID) ? -1 : 1;
|
|
96
|
+
}
|
|
97
|
+
return -1;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* This method is used to determine if this object meets the requirement for use, based
|
|
101
|
+
* on the exploitation and general type.
|
|
102
|
+
* @param exploit The string value for the exploitation.
|
|
103
|
+
* @param rpt The general type value for the sensor type for use.
|
|
104
|
+
* @returns A boolean value to indicate whether or not it should be used.
|
|
105
|
+
*/
|
|
106
|
+
use(exploit, rpt) {
|
|
107
|
+
let answer = false;
|
|
108
|
+
if (rpt <= 0 || rpt > GeneralTypes.SYERS) {
|
|
109
|
+
rpt = GeneralTypes.ALL;
|
|
110
|
+
}
|
|
111
|
+
if (this.exploitations) {
|
|
112
|
+
this.exploitations.forEach(exp => {
|
|
113
|
+
if ((exp.exploitation.toLowerCase().indexOf(exploit.toLowerCase()) >= 0)
|
|
114
|
+
&& (rpt === GeneralTypes.ALL || (rpt === GeneralTypes.XINT && exp.showOnXINT)
|
|
115
|
+
|| (rpt === GeneralTypes.GEOINT && exp.showOnGEOINT)
|
|
116
|
+
|| (rpt === GeneralTypes.SYERS && exp.showOnGSEG)
|
|
117
|
+
|| (rpt === GeneralTypes.MIST && exp.showOnMIST))) {
|
|
118
|
+
answer = true;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return answer;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.PlatformSensor = PlatformSensor;
|
|
126
|
+
/**
|
|
127
|
+
* This class defines the data members plus actions for a platform object
|
|
128
|
+
*/
|
|
129
|
+
class Platform {
|
|
130
|
+
id;
|
|
131
|
+
sensors;
|
|
132
|
+
sortID;
|
|
133
|
+
constructor(pl) {
|
|
134
|
+
this.id = (pl) ? pl.id : '';
|
|
135
|
+
this.sensors = [];
|
|
136
|
+
if (pl && pl.sensors.length > 0) {
|
|
137
|
+
pl.sensors.forEach(sen => {
|
|
138
|
+
this.sensors.push(new PlatformSensor(sen));
|
|
139
|
+
});
|
|
140
|
+
this.sensors.sort((a, b) => a.compareTo(b));
|
|
141
|
+
}
|
|
142
|
+
this.sortID = (pl) ? pl.sortID : 0;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* This function will be used in sorting this platform from other platforms
|
|
146
|
+
* @param other The platform object to be used in comparison.
|
|
147
|
+
* @returns A numeric value to indicate whether this object should be placed before the
|
|
148
|
+
* other.
|
|
149
|
+
*/
|
|
150
|
+
compareTo(other) {
|
|
151
|
+
if (other) {
|
|
152
|
+
return (this.sortID < other.sortID) ? -1 : 1;
|
|
153
|
+
}
|
|
154
|
+
return -1;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* This method is used to determine if this object meets the requirement for use, based
|
|
158
|
+
* on the exploitation and general type.
|
|
159
|
+
* @param exploit The string value for the exploitation.
|
|
160
|
+
* @param rpt The general type value for the sensor type for use.
|
|
161
|
+
* @returns A boolean value to indicate whether or not it should be used.
|
|
162
|
+
*/
|
|
163
|
+
use(exploit, rpt) {
|
|
164
|
+
if (rpt < GeneralTypes.GEOINT || rpt > GeneralTypes.SYERS) {
|
|
165
|
+
rpt = GeneralTypes.ALL;
|
|
166
|
+
}
|
|
167
|
+
let answer = false;
|
|
168
|
+
this.sensors.forEach(sen => {
|
|
169
|
+
if (sen.use(exploit, rpt)) {
|
|
170
|
+
answer = true;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
return answer;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
exports.Platform = Platform;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Classification, IClassification } from "./classifications";
|
|
2
|
+
import { Communication, ICommunication } from "./communications";
|
|
3
|
+
import { DCGS, IDCGS } from "./dcgs";
|
|
4
|
+
import { Exploitation, IExploitation } from "./exploitations";
|
|
5
|
+
import { GroundSystem, IGroundSystem } from "./groundSystems";
|
|
6
|
+
import { IPlatform, Platform } from "./platform";
|
|
7
|
+
/**
|
|
8
|
+
* This interface will define the data members for the overall system data obtained from
|
|
9
|
+
* a json document on the server. A class inplementation will also be included to allow
|
|
10
|
+
* all the data to be compiled, sorted and sent to the client.
|
|
11
|
+
*/
|
|
12
|
+
export interface ISystemInfo {
|
|
13
|
+
classifications?: IClassification[];
|
|
14
|
+
communications?: ICommunication[];
|
|
15
|
+
dCGSs?: IDCGS[];
|
|
16
|
+
exploitations?: IExploitation[];
|
|
17
|
+
groundSystems?: IGroundSystem[];
|
|
18
|
+
platforms?: IPlatform[];
|
|
19
|
+
}
|
|
20
|
+
export declare class SystemInfo implements ISystemInfo {
|
|
21
|
+
classifications?: Classification[] | undefined;
|
|
22
|
+
communications?: Communication[] | undefined;
|
|
23
|
+
dCGSs?: DCGS[] | undefined;
|
|
24
|
+
exploitations?: Exploitation[] | undefined;
|
|
25
|
+
groundSystems?: GroundSystem[] | undefined;
|
|
26
|
+
platforms?: Platform[] | undefined;
|
|
27
|
+
constructor(si?: ISystemInfo);
|
|
28
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SystemInfo = void 0;
|
|
4
|
+
const classifications_1 = require("./classifications");
|
|
5
|
+
const communications_1 = require("./communications");
|
|
6
|
+
const dcgs_1 = require("./dcgs");
|
|
7
|
+
const exploitations_1 = require("./exploitations");
|
|
8
|
+
const groundSystems_1 = require("./groundSystems");
|
|
9
|
+
const platform_1 = require("./platform");
|
|
10
|
+
class SystemInfo {
|
|
11
|
+
classifications;
|
|
12
|
+
communications;
|
|
13
|
+
dCGSs;
|
|
14
|
+
exploitations;
|
|
15
|
+
groundSystems;
|
|
16
|
+
platforms;
|
|
17
|
+
constructor(si) {
|
|
18
|
+
if (si) {
|
|
19
|
+
if (si.classifications) {
|
|
20
|
+
this.classifications = [];
|
|
21
|
+
si.classifications.forEach(cl => {
|
|
22
|
+
this.classifications?.push(new classifications_1.Classification(cl));
|
|
23
|
+
});
|
|
24
|
+
this.classifications.sort((a, b) => a.compareTo(b));
|
|
25
|
+
}
|
|
26
|
+
if (si.communications) {
|
|
27
|
+
this.communications = [];
|
|
28
|
+
si.communications.forEach(com => {
|
|
29
|
+
this.communications?.push(new communications_1.Communication(com));
|
|
30
|
+
});
|
|
31
|
+
this.communications.sort((a, b) => a.compareTo(b));
|
|
32
|
+
}
|
|
33
|
+
if (si.dCGSs) {
|
|
34
|
+
this.dCGSs = [];
|
|
35
|
+
si.dCGSs.forEach(d => {
|
|
36
|
+
this.dCGSs?.push(new dcgs_1.DCGS(d));
|
|
37
|
+
});
|
|
38
|
+
this.dCGSs.sort((a, b) => a.compareTo(b));
|
|
39
|
+
}
|
|
40
|
+
if (si.exploitations) {
|
|
41
|
+
this.exploitations = [];
|
|
42
|
+
si.exploitations.forEach(exp => {
|
|
43
|
+
this.exploitations?.push(new exploitations_1.Exploitation(exp));
|
|
44
|
+
});
|
|
45
|
+
this.exploitations.sort((a, b) => a.compareTo(b));
|
|
46
|
+
}
|
|
47
|
+
if (si.groundSystems) {
|
|
48
|
+
this.groundSystems = [];
|
|
49
|
+
si.groundSystems.forEach(gs => {
|
|
50
|
+
this.groundSystems?.push(new groundSystems_1.GroundSystem(gs));
|
|
51
|
+
});
|
|
52
|
+
this.groundSystems.sort((a, b) => a.compareTo(b));
|
|
53
|
+
}
|
|
54
|
+
if (si.platforms) {
|
|
55
|
+
this.platforms = [];
|
|
56
|
+
si.platforms.forEach(plat => {
|
|
57
|
+
this.platforms?.push(new platform_1.Platform(plat));
|
|
58
|
+
});
|
|
59
|
+
this.platforms.sort((a, b) => a.compareTo(b));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.SystemInfo = SystemInfo;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scheduler-node-models",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"main": "
|
|
5
|
-
"types": "
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"types": "index.d.ts",
|
|
6
6
|
"files": [
|
|
7
|
-
"/
|
|
7
|
+
"/"
|
|
8
8
|
],
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc",
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { LaborCode } from "../labor/laborcode";
|
|
2
|
+
import { EmployeeLaborCode, IEmployeeLaborCode } from "./labor";
|
|
3
|
+
import { ISchedule, Schedule, Workday } from "./workday";
|
|
4
|
+
/**
|
|
5
|
+
* Assignments are the first level of scheduling. It defines the current normal work
|
|
6
|
+
* schedule(s). It should start with the employee's initial hire date and the employee's
|
|
7
|
+
* last assignment will have the employee's departure date from the company. Each time an
|
|
8
|
+
* employee's schedule permanently changes, a new assignment needs to be created to
|
|
9
|
+
* maintain a work history.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* This interface defines a work assignment for an employee.
|
|
13
|
+
*/
|
|
14
|
+
export interface IAssignment {
|
|
15
|
+
id: number;
|
|
16
|
+
site: string;
|
|
17
|
+
workcenter: string;
|
|
18
|
+
startDate: Date;
|
|
19
|
+
endDate: Date;
|
|
20
|
+
schedules: ISchedule[];
|
|
21
|
+
rotationdate?: Date;
|
|
22
|
+
rotationdays?: number;
|
|
23
|
+
laborcodes?: IEmployeeLaborCode[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* This class defines an employee's work assignment. The data members are:
|
|
27
|
+
* id (numeric value for the key to this assignment)
|
|
28
|
+
* site (the string value for the work site within the team)
|
|
29
|
+
* workcenter (the string value for the work center the schedule applies to)
|
|
30
|
+
* startdate (date object to define the start of the assignment.)
|
|
31
|
+
* enddate (date object to define the end of an assignment, to no longer use)
|
|
32
|
+
* rotationdate (Optional - defines a base date when multiple schedule are used in an
|
|
33
|
+
* assignment, especially for schedules that rotate every ### number of days.)
|
|
34
|
+
* rotationdays (Optional - defines the number of days to rotate upon from the base
|
|
35
|
+
* rotation date. It must be a multiple of the number of days in the schedule.)
|
|
36
|
+
* laborcodes (an array of employeelaborcode objects to define the assigned labor codes
|
|
37
|
+
* for consideration)
|
|
38
|
+
*/
|
|
39
|
+
export declare class Assignment {
|
|
40
|
+
id: number;
|
|
41
|
+
site: string;
|
|
42
|
+
workcenter: string;
|
|
43
|
+
startDate: Date;
|
|
44
|
+
endDate: Date;
|
|
45
|
+
schedules: Schedule[];
|
|
46
|
+
rotationdate?: Date;
|
|
47
|
+
rotationdays?: number;
|
|
48
|
+
laborcodes: EmployeeLaborCode[];
|
|
49
|
+
constructor(asgmt?: IAssignment);
|
|
50
|
+
/**
|
|
51
|
+
* This function is used in sorting of the assignment from others. It used the
|
|
52
|
+
* assignment start and end dates for sorting comparison.
|
|
53
|
+
* @param other An assignment object to use in comparison
|
|
54
|
+
* @returns A numeric value to indicate whether this object is before or after the other
|
|
55
|
+
* object. -1 is before, 1 for after or 0 for equal.
|
|
56
|
+
*/
|
|
57
|
+
compareTo(other?: Assignment): number;
|
|
58
|
+
/**
|
|
59
|
+
* This function is used to determine if this assignment should be used at a particular
|
|
60
|
+
* site and date.
|
|
61
|
+
* @param site The string value of a site designation.
|
|
62
|
+
* @param date The date object to compare with the start and end dates.
|
|
63
|
+
* @returns The boolean value for whether this assignment is for a site and between
|
|
64
|
+
* this start and end dates.
|
|
65
|
+
*/
|
|
66
|
+
useSiteAssignment(site: string, date: Date): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* This function is used to determine if this assignment should be used based on the
|
|
69
|
+
* date provided.
|
|
70
|
+
* @param date The date object used in comparision
|
|
71
|
+
* @returns The boolean value for whether this assignment is between the start and end
|
|
72
|
+
* dates.
|
|
73
|
+
*/
|
|
74
|
+
useAssignment(date: Date, date2?: Date, labor?: LaborCode): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* This function will provide the daily standard work day hours, based on a count of
|
|
77
|
+
* the schedule's workdays and a 40 hour work week.
|
|
78
|
+
* @returns A numeric value for the standard day's work hours.
|
|
79
|
+
*/
|
|
80
|
+
getStandardWorkHours(): number;
|
|
81
|
+
/**
|
|
82
|
+
* This function is used to provide the workday object for a particular date.
|
|
83
|
+
* @param date The date object used to find the workday
|
|
84
|
+
* @returns A workday object if the schedule can be used or undefined if not.
|
|
85
|
+
*/
|
|
86
|
+
getWorkday(date: Date): Workday | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* This function adds a new schedule with a set number of days in the schedule.
|
|
89
|
+
* @param days The numeric value for the number of workday objects within the schedule.
|
|
90
|
+
* This must be a multiple of 7.
|
|
91
|
+
*/
|
|
92
|
+
addSchedule(days: number): Error | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* This function will change the number of workdays within an existing schedule.
|
|
95
|
+
* @param schID The numeric value for the schedule's identifier to change.
|
|
96
|
+
* @param days The numeric value for the number of workday objects to change the
|
|
97
|
+
* schedule to. This must be a multiple of 7.
|
|
98
|
+
*/
|
|
99
|
+
changeScheduleDays(schID: number, days: number): Error | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* This function is used to completely change a schedule's workday
|
|
102
|
+
* @param schID The numeric value to identify the schedule to update
|
|
103
|
+
* @param wdID The numeric value to identity which of the schedule's workday to change
|
|
104
|
+
* @param wkctr The string value for the new workcenter.
|
|
105
|
+
* @param code The string value for the new work code.
|
|
106
|
+
* @param hours The numeric valur for the hours to work.
|
|
107
|
+
*/
|
|
108
|
+
changeWorkday(schID: number, wdID: number, wkctr: string, code: string, hours: number): void;
|
|
109
|
+
/**
|
|
110
|
+
* This function is used to update a single field in a schedule's workday.
|
|
111
|
+
* @param schID The numeric value to identify the schedule to update
|
|
112
|
+
* @param wdID The numeric value to identify which of the schedule's workdays to update
|
|
113
|
+
* @param field The string value to identify which field within the workday to update
|
|
114
|
+
* @param value The string value (string or numeric string) to update the value of the
|
|
115
|
+
* data member.
|
|
116
|
+
*/
|
|
117
|
+
updateWorkday(schID: number, wdID: number, field: string, value: string): void;
|
|
118
|
+
/**
|
|
119
|
+
* This function is used to remove a schedule from this assignment. An assignment must
|
|
120
|
+
* have a minimum of one schedule, so if removal put the schedule list below 1, a new
|
|
121
|
+
* schedule is added and empty.
|
|
122
|
+
* @param schid The numeric value key for the schedule to remove.
|
|
123
|
+
*/
|
|
124
|
+
removeSchedule(schid: number): void;
|
|
125
|
+
/**
|
|
126
|
+
* This function will add a new labor code (charge number and extension) to this
|
|
127
|
+
* assignment's labor code list.
|
|
128
|
+
* @param chgno The string value for the charge number to add
|
|
129
|
+
* @param ext The string value for the extension to add
|
|
130
|
+
*/
|
|
131
|
+
addLaborCode(chgno: string, ext: string): void;
|
|
132
|
+
/**
|
|
133
|
+
* This function will remove an employee labor code from the list, based on its
|
|
134
|
+
* charge number and extension.
|
|
135
|
+
* @param chgno The string value for the charge number to remove
|
|
136
|
+
* @param ext The string value for the extension to remove
|
|
137
|
+
*/
|
|
138
|
+
removeLaborCode(chgno: string, ext: string): void;
|
|
139
|
+
}
|