@shisyamo4131/air-guard-v2-schemas 2.4.2-dev.11 → 2.4.2-dev.12

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.11",
3
+ "version": "2.4.2-dev.12",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -37,9 +37,13 @@
37
37
  * @getter {boolean} isEditable - Indicates whether the instance is editable (read-only)
38
38
  * - Returns `false` if `operationResultId` is set, `true` otherwise
39
39
  *
40
+ * @deprecated
40
41
  * @getter {boolean} isNotificatedAllWorkers - Indicates whether all workers have been notified (read-only)
41
42
  * - Returns `true` if all workers in the `workers` array have `hasNotification` set to `true`
42
43
  *
44
+ * @getter {boolean} isNotifiedAllWorkers - Indicates whether all workers have been notified (read-only)
45
+ * - Returns `true` if all workers in the `workers` array have `hasNotification` set to `true`
46
+ *
43
47
  * @inherited - The following properties are inherited from Operation:
44
48
  * @property {string} siteId - Site document ID (trigger property)
45
49
  * - Automatically synchronizes to all `employees` and `outsourcers` when changed.
@@ -339,7 +343,7 @@ export default class SiteOperationSchedule extends Operation {
339
343
  set(v) {
340
344
  if (typeof v !== "number" || isNaN(v) || v < 0) {
341
345
  throw new Error(
342
- `breakMinutes must be a non-negative number. breakMinutes: ${v}`
346
+ `breakMinutes must be a non-negative number. breakMinutes: ${v}`,
343
347
  );
344
348
  }
345
349
  if (_breakMinutes === v) return;
@@ -354,7 +358,7 @@ export default class SiteOperationSchedule extends Operation {
354
358
  set(v) {
355
359
  if (typeof v !== "boolean") {
356
360
  throw new Error(
357
- `isStartNextDay must be a boolean. isStartNextDay: ${v}`
361
+ `isStartNextDay must be a boolean. isStartNextDay: ${v}`,
358
362
  );
359
363
  }
360
364
  if (_isStartNextDay === v) return;
@@ -376,10 +380,22 @@ export default class SiteOperationSchedule extends Operation {
376
380
  }
377
381
 
378
382
  /**
383
+ * @deprecated
379
384
  * Returns whether all workers have been notified.
380
385
  * @returns {boolean} - Whether all workers have been notified.
381
386
  */
382
387
  get isNotificatedAllWorkers() {
388
+ console.warn(
389
+ "`isNotificatedAllWorkers` is deprecated. Use `isNotifiedAllWorkers` instead.",
390
+ );
391
+ return this.workers.every((worker) => worker.hasNotification);
392
+ }
393
+
394
+ /**
395
+ * Returns whether all workers have been notified.
396
+ * @returns {boolean} - Whether all workers have been notified.
397
+ */
398
+ get isNotifiedAddWorkers() {
383
399
  return this.workers.every((worker) => worker.hasNotification);
384
400
  }
385
401
 
@@ -397,7 +413,7 @@ export default class SiteOperationSchedule extends Operation {
397
413
  async beforeUpdate(args = {}) {
398
414
  if (this._beforeData.operationResultId) {
399
415
  throw new Error(
400
- `Could not update this document. The OperationResult based on this document already exists. OperationResultId: ${this._beforeData.operationResultId}`
416
+ `Could not update this document. The OperationResult based on this document already exists. OperationResultId: ${this._beforeData.operationResultId}`,
401
417
  );
402
418
  }
403
419
  await super.beforeUpdate(args);
@@ -414,7 +430,7 @@ export default class SiteOperationSchedule extends Operation {
414
430
  async beforeDelete(args = {}) {
415
431
  if (this._beforeData.operationResultId) {
416
432
  throw new Error(
417
- `Could not delete this document. The OperationResult based on this document already exists. OperationResultId: ${this._beforeData.operationResultId}`
433
+ `Could not delete this document. The OperationResult based on this document already exists. OperationResultId: ${this._beforeData.operationResultId}`,
418
434
  );
419
435
  }
420
436
  await super.beforeDelete(args);
@@ -588,7 +604,7 @@ export default class SiteOperationSchedule extends Operation {
588
604
  }
589
605
  if (dates.some((d) => !(d instanceof Date) && typeof d !== "string")) {
590
606
  throw new TypeError(
591
- "日付の指定が無効です。Dateオブジェクトか文字列で指定してください。"
607
+ "日付の指定が無効です。Dateオブジェクトか文字列で指定してください。",
592
608
  );
593
609
  }
594
610
  if (dates.length > 20) {
@@ -632,7 +648,7 @@ export default class SiteOperationSchedule extends Operation {
632
648
  // トランザクションで一括作成
633
649
  await this.constructor.runTransaction(async (transaction) => {
634
650
  await Promise.all(
635
- newSchedules.map((schedule) => schedule.create({ transaction }))
651
+ newSchedules.map((schedule) => schedule.create({ transaction })),
636
652
  );
637
653
  });
638
654
 
@@ -694,7 +710,7 @@ export default class SiteOperationSchedule extends Operation {
694
710
  className: "SiteOperationSchedule",
695
711
  arguments: {},
696
712
  state: this.toObject(),
697
- }
713
+ },
698
714
  );
699
715
  }
700
716
  }
@@ -716,7 +732,7 @@ export default class SiteOperationSchedule extends Operation {
716
732
  // ドキュメントIDがない(現場稼働予定ドキュメントとして未作成)場合はエラー
717
733
  if (!this.docId) {
718
734
  throw new Error(
719
- "不正な処理です。作成前の現場稼働予定から稼働実績を作成することはできません。"
735
+ "不正な処理です。作成前の現場稼働予定から稼働実績を作成することはできません。",
720
736
  );
721
737
  }
722
738
 
@@ -726,12 +742,12 @@ export default class SiteOperationSchedule extends Operation {
726
742
  const siteIsExist = await siteInstance.fetch({ docId: this.siteId });
727
743
  if (!siteIsExist) {
728
744
  throw new Error(
729
- `不正な処理です。現場ID: ${this.siteId} の現場データが存在しません。`
745
+ `不正な処理です。現場ID: ${this.siteId} の現場データが存在しません。`,
730
746
  );
731
747
  }
732
748
  if (siteInstance.isTemporary) {
733
749
  throw new Error(
734
- `不正な処理です。現場ID: ${this.siteId} の現場データは仮登録状態です。`
750
+ `不正な処理です。現場ID: ${this.siteId} の現場データは仮登録状態です。`,
735
751
  );
736
752
  }
737
753
 
@@ -813,8 +829,8 @@ export default class SiteOperationSchedule extends Operation {
813
829
  const color = !this.isEditable
814
830
  ? "grey"
815
831
  : this.shiftType === "DAY"
816
- ? "orange"
817
- : "indigo";
832
+ ? "orange"
833
+ : "indigo";
818
834
  return {
819
835
  name,
820
836
  start: this.dateAt,
@@ -320,6 +320,7 @@ export const fieldDefinitions = {
320
320
  name: generalDefinitions.oneLine.component.name,
321
321
  attrs: {
322
322
  inputType: "email",
323
+ inputmode: "email",
323
324
  },
324
325
  },
325
326
  },
@@ -347,6 +348,7 @@ export const fieldDefinitions = {
347
348
  attrs: {
348
349
  counter: true,
349
350
  inputType: "tel",
351
+ inputmode: "tel",
350
352
  },
351
353
  },
352
354
  },
@@ -359,6 +361,7 @@ export const fieldDefinitions = {
359
361
  attrs: {
360
362
  counter: true,
361
363
  inputType: "tel",
364
+ inputmode: "tel",
362
365
  },
363
366
  },
364
367
  },
@@ -421,6 +424,7 @@ export const fieldDefinitions = {
421
424
  attrs: {
422
425
  counter: true,
423
426
  inputType: "tel",
427
+ inputmode: "tel",
424
428
  },
425
429
  },
426
430
  },
@@ -482,6 +486,7 @@ export const fieldDefinitions = {
482
486
  attrs: {
483
487
  counter: true,
484
488
  inputType: "tel",
489
+ inputmode: "tel",
485
490
  },
486
491
  },
487
492
  },
@@ -704,7 +709,7 @@ export const defField = (key, options = {}) => {
704
709
 
705
710
  if (!baseConfigSource) {
706
711
  console.warn(
707
- `[parts/fieldDefinitions.js defField] Definition for key "${key}" not found. Using fieldDefinitions.default as base.`
712
+ `[parts/fieldDefinitions.js defField] Definition for key "${key}" not found. Using fieldDefinitions.default as base.`,
708
713
  );
709
714
  baseConfigSource = effectiveDefaultDefinition;
710
715
  isFallback = true;