scheduler-models 1.3.37 → 1.3.39
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 +1 -1
- package/scheduler/sites/schedule/index.d.ts +5 -0
- package/scheduler/sites/schedule/index.js +22 -0
- package/scheduler/sites/schedule/index.js.map +1 -0
- package/scheduler/sites/schedule/scheduleShift.d.ts +20 -0
- package/scheduler/sites/schedule/scheduleShift.js +73 -0
- package/scheduler/sites/schedule/scheduleShift.js.map +1 -0
- package/scheduler/sites/schedule/scheduleShiftCount.d.ts +11 -0
- package/scheduler/sites/schedule/scheduleShiftCount.js +22 -0
- package/scheduler/sites/schedule/scheduleShiftCount.js.map +1 -0
- package/scheduler/sites/schedule/scheduleWorkcenter.d.ts +4 -1
- package/scheduler/sites/schedule/scheduleWorkcenter.js +9 -0
- package/scheduler/sites/schedule/scheduleWorkcenter.js.map +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
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("./scheduleDay"), exports);
|
|
18
|
+
__exportStar(require("./scheduleEmployee"), exports);
|
|
19
|
+
__exportStar(require("./scheduleWorkcenter"), exports);
|
|
20
|
+
__exportStar(require("./scheduleShift"), exports);
|
|
21
|
+
__exportStar(require("./scheduleShiftCount"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/scheduler/sites/schedule/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,qDAAmC;AACnC,uDAAqC;AACrC,kDAAgC;AAChC,uDAAqC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IScheduleShiftCount, ScheduleShiftCount } from "./scheduleShiftCount";
|
|
2
|
+
export interface IScheduleShift {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
codes: string[];
|
|
6
|
+
minimums: number;
|
|
7
|
+
counts: IScheduleShiftCount[];
|
|
8
|
+
}
|
|
9
|
+
export declare class ScheduleShift implements IScheduleShift {
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
codes: string[];
|
|
13
|
+
minimums: number;
|
|
14
|
+
counts: ScheduleShiftCount[];
|
|
15
|
+
constructor(shft?: IScheduleShift);
|
|
16
|
+
compareTo(other?: ScheduleShift): number;
|
|
17
|
+
setCounts(date: Date): void;
|
|
18
|
+
addDayCount(code: string, date: Date): boolean;
|
|
19
|
+
meetsMinimums(date: Date): boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScheduleShift = void 0;
|
|
4
|
+
const scheduleShiftCount_1 = require("./scheduleShiftCount");
|
|
5
|
+
class ScheduleShift {
|
|
6
|
+
id;
|
|
7
|
+
name;
|
|
8
|
+
codes;
|
|
9
|
+
minimums;
|
|
10
|
+
counts;
|
|
11
|
+
constructor(shft) {
|
|
12
|
+
this.id = (shft) ? shft.id : 0;
|
|
13
|
+
this.name = (shft) ? shft.name : '';
|
|
14
|
+
this.minimums = (shft) ? shft.minimums : 0;
|
|
15
|
+
this.codes = [];
|
|
16
|
+
if (shft) {
|
|
17
|
+
shft.codes.forEach(cd => {
|
|
18
|
+
this.codes.push(cd);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
this.counts = [];
|
|
22
|
+
if (shft) {
|
|
23
|
+
shft.counts.forEach(count => {
|
|
24
|
+
this.counts.push(new scheduleShiftCount_1.ScheduleShiftCount(count));
|
|
25
|
+
});
|
|
26
|
+
this.counts.sort((a, b) => a.compareTo(b));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
compareTo(other) {
|
|
30
|
+
if (other) {
|
|
31
|
+
return (this.id < other.id) ? -1 : 1;
|
|
32
|
+
}
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
setCounts(date) {
|
|
36
|
+
this.counts = [];
|
|
37
|
+
let start = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1));
|
|
38
|
+
const end = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + 1, 1));
|
|
39
|
+
while (start.getTime() < end.getTime()) {
|
|
40
|
+
const newCount = new scheduleShiftCount_1.ScheduleShiftCount({
|
|
41
|
+
day: start.getUTCDate(),
|
|
42
|
+
count: 0
|
|
43
|
+
});
|
|
44
|
+
this.counts.push(newCount);
|
|
45
|
+
start = new Date(start.getTime() + (24 * 3600000));
|
|
46
|
+
}
|
|
47
|
+
this.counts.sort((a, b) => a.compareTo(b));
|
|
48
|
+
}
|
|
49
|
+
addDayCount(code, date) {
|
|
50
|
+
let found = false;
|
|
51
|
+
this.codes.forEach(cd => {
|
|
52
|
+
if (cd.toLowerCase() === code.toLowerCase()) {
|
|
53
|
+
found = true;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
if (found) {
|
|
57
|
+
this.counts.forEach(count => {
|
|
58
|
+
if (count.day === date.getUTCDate()) {
|
|
59
|
+
count.increment();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return found;
|
|
64
|
+
}
|
|
65
|
+
meetsMinimums(date) {
|
|
66
|
+
if (this.counts.length > date.getUTCDate()) {
|
|
67
|
+
return this.counts[date.getUTCDate()].count > this.minimums;
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.ScheduleShift = ScheduleShift;
|
|
73
|
+
//# sourceMappingURL=scheduleShift.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduleShift.js","sourceRoot":"","sources":["../../../../src/scheduler/sites/schedule/scheduleShift.ts"],"names":[],"mappings":";;;AAAA,6DAA+E;AAU/E,MAAa,aAAa;IACjB,EAAE,CAAS;IACX,IAAI,CAAS;IACb,KAAK,CAAW;IAChB,QAAQ,CAAS;IACjB,MAAM,CAAuB;IAEpC,YAAY,IAAqB;QAC/B,IAAI,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;gBACtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACL,CAAC;Q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|
+
count: number;
|
|
4
|
+
}
|
|
5
|
+
export declare class ScheduleShiftCount implements IScheduleShiftCount {
|
|
6
|
+
day: number;
|
|
7
|
+
count: number;
|
|
8
|
+
constructor(c?: IScheduleShiftCount);
|
|
9
|
+
compareTo(other?: ScheduleShiftCount): number;
|
|
10
|
+
increment(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScheduleShiftCount = void 0;
|
|
4
|
+
class ScheduleShiftCount {
|
|
5
|
+
day;
|
|
6
|
+
count;
|
|
7
|
+
constructor(c) {
|
|
8
|
+
this.day = (c) ? c.day : 0;
|
|
9
|
+
this.count = (c) ? c.count : 0;
|
|
10
|
+
}
|
|
11
|
+
compareTo(other) {
|
|
12
|
+
if (other) {
|
|
13
|
+
return (this.day < other.day) ? -1 : 1;
|
|
14
|
+
}
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
17
|
+
increment() {
|
|
18
|
+
this.count++;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ScheduleShiftCount = ScheduleShiftCount;
|
|
22
|
+
//# sourceMappingURL=scheduleShiftCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduleShiftCount.js","sourceRoot":"","sources":["../../../../src/scheduler/sites/schedule/scheduleShiftCount.ts"],"names":[],"mappings":";;;AAKA,MAAa,kBAAkB;IACtB,GAAG,CAAS;IACZ,KAAK,CAAS;IAErB,YAAY,CAAuB;QACjC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;IAED,SAAS,CAAC,KAA0B;QAClC,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IAED,SAAS;QACP,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF;AAnBD,gDAmBC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { IScheduleEmployee, ScheduleEmployee } from "./scheduleEmployee";
|
|
2
|
+
import { IScheduleShift, ScheduleShift } from "./scheduleShift";
|
|
2
3
|
export interface IScheduleWorkcenter {
|
|
3
4
|
id: number;
|
|
4
5
|
name: string;
|
|
5
6
|
employees: IScheduleEmployee[];
|
|
7
|
+
shifts: IScheduleShift[];
|
|
6
8
|
}
|
|
7
|
-
export declare class ScheduleWorkcenter {
|
|
9
|
+
export declare class ScheduleWorkcenter implements IScheduleWorkcenter {
|
|
8
10
|
id: number;
|
|
9
11
|
name: string;
|
|
10
12
|
employees: ScheduleEmployee[];
|
|
13
|
+
shifts: ScheduleShift[];
|
|
11
14
|
constructor(wc?: IScheduleWorkcenter);
|
|
12
15
|
compareTo(other?: ScheduleWorkcenter): number;
|
|
13
16
|
}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ScheduleWorkcenter = void 0;
|
|
4
4
|
const scheduleEmployee_1 = require("./scheduleEmployee");
|
|
5
|
+
const scheduleShift_1 = require("./scheduleShift");
|
|
5
6
|
class ScheduleWorkcenter {
|
|
6
7
|
id;
|
|
7
8
|
name;
|
|
8
9
|
employees;
|
|
10
|
+
shifts;
|
|
9
11
|
constructor(wc) {
|
|
10
12
|
this.id = (wc) ? wc.id : 0;
|
|
11
13
|
this.name = (wc) ? wc.name : '';
|
|
@@ -16,6 +18,13 @@ class ScheduleWorkcenter {
|
|
|
16
18
|
});
|
|
17
19
|
this.employees.sort((a, b) => a.compareTo(b));
|
|
18
20
|
}
|
|
21
|
+
this.shifts = [];
|
|
22
|
+
if (wc && wc.shifts.length > 0) {
|
|
23
|
+
wc.shifts.forEach(s => {
|
|
24
|
+
this.shifts.push(new scheduleShift_1.ScheduleShift(s));
|
|
25
|
+
});
|
|
26
|
+
this.shifts.sort((a, b) => a.compareTo(b));
|
|
27
|
+
}
|
|
19
28
|
}
|
|
20
29
|
compareTo(other) {
|
|
21
30
|
if (other) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduleWorkcenter.js","sourceRoot":"","sources":["../../../../src/scheduler/sites/schedule/scheduleWorkcenter.ts"],"names":[],"mappings":";;;AAAA,yDAAyE;
|
|
1
|
+
{"version":3,"file":"scheduleWorkcenter.js","sourceRoot":"","sources":["../../../../src/scheduler/sites/schedule/scheduleWorkcenter.ts"],"names":[],"mappings":";;;AAAA,yDAAyE;AACzE,mDAAgE;AAShE,MAAa,kBAAkB;IACtB,EAAE,CAAS;IACX,IAAI,CAAS;IACb,SAAS,CAAqB;IAC9B,MAAM,CAAkB;IAE/B,YAAY,EAAwB;QAClC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBACzB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,mCAAgB,CAAC,GAAG,CAAC,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