@shisyamo4131/air-guard-v2-schemas 2.4.2-dev.3 → 2.4.2-dev.4
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/src/Agreement.js +18 -17
- package/src/Operation.js +48 -27
- package/src/OperationResult.js +50 -49
- package/src/SiteOperationSchedule.js +33 -32
- package/src/WorkingResult.js +32 -18
package/package.json
CHANGED
package/src/Agreement.js
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* ---------------------------------------------------------------------------
|
|
5
5
|
* A class to manage agreement details based on WorkingResult.
|
|
6
6
|
* ---------------------------------------------------------------------------
|
|
7
|
-
* @
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
13
|
-
* @
|
|
7
|
+
* @property {number} unitPriceBase - Base unit price (JPY)
|
|
8
|
+
* @property {number} overtimeUnitPriceBase - Overtime unit price (JPY/hour)
|
|
9
|
+
* @property {number} unitPriceQualified - Qualified unit price (JPY)
|
|
10
|
+
* @property {number} overtimeUnitPriceQualified - Qualified overtime unit price (JPY/hour)
|
|
11
|
+
* @property {string} billingUnitType - Billing unit type
|
|
12
|
+
* @property {boolean} includeBreakInBilling - Whether to include break time in billing if `billingUnitType` is `PER_HOUR`.
|
|
13
|
+
* @property {number} cutoffDate - Cutoff date value from CutoffDate.VALUES
|
|
14
14
|
* - The cutoff date for billing, using values defined in the CutoffDate utility class.
|
|
15
15
|
* ---------------------------------------------------------------------------
|
|
16
16
|
* @getter {Object} prices - Object containing price-related properties (read-only)
|
|
@@ -20,21 +20,22 @@
|
|
|
20
20
|
* unitPriceQualified, overtimeUnitPriceQualified, billingUnitType, includeBreakInBilling
|
|
21
21
|
* ---------------------------------------------------------------------------
|
|
22
22
|
* @inherited - The following properties are inherited from WorkingResult:
|
|
23
|
-
* @
|
|
24
|
-
* @
|
|
25
|
-
* @
|
|
26
|
-
* @
|
|
27
|
-
* @
|
|
23
|
+
* @property {Date} dateAt - Applicable start date (trigger property)
|
|
24
|
+
* @property {string} dayType - Day type (e.g., `WEEKDAY`, `WEEKEND`, `HOLIDAY`)
|
|
25
|
+
* @property {string} shiftType - Shift type (`DAY`, `NIGHT`)
|
|
26
|
+
* @property {string} startTime - Start time (HH:MM format)
|
|
27
|
+
* @property {boolean} isStartNextDay - Next day start flag
|
|
28
28
|
* - `true` if the actual work starts the day after the placement date `dateAt`
|
|
29
|
-
* @
|
|
30
|
-
* @
|
|
31
|
-
* @
|
|
29
|
+
* @property {string} endTime - End time (HH:MM format)
|
|
30
|
+
* @property {number} breakMinutes - Break time (minutes)
|
|
31
|
+
* @property {number} regulationWorkMinutes - Regulation work minutes
|
|
32
32
|
* - The maximum working time defined by `unitPriceBase` (or `unitPriceQualified`).
|
|
33
33
|
* - Exceeding this time is considered overtime.
|
|
34
34
|
* ---------------------------------------------------------------------------
|
|
35
35
|
* @inherited - The following computed properties are inherited from WorkingResult:
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
*
|
|
37
|
+
* @property {string} key - {@link WorkingResult#key}
|
|
38
|
+
*
|
|
38
39
|
* @computed {string} date - Date string in YYYY-MM-DD format based on `dateAt` (read-only)
|
|
39
40
|
* - Returns a string in the format YYYY-MM-DD based on `dateAt`.
|
|
40
41
|
* @computed {boolean} isSpansNextDay - Flag indicating whether the date spans from start date to end date (read-only)
|
package/src/Operation.js
CHANGED
|
@@ -11,51 +11,58 @@
|
|
|
11
11
|
* - `startTime`, `endTime`, and `breakMinutes` are NOT synchronized here.
|
|
12
12
|
* They should be synchronized at `SiteOperationSchedule` level instead.
|
|
13
13
|
* ---------------------------------------------------------------------------
|
|
14
|
-
* @
|
|
14
|
+
* @property {string} siteId
|
|
15
15
|
* - Site document ID (trigger property)
|
|
16
16
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
17
17
|
*
|
|
18
|
-
* @
|
|
18
|
+
* @property {number} requiredPersonnel
|
|
19
19
|
* - Required number of personnel
|
|
20
20
|
*
|
|
21
|
-
* @
|
|
21
|
+
* @property {boolean} qualificationRequired
|
|
22
22
|
* - Qualification required flag
|
|
23
23
|
*
|
|
24
|
-
* @
|
|
24
|
+
* @property {string} workDescription
|
|
25
25
|
* - Work description
|
|
26
26
|
*
|
|
27
|
-
* @
|
|
27
|
+
* @property {string} remarks
|
|
28
28
|
* - Remarks
|
|
29
29
|
*
|
|
30
|
-
* @
|
|
30
|
+
* @property {Array<OperationDetail>} employees
|
|
31
31
|
* - Assigned employees
|
|
32
32
|
* - Array of `OperationDetail` instances representing assigned employees
|
|
33
33
|
*
|
|
34
|
-
* @
|
|
34
|
+
* @property {Array<OperationDetail>} outsourcers
|
|
35
35
|
* - Assigned outsourcers
|
|
36
36
|
* - Array of `OperationDetail` instances representing assigned outsourcers
|
|
37
37
|
*
|
|
38
|
-
* @
|
|
38
|
+
* @property {Array<string>} employeeIds - Array of employee IDs from `employees` (read-only)
|
|
39
39
|
* - Array of employee IDs from `employees` (read-only)
|
|
40
40
|
*
|
|
41
|
-
* @
|
|
41
|
+
* @property {Array<string>} outsourcerIds
|
|
42
42
|
* - Array of outsourcer IDs from `outsourcers` (read-only)
|
|
43
43
|
*
|
|
44
|
-
* @
|
|
44
|
+
* @property {number} employeesCount
|
|
45
45
|
* - Count of assigned employees (read-only)
|
|
46
46
|
*
|
|
47
|
-
* @
|
|
47
|
+
* @property {number} outsourcersCount
|
|
48
48
|
* - Count of assigned outsourcers (sum of amounts) (read-only)
|
|
49
49
|
*
|
|
50
|
-
* @
|
|
50
|
+
* @property {boolean} isPersonnelShortage
|
|
51
51
|
* - Indicates if there is a shortage of personnel (read-only)
|
|
52
52
|
* - `true` if the sum of `employeesCount` and `outsourcersCount` is less than `requiredPersonnel`
|
|
53
53
|
*
|
|
54
|
-
* @
|
|
54
|
+
* @property {Array<OperationDetail>} workers
|
|
55
55
|
* - Combined array of `employees` and `outsourcers`
|
|
56
56
|
* - Getter: Returns concatenated array of employees and outsourcers
|
|
57
57
|
* - Setter: Splits array into employees and outsourcers based on `isEmployee` property
|
|
58
58
|
*
|
|
59
|
+
* @property {string} key - `siteId`, `date`, `dayType`, `shiftType` を組み合わせたキー。(読み取り専用)
|
|
60
|
+
* - 2026-01-07 現在使用していないプロパティ。
|
|
61
|
+
* - `dayType` は請求時の単価情報を取得するために必要な情報であるため含める必要がないと思われる。
|
|
62
|
+
*
|
|
63
|
+
* @property {string} orderKey - `siteId`, `shiftType` を組み合わせたキー。(読み取り専用)
|
|
64
|
+
* - `siteOrder` の `key` プロパティに対応するキー。
|
|
65
|
+
*
|
|
59
66
|
* @getter {string} groupKey - Combines `siteId`, `shiftType`, and `date` to indicate operation grouping (read-only)
|
|
60
67
|
* @getter {boolean} isEmployeesChanged - Indicates whether the employees have changed (read-only)
|
|
61
68
|
* - Returns true if the employee IDs have changed compared to `_beforeData`
|
|
@@ -69,19 +76,18 @@
|
|
|
69
76
|
* - Workers whose `startTime`, `isStartNextDay`, `endTime`, `breakMinutes`, `isQualified`, or `isOjt` have changed
|
|
70
77
|
* ---------------------------------------------------------------------------
|
|
71
78
|
* @inherited - The following properties are inherited from WorkingResult:
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* @prop {Date} dateAt - Date of operation (placement date) (trigger property)
|
|
79
|
+
*
|
|
80
|
+
* @property {Date} dateAt - Date of operation (placement date) (trigger property)
|
|
75
81
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
76
|
-
* @
|
|
77
|
-
* @
|
|
82
|
+
* @property {string} dayType - Day type (e.g., `WEEKDAY`, `WEEKEND`, `HOLIDAY`)
|
|
83
|
+
* @property {string} shiftType - `DAY` or `NIGHT` (trigger property)
|
|
78
84
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
79
|
-
* @
|
|
80
|
-
* @
|
|
85
|
+
* @property {string} startTime - Start time (HH:MM format)
|
|
86
|
+
* @property {boolean} isStartNextDay - Next day start flag
|
|
81
87
|
* - `true` if the actual work starts the day after the placement date `dateAt`
|
|
82
|
-
* @
|
|
83
|
-
* @
|
|
84
|
-
* @
|
|
88
|
+
* @property {string} endTime - End time (HH:MM format)
|
|
89
|
+
* @property {number} breakMinutes - Break time (minutes)
|
|
90
|
+
* @property {number} regulationWorkMinutes - Regulation work minutes (trigger property)
|
|
85
91
|
* - Indicates the maximum working time treated as regular working hours.
|
|
86
92
|
* - A new value will be synchronized to all `employees` and `outsourcers`.
|
|
87
93
|
* ---------------------------------------------------------------------------
|
|
@@ -261,11 +267,13 @@ export default class Operation extends WorkingResult {
|
|
|
261
267
|
afterInitialize(item = {}) {
|
|
262
268
|
super.afterInitialize(item);
|
|
263
269
|
|
|
264
|
-
/**
|
|
265
|
-
* Override `key` computed property
|
|
266
|
-
* - `key`: Combines `siteId`, `date`, `dayType`, and `shiftType`.
|
|
267
|
-
*/
|
|
268
270
|
Object.defineProperties(this, {
|
|
271
|
+
/**
|
|
272
|
+
* `siteId`, `date`, `dayType`, `shiftType` を組み合わせたキー。(読み取り専用)
|
|
273
|
+
* - `WorkingResult.key` をオーバーライド。
|
|
274
|
+
* - 2026-01-07 現在使用していないプロパティ。
|
|
275
|
+
* - `dayType` は請求時の単価情報を取得するために必要な情報であるため含める必要がないと思われる。
|
|
276
|
+
*/
|
|
269
277
|
key: {
|
|
270
278
|
configurable: true,
|
|
271
279
|
enumberable: true,
|
|
@@ -274,6 +282,19 @@ export default class Operation extends WorkingResult {
|
|
|
274
282
|
},
|
|
275
283
|
set() {},
|
|
276
284
|
},
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* `siteId`, `shiftType` を組み合わせたキー。(読み取り専用)
|
|
288
|
+
* - `siteOrder` の `key` プロパティに対応するキー。
|
|
289
|
+
*/
|
|
290
|
+
orderKey: {
|
|
291
|
+
configurable: true,
|
|
292
|
+
enumberable: true,
|
|
293
|
+
get() {
|
|
294
|
+
return `${this.siteId}-${this.shiftType}`;
|
|
295
|
+
},
|
|
296
|
+
set() {},
|
|
297
|
+
},
|
|
277
298
|
});
|
|
278
299
|
|
|
279
300
|
/***********************************************************
|
package/src/OperationResult.js
CHANGED
|
@@ -10,107 +10,108 @@
|
|
|
10
10
|
* - Automatically updates `billingDateAt` based on `dateAt` and `cutoffDate`.
|
|
11
11
|
* - Introduces a lock mechanism (`isLocked`) to prevent edits when necessary.
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
14
|
-
* - A unique identifier for the working result, combining `siteId`, `date`, `dayType`, and `shiftType`.
|
|
13
|
+
* @property { string } key - {@link Operation#key}
|
|
15
14
|
*
|
|
16
|
-
* @
|
|
15
|
+
* @property {string} orderKey - {@link Operation#orderKey}
|
|
16
|
+
*
|
|
17
|
+
* @property {string} siteId - Site document ID (trigger property)
|
|
17
18
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
18
19
|
*
|
|
19
|
-
* @
|
|
20
|
+
* @property {Date} dateAt - Date of operation (placement date) (trigger property)
|
|
20
21
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
21
22
|
* - Used to determine `dayType`.
|
|
22
23
|
* - When `dateAt` changes, `billingDateAt` is also updated based on `agreement.cutoffDate`.
|
|
23
|
-
* @
|
|
24
|
-
* @
|
|
24
|
+
* @property {string} dayType - Day type (e.g., `WEEKDAY`, `WEEKEND`, `HOLIDAY`)
|
|
25
|
+
* @property {string} shiftType - `DAY` or `NIGHT` (trigger property)
|
|
25
26
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
26
|
-
* @
|
|
27
|
-
* @
|
|
27
|
+
* @property {string} startTime - Start time (HH:MM format)
|
|
28
|
+
* @property {boolean} isStartNextDay - Next day start flag
|
|
28
29
|
* - `true` if the actual work starts the day after the placement date `dateAt`
|
|
29
|
-
* @
|
|
30
|
-
* @
|
|
31
|
-
* @
|
|
30
|
+
* @property {string} endTime - End time (HH:MM format)
|
|
31
|
+
* @property {number} breakMinutes - Break time (minutes)
|
|
32
|
+
* @property {number} regulationWorkMinutes - Regulation work minutes (trigger property)
|
|
32
33
|
* - Indicates the maximum working time treated as regular working hours.
|
|
33
34
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
34
|
-
* @
|
|
35
|
-
* @
|
|
36
|
-
* @
|
|
37
|
-
* @
|
|
38
|
-
* @
|
|
35
|
+
* @property {number} requiredPersonnel - Required number of personnel
|
|
36
|
+
* @property {boolean} qualificationRequired - Qualification required flag
|
|
37
|
+
* @property {string} workDescription - Work description
|
|
38
|
+
* @property {string} remarks - Remarks
|
|
39
|
+
* @property {Array<OperationResultDetail>} employees - Assigned employees
|
|
39
40
|
* - Array of `OperationResultDetail` instances representing assigned employees
|
|
40
|
-
* @
|
|
41
|
+
* @property {Array<OperationResultDetail>} outsourcers - Assigned outsourcers
|
|
41
42
|
* - Array of `OperationResultDetail` instances representing assigned outsourcers
|
|
42
|
-
* @
|
|
43
|
+
* @property {Array<OperationResultDetail>} workers - Combined array of `employees` and `outsourcers`
|
|
43
44
|
* - Getter: Returns concatenated array of employees and outsourcers
|
|
44
45
|
* - Setter: Splits array into employees and outsourcers based on `isEmployee` property
|
|
45
|
-
* @
|
|
46
|
+
* @property {string|null} siteOperationScheduleId - Associated SiteOperationSchedule document ID
|
|
46
47
|
* - If this OperationResult was created from a SiteOperationSchedule, this property holds that ID.
|
|
47
|
-
* @
|
|
48
|
-
* @
|
|
48
|
+
* @property {boolean} useAdjustedQuantity - Flag to indicate if adjusted quantities are used for billing
|
|
49
|
+
* @property {number} adjustedQuantityBase - Adjusted quantity for base workers
|
|
49
50
|
* - Quantity used for billing base workers when `useAdjustedQuantity` is true.
|
|
50
|
-
* @
|
|
51
|
+
* @property {number} adjustedOvertimeBase - Adjusted overtime for base workers
|
|
51
52
|
* - Overtime used for billing base workers when `useAdjustedQuantity` is true.
|
|
52
|
-
* @
|
|
53
|
+
* @property {number} adjustedQuantityQualified - Adjusted quantity for qualified workers
|
|
53
54
|
* - Quantity used for billing qualified workers when `useAdjustedQuantity` is true.
|
|
54
|
-
* @
|
|
55
|
+
* @property {number} adjustedOvertimeQualified - Adjusted overtime for qualified workers
|
|
55
56
|
* - Overtime used for billing qualified workers when `useAdjustedQuantity` is true.
|
|
56
|
-
* @
|
|
57
|
+
* @property {Date} billingDateAt - Billing date
|
|
57
58
|
* - The date used for billing purposes.
|
|
58
|
-
* @
|
|
59
|
+
* @property {boolean} isLocked - Lock flag
|
|
59
60
|
* - When set to true, the OperationResult is locked from edits exept for editing as OperationBilling.
|
|
60
|
-
* @
|
|
61
|
+
* @property {Agreement|null} agreement - Associated Agreement object
|
|
61
62
|
* - The Agreement instance associated with this OperationResult for pricing and billing information.
|
|
62
63
|
* - When set, it influences billing calculations such as unit prices and billing dates.
|
|
63
|
-
* @
|
|
64
|
+
* @property {boolean} allowEmptyAgreement - Flag to ignore missing Agreement
|
|
64
65
|
* - When set to true, allows the OperationResult to be valid even if no Agreement is associated.
|
|
65
66
|
* @readonly
|
|
66
|
-
* @
|
|
67
|
+
* @property {string} date - Date string in YYYY-MM-DD format based on `dateAt` (read-only)
|
|
67
68
|
* - Returns a string in the format YYYY-MM-DD based on `dateAt`.
|
|
68
|
-
* @
|
|
69
|
+
* @property {Date} startAt - Start date and time (Date object) (read-only)
|
|
69
70
|
* - Returns a Date object with `startTime` set based on `dateAt`.
|
|
70
71
|
* - If `isStartNextDay` is true, add 1 day.
|
|
71
|
-
* @
|
|
72
|
+
* @property {Date} endAt - End date and time (Date object) (read-only)
|
|
72
73
|
* - Returns a Date object with `endTime` set based on `dateAt`.
|
|
73
74
|
* - If `isStartNextDay` is true, add 1 day.
|
|
74
75
|
* - If `isSpansNextDay` is true, add 1 day.
|
|
75
|
-
* @
|
|
76
|
+
* @property {boolean} isSpansNextDay - Flag indicating whether the date spans from start date to end date (read-only)
|
|
76
77
|
* - `true` if `startTime` is later than `endTime`
|
|
77
|
-
* @
|
|
78
|
+
* @property {number} totalWorkMinutes - Total working time in minutes (excluding break time) (read-only)
|
|
78
79
|
* - Calculated as the difference between `endAt` and `startAt` minus `breakMinutes`
|
|
79
|
-
* @
|
|
80
|
+
* @property {number} regularTimeWorkMinutes - Regular working time in minutes (read-only)
|
|
80
81
|
* - The portion of `totalWorkMinutes` that is considered within the contract's `regulationWorkMinutes`.
|
|
81
|
-
* @
|
|
82
|
+
* @property {number} overtimeWorkMinutes - Overtime work in minutes (read-only)
|
|
82
83
|
* - Calculated as `totalWorkMinutes` minus `regulationWorkMinutes`
|
|
83
|
-
* @
|
|
84
|
+
* @property {boolean} hasAgreement - Indicates if an Agreement is associated (read-only)
|
|
84
85
|
* - `true` if `agreement` is set, otherwise `false`.
|
|
85
|
-
* @
|
|
86
|
+
* @property {string|false} isInvalid - Validation status (read-only)
|
|
86
87
|
* - Returns false if valid.
|
|
87
88
|
* - Returns reason code string if invalid:
|
|
88
89
|
* - `EMPTY_BILLING_DATE`: Billing date is missing.
|
|
89
90
|
* - `EMPTY_AGREEMENT`: Agreement is missing and `allowEmptyAgreement` is false.
|
|
90
|
-
* @
|
|
91
|
+
* @property {Object} statistics - Statistics of workers (read-only)
|
|
91
92
|
* - Contains counts and total work minutes for base and qualified workers, including OJT breakdowns.
|
|
92
93
|
* - Structure: { base: {...}, qualified: {...}, total: {...} }
|
|
93
94
|
* - Each category contains: quantity, regularTimeWorkMinutes, overtimeWorkMinutes, totalWorkMinutes, breakMinutes
|
|
94
95
|
* - Each category also has an 'ojt' subcategory with the same structure.
|
|
95
|
-
* @
|
|
96
|
+
* @property {Object} sales - Sales amounts (read-only)
|
|
96
97
|
* - Contains sales calculations for base and qualified workers, including overtime breakdowns.
|
|
97
98
|
* - Structure: { base: {...}, qualified: {...} }
|
|
98
99
|
* - Each category contains: unitPrice, quantity, regularAmount, overtimeUnitPrice, overtimeMinutes, overtimeAmount, total
|
|
99
100
|
* - Calculations respect `useAdjustedQuantity`, `billingUnitType`, and `includeBreakInBilling` settings.
|
|
100
|
-
* @
|
|
101
|
+
* @property {number} salesAmount - Total sales amount (read-only)
|
|
101
102
|
* - Sum of sales amounts for base and qualified workers with rounding applied.
|
|
102
|
-
* @
|
|
103
|
+
* @property {number} tax - Calculated tax amount (read-only)
|
|
103
104
|
* - Calculated using the `Tax` utility based on `salesAmount` and `date`.
|
|
104
|
-
* @
|
|
105
|
+
* @property {number} billingAmount - Total billing amount including tax (read-only)
|
|
105
106
|
* - Sum of `salesAmount` and `tax`.
|
|
106
|
-
* @
|
|
107
|
+
* @property {string|null} billingDate - Billing date in YYYY-MM-DD format (read-only)
|
|
107
108
|
* - Returns a string in the format YYYY-MM-DD based on `billingDateAt`.
|
|
108
|
-
* @
|
|
109
|
-
* @
|
|
110
|
-
* @
|
|
111
|
-
* @
|
|
112
|
-
* @
|
|
113
|
-
* @
|
|
109
|
+
* @property {string} billingMonth - Billing month in YYYY-MM format (read-only)
|
|
110
|
+
* @property {Array<string>} employeeIds - Array of employee IDs from `employees` (read-only)
|
|
111
|
+
* @property {Array<string>} outsourcerIds - Array of outsourcer IDs from `outsourcers` (read-only)
|
|
112
|
+
* @property {number} employeesCount - Count of assigned employees (read-only)
|
|
113
|
+
* @property {number} outsourcersCount - Count of assigned outsourcers (sum of amounts) (read-only)
|
|
114
|
+
* @property {boolean} isPersonnelShortage - Indicates if there is a shortage of personnel (read-only)
|
|
114
115
|
* - `true` if the sum of `employeesCount` and `outsourcersCount` is less than `requiredPersonnel`
|
|
115
116
|
*
|
|
116
117
|
* @getter {string} groupKey - Combines `siteId`, `shiftType`, and `date` to indicate operation grouping (read-only)
|
|
@@ -18,16 +18,17 @@
|
|
|
18
18
|
* `siteId`, `dateAt`, `shiftType`, and `regulationWorkMinutes` are synchronized
|
|
19
19
|
* in the parent `Operation` class.
|
|
20
20
|
*
|
|
21
|
-
* @
|
|
22
|
-
* - A unique identifier for the working result, combining `siteId`, `date`, `dayType`, and `shiftType`.
|
|
21
|
+
* @property { string } key - {@link Operation#key}
|
|
23
22
|
*
|
|
24
|
-
* @
|
|
23
|
+
* @property {string} orderKey - {@link Operation#orderKey}
|
|
24
|
+
*
|
|
25
|
+
* @property {string|null} operationResultId - Associated OperationResult document ID
|
|
25
26
|
* - If an OperationResult has been created based on this schedule, this property
|
|
26
27
|
* holds the ID of that OperationResult document.
|
|
27
28
|
* - If this property is set, the schedule cannot be updated or deleted.
|
|
28
29
|
* Conversely, if the associated OperationResult is deleted, this property can be set to null.
|
|
29
30
|
*
|
|
30
|
-
* @
|
|
31
|
+
* @property {number} displayOrder - Display order
|
|
31
32
|
* - Property to control the display order of schedules on the same date and shift type.
|
|
32
33
|
* - Automatically assigned during creation based on existing documents.
|
|
33
34
|
*
|
|
@@ -38,88 +39,88 @@
|
|
|
38
39
|
* - Returns `true` if all workers in the `workers` array have `hasNotification` set to `true`
|
|
39
40
|
*
|
|
40
41
|
* @inherited - The following properties are inherited from Operation:
|
|
41
|
-
* @
|
|
42
|
+
* @property {string} siteId - Site document ID (trigger property)
|
|
42
43
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
43
44
|
*
|
|
44
|
-
* @
|
|
45
|
+
* @property {number} requiredPersonnel - Required number of personnel
|
|
45
46
|
*
|
|
46
|
-
* @
|
|
47
|
+
* @property {boolean} qualificationRequired - Qualification required flag
|
|
47
48
|
*
|
|
48
|
-
* @
|
|
49
|
+
* @property {string} workDescription - Work description
|
|
49
50
|
*
|
|
50
|
-
* @
|
|
51
|
+
* @property {string} remarks - Remarks
|
|
51
52
|
*
|
|
52
|
-
* @
|
|
53
|
+
* @property {Array<SiteOperationScheduleDetail>} employees - Assigned employees
|
|
53
54
|
* - Array of `SiteOperationScheduleDetail` instances representing assigned employees
|
|
54
55
|
*
|
|
55
|
-
* @
|
|
56
|
+
* @property {Array<SiteOperationScheduleDetail>} outsourcers - Assigned outsourcers
|
|
56
57
|
* - Array of `SiteOperationScheduleDetail` instances representing assigned outsourcers
|
|
57
58
|
*
|
|
58
59
|
* @inherited - The following properties are inherited from WorkingResult (via Operation):
|
|
59
|
-
* @
|
|
60
|
+
* @property {Date} dateAt - Date of operation (placement date) (trigger property)
|
|
60
61
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
61
62
|
*
|
|
62
|
-
* @
|
|
63
|
+
* @property {string} dayType - Day type (e.g., `WEEKDAY`, `WEEKEND`, `HOLIDAY`)
|
|
63
64
|
*
|
|
64
|
-
* @
|
|
65
|
+
* @property {string} shiftType - `DAY` or `NIGHT` (trigger property)
|
|
65
66
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
66
67
|
*
|
|
67
|
-
* @
|
|
68
|
+
* @property {string} startTime - Start time (HH:MM format) (trigger property)
|
|
68
69
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
69
70
|
*
|
|
70
|
-
* @
|
|
71
|
+
* @property {boolean} isStartNextDay - Next day start flag (trigger property)
|
|
71
72
|
* - `true` if the actual work starts the day after the placement date `dateAt`
|
|
72
73
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
73
74
|
*
|
|
74
|
-
* @
|
|
75
|
+
* @property {string} endTime - End time (HH:MM format) (trigger property)
|
|
75
76
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
76
77
|
*
|
|
77
|
-
* @
|
|
78
|
+
* @property {number} breakMinutes - Break time (minutes) (trigger property)
|
|
78
79
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
79
80
|
*
|
|
80
|
-
* @
|
|
81
|
+
* @property {number} regulationWorkMinutes - Regulation work minutes (trigger property)
|
|
81
82
|
* - Indicates the maximum working time treated as regular working hours.
|
|
82
83
|
* - Automatically synchronizes to all `employees` and `outsourcers` when changed.
|
|
83
84
|
*
|
|
84
85
|
* @inherited - The following computed properties are inherited from Operation:
|
|
85
|
-
* @
|
|
86
|
+
* @property {Array<string>} employeeIds - Array of employee IDs from `employees` (read-only)
|
|
86
87
|
*
|
|
87
|
-
* @
|
|
88
|
+
* @property {Array<string>} outsourcerIds - Array of outsourcer IDs from `outsourcers` (read-only)
|
|
88
89
|
*
|
|
89
|
-
* @
|
|
90
|
+
* @property {number} employeesCount - Count of assigned employees (read-only)
|
|
90
91
|
*
|
|
91
|
-
* @
|
|
92
|
+
* @property {number} outsourcersCount - Count of assigned outsourcers (sum of amounts) (read-only)
|
|
92
93
|
*
|
|
93
|
-
* @
|
|
94
|
+
* @property {boolean} isPersonnelShortage - Indicates if there is a shortage of personnel (read-only)
|
|
94
95
|
* - `true` if the sum of `employeesCount` and `outsourcersCount` is less than `requiredPersonnel`
|
|
95
96
|
*
|
|
96
|
-
* @
|
|
97
|
+
* @property {Array<SiteOperationScheduleDetail>} workers - Combined array of `employees` and `outsourcers`
|
|
97
98
|
* - Getter: Returns concatenated array of employees and outsourcers
|
|
98
99
|
* - Setter: Splits array into employees and outsourcers based on `isEmployee` property
|
|
99
100
|
*
|
|
100
101
|
* @inherited - The following computed properties are inherited from WorkingResult (via Operation):
|
|
101
|
-
* @
|
|
102
|
+
* @property {string} date - Date string in YYYY-MM-DD format based on `dateAt` (read-only)
|
|
102
103
|
* - Returns a string in the format YYYY-MM-DD based on `dateAt`.
|
|
103
104
|
*
|
|
104
|
-
* @
|
|
105
|
+
* @property {Date} startAt - Start date and time (Date object) (read-only)
|
|
105
106
|
* - Returns a Date object with `startTime` set based on `dateAt`.
|
|
106
107
|
* - If `isStartNextDay` is true, add 1 day.
|
|
107
108
|
*
|
|
108
|
-
* @
|
|
109
|
+
* @property {Date} endAt - End date and time (Date object) (read-only)
|
|
109
110
|
* - Returns a Date object with `endTime` set based on `dateAt`.
|
|
110
111
|
* - If `isStartNextDay` is true, add 1 day.
|
|
111
112
|
* - If `isSpansNextDay` is true, add 1 day.
|
|
112
113
|
*
|
|
113
|
-
* @
|
|
114
|
+
* @property {boolean} isSpansNextDay - Flag indicating whether the date spans from start date to end date (read-only)
|
|
114
115
|
* - `true` if `startTime` is later than `endTime`
|
|
115
116
|
*
|
|
116
|
-
* @
|
|
117
|
+
* @property {number} totalWorkMinutes - Total working time in minutes (excluding break time) (read-only)
|
|
117
118
|
* - Calculated as the difference between `endAt` and `startAt` minus `breakMinutes`
|
|
118
119
|
*
|
|
119
|
-
* @
|
|
120
|
+
* @property {number} regularTimeWorkMinutes - Regular working time in minutes (read-only)
|
|
120
121
|
* - The portion of `totalWorkMinutes` that is considered within the contract's `regulationWorkMinutes`.
|
|
121
122
|
*
|
|
122
|
-
* @
|
|
123
|
+
* @property {number} overtimeWorkMinutes - Overtime work in minutes (read-only)
|
|
123
124
|
* - Calculated as `totalWorkMinutes` minus `regulationWorkMinutes`
|
|
124
125
|
*
|
|
125
126
|
* @inherited - The following getter properties are inherited from Operation:
|
package/src/WorkingResult.js
CHANGED
|
@@ -2,46 +2,60 @@
|
|
|
2
2
|
* WorkingResult ver 1.0.0
|
|
3
3
|
* @author shisyamo4131
|
|
4
4
|
* ---------------------------------------------------------------------------
|
|
5
|
+
* - `Agreement`, `Operation` クラスの継承元となるクラスです。
|
|
5
6
|
* A class representing the working result for a specific date and shift extending FireModel.
|
|
6
7
|
* - This class is intended to be inherited by other classes so, it cannot be instantiated directly.
|
|
7
8
|
* - `dateAt` is defined as a trigger property. When it is set, `dayType` is automatically updated.
|
|
8
9
|
* - Subclasses can override `setDateAtCallback` to add custom behavior when `dateAt` changes.
|
|
9
10
|
* ---------------------------------------------------------------------------
|
|
10
|
-
* @
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
11
|
+
* @property {Date} dateAt - Applicable start date (trigger property)
|
|
12
|
+
*
|
|
13
|
+
* @property {string} dayType - Day type (e.g., `WEEKDAY`, `WEEKEND`, `HOLIDAY`)
|
|
14
|
+
*
|
|
15
|
+
* @property {string} shiftType - Shift type (`DAY`, `NIGHT`)
|
|
16
|
+
*
|
|
17
|
+
* @property {string} startTime - Start time (HH:MM format)
|
|
18
|
+
*
|
|
19
|
+
* @property {boolean} isStartNextDay - Next day start flag
|
|
15
20
|
* - `true` if the actual work starts the day after the placement date `dateAt`
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
18
|
-
*
|
|
21
|
+
*
|
|
22
|
+
* @property {string} endTime - End time (HH:MM format)
|
|
23
|
+
*
|
|
24
|
+
* @property {number} breakMinutes - Break time (minutes)
|
|
25
|
+
*
|
|
26
|
+
* @property {number} regulationWorkMinutes - Regulation work minutes
|
|
19
27
|
* - The maximum working time defined by `unitPriceBase` (or `unitPriceQualified`).
|
|
20
28
|
* - Exceeding this time is considered overtime.
|
|
21
29
|
*
|
|
22
|
-
* @
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @
|
|
30
|
+
* @property {string} key - `date`, `dayType`, `shifType` を組み合わせたユニークキー。(読み取り専用)
|
|
31
|
+
* - 継承先である `Agreement` でデータを一意に識別するためのキーとして使用されます。
|
|
32
|
+
*
|
|
33
|
+
* @property {string} date - Date string in YYYY-MM-DD format based on `dateAt` (read-only)
|
|
26
34
|
* - Returns a string in the format YYYY-MM-DD based on `dateAt`.
|
|
27
|
-
*
|
|
35
|
+
*
|
|
36
|
+
* @property {boolean} isSpansNextDay - Flag indicating whether the date spans from start date to end date (read-only)
|
|
28
37
|
* - `true` if `startTime` is later than `endTime`
|
|
29
|
-
*
|
|
38
|
+
*
|
|
39
|
+
* @property {Date} startAt - Start date and time (Date object) (read-only)
|
|
30
40
|
* - Returns a Date object with `startTime` set based on `dateAt`.
|
|
31
41
|
* - If `isStartNextDay` is true, add 1 day.
|
|
32
|
-
*
|
|
42
|
+
*
|
|
43
|
+
* @property {Date} endAt - End date and time (Date object) (read-only)
|
|
33
44
|
* - Returns a Date object with `endTime` set based on `dateAt`.
|
|
34
45
|
* - If `isStartNextDay` is true, add 1 day.
|
|
35
46
|
* - If `isSpansNextDay` is true, add 1 day.
|
|
36
|
-
*
|
|
47
|
+
*
|
|
48
|
+
* @property {number} totalWorkMinutes - Total working time in minutes (excluding break time) (read-only)
|
|
37
49
|
* - Calculated as the difference between `endAt` and `startAt` minus `breakMinutes`
|
|
38
50
|
* - If the difference between `endAt` and `startAt` is negative, returns 0.
|
|
39
51
|
* - If `startAt` or `endAt` is not set, returns 0.
|
|
40
|
-
*
|
|
52
|
+
*
|
|
53
|
+
* @property {number} regularTimeWorkMinutes - Regular working time in minutes (read-only)
|
|
41
54
|
* - The portion of `totalWorkMinutes` that is considered within the contract's `regulationWorkMinutes`.
|
|
42
55
|
* - If actual working time is less than regulation time (e.g., early leave), it equals `totalWorkMinutes`.
|
|
43
56
|
* - If actual working time exceeds regulation time (overtime), it equals `regulationWorkMinutes`.
|
|
44
|
-
*
|
|
57
|
+
*
|
|
58
|
+
* @property {number} overtimeWorkMinutes - Overtime work in minutes (read-only)
|
|
45
59
|
* - Calculated as `totalWorkMinutes` minus `regulationWorkMinutes`
|
|
46
60
|
* - Overtime work is not negative; the minimum is 0.
|
|
47
61
|
* ---------------------------------------------------------------------------
|