@shisyamo4131/air-guard-v2-schemas 2.4.2-dev.13 → 2.4.2-dev.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shisyamo4131/air-guard-v2-schemas",
3
- "version": "2.4.2-dev.13",
3
+ "version": "2.4.2-dev.14",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/Operation.js CHANGED
@@ -221,7 +221,7 @@ export default class Operation extends WorkingResult {
221
221
  constructor(item = {}) {
222
222
  if (new.target == Operation) {
223
223
  throw new Error(
224
- `Operation is an abstract class and cannot be instantiated directly.`
224
+ `Operation is an abstract class and cannot be instantiated directly.`,
225
225
  );
226
226
  }
227
227
  super(item);
@@ -367,7 +367,7 @@ export default class Operation extends WorkingResult {
367
367
  set(v) {
368
368
  if (typeof v !== "number" || isNaN(v) || v < 0) {
369
369
  throw new Error(
370
- `regulationWorkMinutes must be a non-negative number. regulationWorkMinutes: ${v}`
370
+ `regulationWorkMinutes must be a non-negative number. regulationWorkMinutes: ${v}`,
371
371
  );
372
372
  }
373
373
  if (_regulationWorkMinutes === v) return;
@@ -456,7 +456,7 @@ export default class Operation extends WorkingResult {
456
456
  const { id } = args;
457
457
  if (!id || typeof id !== "string") {
458
458
  throw new Error(
459
- `Employee ID is required and must be a string. id: ${id}`
459
+ `Employee ID is required and must be a string. id: ${id}`,
460
460
  );
461
461
  }
462
462
  if (this.some((emp) => emp.workerId === id)) {
@@ -467,7 +467,7 @@ export default class Operation extends WorkingResult {
467
467
  throw new Error("employees.customClass is not defined.");
468
468
  }
469
469
  const newEmployee = new schema({
470
- ...self.toObject(),
470
+ ...self.toObject(), // 自身のプロパティを継承(siteId, dateAt, shiftType, startTime, endTime, breakMinutes など)
471
471
  ...args,
472
472
  isEmployee: true, // Force override to true
473
473
  });
@@ -490,7 +490,7 @@ export default class Operation extends WorkingResult {
490
490
  value: function (oldIndex, newIndex) {
491
491
  if (newIndex > this.length - 1) {
492
492
  throw new Error(
493
- `Employees must be placed before outsourcers. newIndex: ${newIndex}, employees.length: ${this.length}`
493
+ `Employees must be placed before outsourcers. newIndex: ${newIndex}, employees.length: ${this.length}`,
494
494
  );
495
495
  }
496
496
  if (newIndex < 0 || newIndex >= this.length) {
@@ -510,7 +510,7 @@ export default class Operation extends WorkingResult {
510
510
  change: {
511
511
  value: function (newEmployee) {
512
512
  const index = this.findIndex(
513
- (e) => e.workerId === newEmployee.workerId
513
+ (e) => e.workerId === newEmployee.workerId,
514
514
  );
515
515
  if (index < 0) {
516
516
  throw new Error("Worker not found in employees.");
@@ -559,7 +559,7 @@ export default class Operation extends WorkingResult {
559
559
  const { id } = args;
560
560
  if (!id || typeof id !== "string") {
561
561
  throw new Error(
562
- `Outsourcer ID is required and must be a string. id: ${id}`
562
+ `Outsourcer ID is required and must be a string. id: ${id}`,
563
563
  );
564
564
  }
565
565
  const maxIndex = this.reduce((result, out) => {
@@ -600,16 +600,16 @@ export default class Operation extends WorkingResult {
600
600
  value: function (oldIndex, newIndex) {
601
601
  if (newIndex <= self.employees.length - 1) {
602
602
  throw new Error(
603
- `Outsourcers must be placed after employees. newIndex: ${newIndex}, employees.length: ${self.employees.length}`
603
+ `Outsourcers must be placed after employees. newIndex: ${newIndex}, employees.length: ${self.employees.length}`,
604
604
  );
605
605
  }
606
606
  const internalOldIndex = Math.max(
607
607
  0,
608
- oldIndex - self.employees.length
608
+ oldIndex - self.employees.length,
609
609
  );
610
610
  const internalNewIndex = Math.max(
611
611
  0,
612
- newIndex - self.employees.length
612
+ newIndex - self.employees.length,
613
613
  );
614
614
  if (internalOldIndex < 0 || internalOldIndex >= this.length) {
615
615
  throw new Error(`Invalid old index: ${internalOldIndex}`);
@@ -631,7 +631,7 @@ export default class Operation extends WorkingResult {
631
631
  change: {
632
632
  value: function (newOutsourcer) {
633
633
  const index = this.findIndex(
634
- (e) => e.workerId === newOutsourcer.workerId
634
+ (e) => e.workerId === newOutsourcer.workerId,
635
635
  );
636
636
  if (index < 0) {
637
637
  throw new Error("Worker not found in outsourcers.");
@@ -781,7 +781,7 @@ export default class Operation extends WorkingResult {
781
781
  const { oldIndex, newIndex, isEmployee = true } = options;
782
782
  if (typeof oldIndex !== "number" || typeof newIndex !== "number") {
783
783
  throw new Error(
784
- "oldIndex and newIndex are required and must be numbers."
784
+ "oldIndex and newIndex are required and must be numbers.",
785
785
  );
786
786
  }
787
787
  if (isEmployee) {
@@ -831,7 +831,7 @@ export default class Operation extends WorkingResult {
831
831
  case "object":
832
832
  if (!key.siteId || !key.shiftType || !key.date) {
833
833
  throw new Error(
834
- "key must contain siteId, shiftType, and date properties."
834
+ "key must contain siteId, shiftType, and date properties.",
835
835
  );
836
836
  }
837
837
  return [key.siteId, key.shiftType, key.date];
@@ -839,7 +839,7 @@ export default class Operation extends WorkingResult {
839
839
  const [siteId, shiftType, year, month, day] = key.split("-");
840
840
  if (!siteId || !shiftType || !year || !month || !day) {
841
841
  throw new Error(
842
- "key must be in the format 'siteId-shiftType-year-month-day'."
842
+ "key must be in the format 'siteId-shiftType-year-month-day'.",
843
843
  );
844
844
  }
845
845
  return [siteId, shiftType, `${year}-${month}-${day}`];
@@ -5,46 +5,43 @@
5
5
  * - Model representing the details of a site operation schedule.
6
6
  * - Inherits from OperationDetail.
7
7
  * ---------------------------------------------------------------------------
8
- * @prop {string} siteOperationScheduleId - Site Operation Schedule ID
9
- * @prop {boolean} hasNotification - Notification flag
10
- * ---------------------------------------------------------------------------
11
- * @computed {string} notificationKey - Notification key (read-only)
12
- * - Concatenation of `siteOperationScheduleId` and `workerId` with '-'
8
+ * @property {string} siteOperationScheduleId - Site Operation Schedule ID
9
+ * @property {boolean} hasNotification - 配置通知が作成されているかどうかのフラグ。SiteOperationSchedule クラスから設定される。
10
+ * @property {string} notificationKey - Notification key (read-only)
11
+ * - `siteOperationScheduleId` `workerId` `-` で連結したキー。`ArrangemntNotification` ドキュメントIDと一致する。
13
12
  * ---------------------------------------------------------------------------
14
13
  * @inherited - The following properties are inherited from OperationDetail:
15
- * @prop {string} id - Employee or Outsourcer document ID
16
- * @prop {number} index - Identifier index for Outsourcer (always 0 for Employee)
17
- * @prop {boolean} isEmployee - Employee flag (true: Employee, false: Outsourcer)
18
- * @prop {number} amount - Number of placements (always fixed at 1)
19
- * @prop {string} siteId - Site ID
20
- * @prop {boolean} isQualified - Qualified flag
21
- * @prop {boolean} isOjt - OJT flag
22
- * ---------------------------------------------------------------------------
23
- * @inherited - The following computed properties are inherited from OperationDetail:
24
- * @computed {string} workerId - Worker ID (read-only)
14
+ * @property {string} id - Employee or Outsourcer document ID
15
+ * @property {number} index - Identifier index for Outsourcer (always 0 for Employee)
16
+ * @property {boolean} isEmployee - Employee flag (true: Employee, false: Outsourcer)
17
+ * @property {number} amount - Number of placements (always fixed at 1)
18
+ * @property {string} siteId - Site ID
19
+ * @property {boolean} isQualified - Qualified flag
20
+ * @property {boolean} isOjt - OJT flag
21
+ * @property {string} workerId - Worker ID (read-only)
25
22
  * - For Employee, it's the same as `id`, for Outsourcer, it's a concatenation of `id` and `index` with ':'
26
- * @computed {string|null} employeeId - Employee ID (null if not applicable) (read-only)
27
- * @computed {string|null} outsourcerId - Outsourcer ID (null if not applicable) (read-only)
23
+ * @property {string|null} employeeId - Employee ID (null if not applicable) (read-only)
24
+ * @property {string|null} outsourcerId - Outsourcer ID (null if not applicable) (read-only)
28
25
  * ---------------------------------------------------------------------------
29
26
  * @inherited - The following properties are inherited from WorkingResult (via OperationDetail):
30
- * @prop {Date} dateAt - Placement date (trigger property)
31
- * @prop {string} dayType - Day type (e.g., `WEEKDAY`, `WEEKEND`, `HOLIDAY`)
32
- * @prop {string} shiftType - `DAY` or `NIGHT`
33
- * @prop {string} startTime - Start time (HH:MM format)
34
- * @prop {boolean} isStartNextDay - Next day start flag
35
- * @prop {string} endTime - End time (HH:MM format)
36
- * @prop {number} breakMinutes - Break time (minutes)
37
- * @prop {number} regulationWorkMinutes - Regulation work minutes
27
+ * @property {Date} dateAt - Placement date (trigger property)
28
+ * @property {string} dayType - Day type (e.g., `WEEKDAY`, `WEEKEND`, `HOLIDAY`)
29
+ * @property {string} shiftType - `DAY` or `NIGHT`
30
+ * @property {string} startTime - Start time (HH:MM format)
31
+ * @property {boolean} isStartNextDay - Next day start flag
32
+ * @property {string} endTime - End time (HH:MM format)
33
+ * @property {number} breakMinutes - Break time (minutes)
34
+ * @property {number} regulationWorkMinutes - Regulation work minutes
38
35
  * ---------------------------------------------------------------------------
39
36
  * @inherited - The following computed properties are inherited from WorkingResult (via OperationDetail):
40
- * @computed {string} key - Unique key combining `date`, `dayType`, and `shiftType` (read-only)
41
- * @computed {string} date - Date string in YYYY-MM-DD format based on `dateAt` (read-only)
42
- * @computed {boolean} isSpansNextDay - Flag indicating whether the date spans from start date to end date (read-only)
43
- * @computed {Date} startAt - Start date and time (Date object) (read-only)
44
- * @computed {Date} endAt - End date and time (Date object) (read-only)
45
- * @computed {number} totalWorkMinutes - Total working time in minutes (excluding break time) (read-only)
46
- * @computed {number} regularTimeWorkMinutes - Regular working time in minutes (read-only)
47
- * @computed {number} overtimeWorkMinutes - Overtime work in minutes (read-only)
37
+ * @property {string} key - Unique key combining `date`, `dayType`, and `shiftType` (read-only)
38
+ * @property {string} date - Date string in YYYY-MM-DD format based on `dateAt` (read-only)
39
+ * @property {boolean} isSpansNextDay - Flag indicating whether the date spans from start date to end date (read-only)
40
+ * @property {Date} startAt - Start date and time (Date object) (read-only)
41
+ * @property {Date} endAt - End date and time (Date object) (read-only)
42
+ * @property {number} totalWorkMinutes - Total working time in minutes (excluding break time) (read-only)
43
+ * @property {number} regularTimeWorkMinutes - Regular working time in minutes (read-only)
44
+ * @property {number} overtimeWorkMinutes - Overtime work in minutes (read-only)
48
45
  * - Calculated as `totalWorkMinutes` minus `regulationWorkMinutes`
49
46
  * - Overtime work is not negative; the minimum is 0.
50
47
  * ---------------------------------------------------------------------------
package/src/User.js CHANGED
@@ -44,7 +44,9 @@ const classProps = {
44
44
  tagSize: defField("select", {
45
45
  label: "タグサイズ",
46
46
  default: TAG_SIZE_VALUES.MEDIUM.value,
47
- options: TAG_SIZE_OPTIONS,
47
+ attrs: {
48
+ items: TAG_SIZE_OPTIONS,
49
+ },
48
50
  }),
49
51
  };
50
52