@things-factory/work-shift 10.1.248 → 10.1.250

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.
Files changed (87) hide show
  1. package/dist-client/bootstrap.d.ts +1 -0
  2. package/dist-client/bootstrap.js +6 -0
  3. package/dist-client/bootstrap.js.map +1 -0
  4. package/dist-client/index.d.ts +0 -0
  5. package/dist-client/index.js +2 -0
  6. package/dist-client/index.js.map +1 -0
  7. package/dist-client/pages/work-shift.d.ts +105 -0
  8. package/dist-client/pages/work-shift.js +1144 -0
  9. package/dist-client/pages/work-shift.js.map +1 -0
  10. package/dist-client/route.d.ts +1 -0
  11. package/dist-client/route.js +8 -0
  12. package/dist-client/route.js.map +1 -0
  13. package/dist-client/shift-coverage.d.ts +102 -0
  14. package/dist-client/shift-coverage.js +196 -0
  15. package/dist-client/shift-coverage.js.map +1 -0
  16. package/dist-client/shift-editing.d.ts +80 -0
  17. package/dist-client/shift-editing.js +212 -0
  18. package/dist-client/shift-editing.js.map +1 -0
  19. package/dist-client/shift-revisions.d.ts +73 -0
  20. package/dist-client/shift-revisions.js +64 -0
  21. package/dist-client/shift-revisions.js.map +1 -0
  22. package/dist-client/tsconfig.tsbuildinfo +1 -0
  23. package/dist-server/controllers/index.d.ts +2 -0
  24. package/dist-server/controllers/index.js +6 -0
  25. package/dist-server/controllers/index.js.map +1 -0
  26. package/dist-server/controllers/work-shift-range.d.ts +28 -0
  27. package/dist-server/controllers/work-shift-range.js +65 -0
  28. package/dist-server/controllers/work-shift-range.js.map +1 -0
  29. package/dist-server/controllers/work-shift-schedule.d.ts +5 -0
  30. package/dist-server/controllers/work-shift-schedule.js +60 -0
  31. package/dist-server/controllers/work-shift-schedule.js.map +1 -0
  32. package/dist-server/index.d.ts +2 -0
  33. package/dist-server/index.js +19 -0
  34. package/dist-server/index.js.map +1 -0
  35. package/dist-server/service/index.d.ts +13 -0
  36. package/dist-server/service/index.js +33 -0
  37. package/dist-server/service/index.js.map +1 -0
  38. package/dist-server/service/work-shift/days-of-week.d.ts +30 -0
  39. package/dist-server/service/work-shift/days-of-week.js +74 -0
  40. package/dist-server/service/work-shift/days-of-week.js.map +1 -0
  41. package/dist-server/service/work-shift/index.d.ts +9 -0
  42. package/dist-server/service/work-shift/index.js +20 -0
  43. package/dist-server/service/work-shift/index.js.map +1 -0
  44. package/dist-server/service/work-shift/shift-occurrence.d.ts +19 -0
  45. package/dist-server/service/work-shift/shift-occurrence.js +34 -0
  46. package/dist-server/service/work-shift/shift-occurrence.js.map +1 -0
  47. package/dist-server/service/work-shift/work-shift-arrangement.d.ts +10 -0
  48. package/dist-server/service/work-shift/work-shift-arrangement.js +40 -0
  49. package/dist-server/service/work-shift/work-shift-arrangement.js.map +1 -0
  50. package/dist-server/service/work-shift/work-shift-baseline.d.ts +23 -0
  51. package/dist-server/service/work-shift/work-shift-baseline.js +55 -0
  52. package/dist-server/service/work-shift/work-shift-baseline.js.map +1 -0
  53. package/dist-server/service/work-shift/work-shift-change-approval.d.ts +14 -0
  54. package/dist-server/service/work-shift/work-shift-change-approval.js +64 -0
  55. package/dist-server/service/work-shift/work-shift-change-approval.js.map +1 -0
  56. package/dist-server/service/work-shift/work-shift-content.d.ts +18 -0
  57. package/dist-server/service/work-shift/work-shift-content.js +62 -0
  58. package/dist-server/service/work-shift/work-shift-content.js.map +1 -0
  59. package/dist-server/service/work-shift/work-shift-lifecycle-resolver.d.ts +68 -0
  60. package/dist-server/service/work-shift/work-shift-lifecycle-resolver.js +89 -0
  61. package/dist-server/service/work-shift/work-shift-lifecycle-resolver.js.map +1 -0
  62. package/dist-server/service/work-shift/work-shift-lifecycle.d.ts +229 -0
  63. package/dist-server/service/work-shift/work-shift-lifecycle.js +672 -0
  64. package/dist-server/service/work-shift/work-shift-lifecycle.js.map +1 -0
  65. package/dist-server/service/work-shift/work-shift-mutation.d.ts +16 -0
  66. package/dist-server/service/work-shift/work-shift-mutation.js +77 -0
  67. package/dist-server/service/work-shift/work-shift-mutation.js.map +1 -0
  68. package/dist-server/service/work-shift/work-shift-query.d.ts +14 -0
  69. package/dist-server/service/work-shift/work-shift-query.js +116 -0
  70. package/dist-server/service/work-shift/work-shift-query.js.map +1 -0
  71. package/dist-server/service/work-shift/work-shift-revision-service.d.ts +32 -0
  72. package/dist-server/service/work-shift/work-shift-revision-service.js +89 -0
  73. package/dist-server/service/work-shift/work-shift-revision-service.js.map +1 -0
  74. package/dist-server/service/work-shift/work-shift-revision.d.ts +85 -0
  75. package/dist-server/service/work-shift/work-shift-revision.js +337 -0
  76. package/dist-server/service/work-shift/work-shift-revision.js.map +1 -0
  77. package/dist-server/service/work-shift/work-shift-selection.d.ts +50 -0
  78. package/dist-server/service/work-shift/work-shift-selection.js +65 -0
  79. package/dist-server/service/work-shift/work-shift-selection.js.map +1 -0
  80. package/dist-server/service/work-shift/work-shift-type.d.ts +26 -0
  81. package/dist-server/service/work-shift/work-shift-type.js +77 -0
  82. package/dist-server/service/work-shift/work-shift-type.js.map +1 -0
  83. package/dist-server/service/work-shift/work-shift.d.ts +56 -0
  84. package/dist-server/service/work-shift/work-shift.js +109 -0
  85. package/dist-server/service/work-shift/work-shift.js.map +1 -0
  86. package/dist-server/tsconfig.tsbuildinfo +1 -0
  87. package/package.json +4 -4
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WorkShiftInfo = exports.WorkShiftList = exports.WorkShiftPatch = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const work_shift_1 = require("./work-shift");
7
+ let WorkShiftPatch = class WorkShiftPatch {
8
+ };
9
+ exports.WorkShiftPatch = WorkShiftPatch;
10
+ tslib_1.__decorate([
11
+ (0, type_graphql_1.Field)(),
12
+ tslib_1.__metadata("design:type", String)
13
+ ], WorkShiftPatch.prototype, "name", void 0);
14
+ tslib_1.__decorate([
15
+ (0, type_graphql_1.Field)({ nullable: true }),
16
+ tslib_1.__metadata("design:type", String)
17
+ ], WorkShiftPatch.prototype, "description", void 0);
18
+ tslib_1.__decorate([
19
+ (0, type_graphql_1.Field)(),
20
+ tslib_1.__metadata("design:type", Number)
21
+ ], WorkShiftPatch.prototype, "fromDate", void 0);
22
+ tslib_1.__decorate([
23
+ (0, type_graphql_1.Field)(),
24
+ tslib_1.__metadata("design:type", String)
25
+ ], WorkShiftPatch.prototype, "fromTime", void 0);
26
+ tslib_1.__decorate([
27
+ (0, type_graphql_1.Field)(),
28
+ tslib_1.__metadata("design:type", Number)
29
+ ], WorkShiftPatch.prototype, "toDate", void 0);
30
+ tslib_1.__decorate([
31
+ (0, type_graphql_1.Field)(),
32
+ tslib_1.__metadata("design:type", String)
33
+ ], WorkShiftPatch.prototype, "toTime", void 0);
34
+ tslib_1.__decorate([
35
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Weekdays this shift runs on as a CSV of 0(Sun)..6(Sat). Empty means every day' }),
36
+ tslib_1.__metadata("design:type", String)
37
+ ], WorkShiftPatch.prototype, "daysOfWeek", void 0);
38
+ exports.WorkShiftPatch = WorkShiftPatch = tslib_1.__decorate([
39
+ (0, type_graphql_1.InputType)()
40
+ ], WorkShiftPatch);
41
+ let WorkShiftList = class WorkShiftList {
42
+ };
43
+ exports.WorkShiftList = WorkShiftList;
44
+ tslib_1.__decorate([
45
+ (0, type_graphql_1.Field)(type => [work_shift_1.WorkShift]),
46
+ tslib_1.__metadata("design:type", Array)
47
+ ], WorkShiftList.prototype, "items", void 0);
48
+ tslib_1.__decorate([
49
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
50
+ tslib_1.__metadata("design:type", Number)
51
+ ], WorkShiftList.prototype, "total", void 0);
52
+ exports.WorkShiftList = WorkShiftList = tslib_1.__decorate([
53
+ (0, type_graphql_1.ObjectType)()
54
+ ], WorkShiftList);
55
+ let WorkShiftInfo = class WorkShiftInfo {
56
+ };
57
+ exports.WorkShiftInfo = WorkShiftInfo;
58
+ tslib_1.__decorate([
59
+ (0, type_graphql_1.Field)({ nullable: true }),
60
+ tslib_1.__metadata("design:type", String)
61
+ ], WorkShiftInfo.prototype, "workDate", void 0);
62
+ tslib_1.__decorate([
63
+ (0, type_graphql_1.Field)({ nullable: true }),
64
+ tslib_1.__metadata("design:type", String)
65
+ ], WorkShiftInfo.prototype, "workShift", void 0);
66
+ tslib_1.__decorate([
67
+ (0, type_graphql_1.Field)(type => [Date], { nullable: true }),
68
+ tslib_1.__metadata("design:type", Array)
69
+ ], WorkShiftInfo.prototype, "dateRange", void 0);
70
+ tslib_1.__decorate([
71
+ (0, type_graphql_1.Field)(type => [Date], { nullable: true }),
72
+ tslib_1.__metadata("design:type", Array)
73
+ ], WorkShiftInfo.prototype, "shiftRange", void 0);
74
+ exports.WorkShiftInfo = WorkShiftInfo = tslib_1.__decorate([
75
+ (0, type_graphql_1.ObjectType)()
76
+ ], WorkShiftInfo);
77
+ //# sourceMappingURL=work-shift-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work-shift-type.js","sourceRoot":"","sources":["../../../server/service/work-shift/work-shift-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AACtF,6CAA2D;AAGpD,IAAM,cAAc,GAApB,MAAM,cAAc;CA2B1B,CAAA;AA3BY,wCAAc;AAEzB;IADC,IAAA,oBAAK,GAAE;;4CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAGpB;IADC,IAAA,oBAAK,GAAE;;gDACmB;AAG3B;IADC,IAAA,oBAAK,GAAE;;gDACQ;AAGhB;IADC,IAAA,oBAAK,GAAE;;8CACiB;AAGzB;IADC,IAAA,oBAAK,GAAE;;8CACM;AASd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+EAA+E,EAAE,CAAC;;kDACrG;yBA1BR,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CA2B1B;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AANY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,sBAAS,CAAC,CAAC;;4CACT;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;4CACN;wBALF,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAYzB,CAAA;AAZY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACR;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACxB;AAGlB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACvB;wBAXR,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAYzB","sourcesContent":["import { Field, ID, InputType, Int, ObjectType, registerEnumType } from 'type-graphql'\nimport { WorkShift, WorkShiftDateType } from './work-shift'\n\n@InputType()\nexport class WorkShiftPatch {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field()\n fromDate: WorkShiftDateType\n\n @Field()\n fromTime: string\n\n @Field()\n toDate: WorkShiftDateType\n\n @Field()\n toTime: string\n\n /**\n * Which weekdays this shift runs on — 0 Sunday … 6 Saturday, empty for every day.\n *\n * Nullable so that a client written before this field existed keeps working: an\n * absent value means every day, which is exactly what those clients meant.\n */\n @Field({ nullable: true, description: 'Weekdays this shift runs on as a CSV of 0(Sun)..6(Sat). Empty means every day' })\n daysOfWeek?: string\n}\n\n@ObjectType()\nexport class WorkShiftList {\n @Field(type => [WorkShift])\n items: WorkShift[]\n\n @Field(type => Int)\n total: number\n}\n\n@ObjectType()\nexport class WorkShiftInfo {\n @Field({ nullable: true })\n workDate?: string\n\n @Field({ nullable: true })\n workShift?: string\n\n @Field(type => [Date], { nullable: true })\n dateRange?: Date[]\n\n @Field(type => [Date], { nullable: true })\n shiftRange?: Date[]\n}\n"]}
@@ -0,0 +1,56 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ export declare enum WorkShiftDateType {
4
+ TheDayBefore = -1,
5
+ TheDay = 0,
6
+ TheDayAfter = 1
7
+ }
8
+ export declare class WorkShift {
9
+ readonly id: string;
10
+ domain?: Domain;
11
+ domainId?: string;
12
+ name: string;
13
+ description?: string;
14
+ fromDate: WorkShiftDateType;
15
+ fromTime: string;
16
+ toDate: WorkShiftDateType;
17
+ toTime: string;
18
+ /**
19
+ * Which weekdays this shift runs on — 0 Sunday … 6 Saturday. Empty means every day.
20
+ *
21
+ * ── What was wrong without it (2026-09-07) ────────────────────────────────
22
+ * A shift could only say what time of day it covers, never which days. So a site that
23
+ * rests on Saturday and Sunday was modelled as running 24 hours a day, seven days a
24
+ * week, and everything computed from available time inflated: OEE's planned production
25
+ * time, capacity, and the throughput predicted from them.
26
+ *
27
+ * The standard vocabulary already carried this. `WorkCalendarEntry` in
28
+ * `@operato/ops-contract` — ISA-95's `WorkCalendarEntryType` — has `daysOfWeek`, and
29
+ * operato-plant hands these rows to `equipment.workCalendar` as those entries. The
30
+ * field arrived at the boundary empty because there was nowhere here to read it from.
31
+ *
32
+ * ── Why a string and not a relation or an array column ────────────────────
33
+ * things-factory runs on five drivers and array columns are not portable across them
34
+ * (postgres spells them one way, sqlite has none). A short CSV of digits — `1,2,3,4,5`
35
+ * for a weekday-only shift — reads the same everywhere and is legible in a table
36
+ * during an incident.
37
+ *
38
+ * ── Empty means every day, and that is not the same as none ───────────────
39
+ * Existing rows have no value here and must keep behaving exactly as before, so absent
40
+ * reads as "every day". A shift that runs on no day at all is not a thing anyone means;
41
+ * if that ever needs saying, it is a shift that should be deleted or deactivated.
42
+ *
43
+ * ── One-off dates do not belong here ──────────────────────────────────────
44
+ * A holiday, a shutdown week, a maintenance window on one particular date is an
45
+ * absolute interval, and `@things-factory/calendar` already stores those as `Event`
46
+ * rows with `startDateTime`/`endDateTime`. Putting them here as well would give the
47
+ * same fact two homes and split which screen a person registers August 15th on.
48
+ */
49
+ daysOfWeek?: string;
50
+ createdAt?: Date;
51
+ updatedAt?: Date;
52
+ creator?: User;
53
+ creatorId?: string;
54
+ updater?: User;
55
+ updaterId?: string;
56
+ }
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WorkShift = exports.WorkShiftDateType = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const typeorm_1 = require("typeorm");
6
+ const type_graphql_1 = require("type-graphql");
7
+ const shell_1 = require("@things-factory/shell");
8
+ const auth_base_1 = require("@things-factory/auth-base");
9
+ var WorkShiftDateType;
10
+ (function (WorkShiftDateType) {
11
+ WorkShiftDateType[WorkShiftDateType["TheDayBefore"] = -1] = "TheDayBefore";
12
+ WorkShiftDateType[WorkShiftDateType["TheDay"] = 0] = "TheDay";
13
+ WorkShiftDateType[WorkShiftDateType["TheDayAfter"] = 1] = "TheDayAfter";
14
+ })(WorkShiftDateType || (exports.WorkShiftDateType = WorkShiftDateType = {}));
15
+ (0, type_graphql_1.registerEnumType)(WorkShiftDateType, {
16
+ name: 'WorkShiftDateType',
17
+ description: 'enumeration of a shift date'
18
+ });
19
+ let WorkShift = class WorkShift {
20
+ };
21
+ exports.WorkShift = WorkShift;
22
+ tslib_1.__decorate([
23
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
24
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
25
+ tslib_1.__metadata("design:type", String)
26
+ ], WorkShift.prototype, "id", void 0);
27
+ tslib_1.__decorate([
28
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
29
+ (0, type_graphql_1.Field)(type => shell_1.Domain),
30
+ tslib_1.__metadata("design:type", shell_1.Domain)
31
+ ], WorkShift.prototype, "domain", void 0);
32
+ tslib_1.__decorate([
33
+ (0, typeorm_1.RelationId)((workShift) => workShift.domain),
34
+ tslib_1.__metadata("design:type", String)
35
+ ], WorkShift.prototype, "domainId", void 0);
36
+ tslib_1.__decorate([
37
+ (0, typeorm_1.Column)(),
38
+ (0, type_graphql_1.Field)(),
39
+ tslib_1.__metadata("design:type", String)
40
+ ], WorkShift.prototype, "name", void 0);
41
+ tslib_1.__decorate([
42
+ (0, typeorm_1.Column)({
43
+ nullable: true
44
+ }),
45
+ (0, type_graphql_1.Field)({ nullable: true }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], WorkShift.prototype, "description", void 0);
48
+ tslib_1.__decorate([
49
+ (0, typeorm_1.Column)(),
50
+ (0, type_graphql_1.Field)({ nullable: true }),
51
+ tslib_1.__metadata("design:type", Number)
52
+ ], WorkShift.prototype, "fromDate", void 0);
53
+ tslib_1.__decorate([
54
+ (0, typeorm_1.Column)(),
55
+ (0, type_graphql_1.Field)({ nullable: true }),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], WorkShift.prototype, "fromTime", void 0);
58
+ tslib_1.__decorate([
59
+ (0, typeorm_1.Column)(),
60
+ (0, type_graphql_1.Field)({ nullable: true }),
61
+ tslib_1.__metadata("design:type", Number)
62
+ ], WorkShift.prototype, "toDate", void 0);
63
+ tslib_1.__decorate([
64
+ (0, typeorm_1.Column)(),
65
+ (0, type_graphql_1.Field)({ nullable: true }),
66
+ tslib_1.__metadata("design:type", String)
67
+ ], WorkShift.prototype, "toTime", void 0);
68
+ tslib_1.__decorate([
69
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
70
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Weekdays this shift runs on as a CSV of 0(Sun)..6(Sat). Empty means every day' }),
71
+ tslib_1.__metadata("design:type", String)
72
+ ], WorkShift.prototype, "daysOfWeek", void 0);
73
+ tslib_1.__decorate([
74
+ (0, typeorm_1.CreateDateColumn)(),
75
+ (0, type_graphql_1.Field)({ nullable: true }),
76
+ tslib_1.__metadata("design:type", Date)
77
+ ], WorkShift.prototype, "createdAt", void 0);
78
+ tslib_1.__decorate([
79
+ (0, typeorm_1.UpdateDateColumn)(),
80
+ (0, type_graphql_1.Field)({ nullable: true }),
81
+ tslib_1.__metadata("design:type", Date)
82
+ ], WorkShift.prototype, "updatedAt", void 0);
83
+ tslib_1.__decorate([
84
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
85
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
86
+ tslib_1.__metadata("design:type", auth_base_1.User)
87
+ ], WorkShift.prototype, "creator", void 0);
88
+ tslib_1.__decorate([
89
+ (0, typeorm_1.RelationId)((workShift) => workShift.creator),
90
+ tslib_1.__metadata("design:type", String)
91
+ ], WorkShift.prototype, "creatorId", void 0);
92
+ tslib_1.__decorate([
93
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
94
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
95
+ tslib_1.__metadata("design:type", auth_base_1.User)
96
+ ], WorkShift.prototype, "updater", void 0);
97
+ tslib_1.__decorate([
98
+ (0, typeorm_1.RelationId)((workShift) => workShift.updater),
99
+ tslib_1.__metadata("design:type", String)
100
+ ], WorkShift.prototype, "updaterId", void 0);
101
+ exports.WorkShift = WorkShift = tslib_1.__decorate([
102
+ (0, typeorm_1.Entity)(),
103
+ (0, typeorm_1.Index)('ix_work_shift_0', (workShift) => [workShift.domain, workShift.name], { unique: true }),
104
+ (0, typeorm_1.Index)('ix_work_shift_1', (workShift) => [workShift.domain, workShift.fromDate, workShift.fromTime], {
105
+ unique: true
106
+ }),
107
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for WorkShift' })
108
+ ], WorkShift);
109
+ //# sourceMappingURL=work-shift.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work-shift.js","sourceRoot":"","sources":["../../../server/service/work-shift/work-shift.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAA2E;AAE3E,iDAA8C;AAC9C,yDAAgD;AAEhD,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,0EAAiB,CAAA;IACjB,6DAAU,CAAA;IACV,uEAAe,CAAA;AACjB,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B;AAED,IAAA,+BAAgB,EAAC,iBAAiB,EAAE;IAClC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,6BAA6B;CAC3C,CAAC,CAAA;AAQK,IAAM,SAAS,GAAf,MAAM,SAAS;CA8FrB,CAAA;AA9FY,8BAAS;AAGX;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;qCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;sCACb,cAAM;yCAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC;;2CACtC;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;uCACI;AAMZ;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACN;AAIpB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACC;AAI3B;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACV;AAIhB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACD;AAIzB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACZ;AAmCd;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,+EAA+E,EAAE,CAAC;;6CACrG;AAInB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;4CAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;4CAAA;AAIhB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;0CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;0CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;oBA7FP,SAAS;IANrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACxG,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE;QAC9G,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;GACvC,SAAS,CA8FrB","sourcesContent":["import {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\nimport { Field, ID, Int, ObjectType, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nexport enum WorkShiftDateType {\n TheDayBefore = -1,\n TheDay = 0,\n TheDayAfter = 1\n}\n\nregisterEnumType(WorkShiftDateType, {\n name: 'WorkShiftDateType',\n description: 'enumeration of a shift date'\n})\n\n@Entity()\n@Index('ix_work_shift_0', (workShift: WorkShift) => [workShift.domain, workShift.name], { unique: true })\n@Index('ix_work_shift_1', (workShift: WorkShift) => [workShift.domain, workShift.fromDate, workShift.fromTime], {\n unique: true\n})\n@ObjectType({ description: 'Entity for WorkShift' })\nexport class WorkShift {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((workShift: WorkShift) => workShift.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @Column()\n @Field({ nullable: true })\n fromDate: WorkShiftDateType\n\n @Column()\n @Field({ nullable: true })\n fromTime: string\n\n @Column()\n @Field({ nullable: true })\n toDate: WorkShiftDateType\n\n @Column()\n @Field({ nullable: true })\n toTime: string\n\n /**\n * Which weekdays this shift runs on — 0 Sunday … 6 Saturday. Empty means every day.\n *\n * ── What was wrong without it (2026-09-07) ────────────────────────────────\n * A shift could only say what time of day it covers, never which days. So a site that\n * rests on Saturday and Sunday was modelled as running 24 hours a day, seven days a\n * week, and everything computed from available time inflated: OEE's planned production\n * time, capacity, and the throughput predicted from them.\n *\n * The standard vocabulary already carried this. `WorkCalendarEntry` in\n * `@operato/ops-contract` — ISA-95's `WorkCalendarEntryType` — has `daysOfWeek`, and\n * operato-plant hands these rows to `equipment.workCalendar` as those entries. The\n * field arrived at the boundary empty because there was nowhere here to read it from.\n *\n * ── Why a string and not a relation or an array column ────────────────────\n * things-factory runs on five drivers and array columns are not portable across them\n * (postgres spells them one way, sqlite has none). A short CSV of digits — `1,2,3,4,5`\n * for a weekday-only shift — reads the same everywhere and is legible in a table\n * during an incident.\n *\n * ── Empty means every day, and that is not the same as none ───────────────\n * Existing rows have no value here and must keep behaving exactly as before, so absent\n * reads as \"every day\". A shift that runs on no day at all is not a thing anyone means;\n * if that ever needs saying, it is a shift that should be deleted or deactivated.\n *\n * ── One-off dates do not belong here ──────────────────────────────────────\n * A holiday, a shutdown week, a maintenance window on one particular date is an\n * absolute interval, and `@things-factory/calendar` already stores those as `Event`\n * rows with `startDateTime`/`endDateTime`. Putting them here as well would give the\n * same fact two homes and split which screen a person registers August 15th on.\n */\n @Column({ type: 'varchar', nullable: true })\n @Field({ nullable: true, description: 'Weekdays this shift runs on as a CSV of 0(Sun)..6(Sat). Empty means every day' })\n daysOfWeek?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((workShift: WorkShift) => workShift.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((workShift: WorkShift) => workShift.updater)\n updaterId?: string\n}\n"]}