@shisyamo4131/air-guard-v2-schemas 2.4.2-dev.80 → 2.4.2-dev.83
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
package/src/Employee.js
CHANGED
|
@@ -71,7 +71,7 @@ import Insurance from "./Insurance.js";
|
|
|
71
71
|
* @static
|
|
72
72
|
* @property {Object} EMPLOYMENT_STATUS - 雇用状況の定数オブジェクト
|
|
73
73
|
* @property {string} STATUS_ACTIVE - 在職中の雇用状況を表す定数
|
|
74
|
-
* @property {string}
|
|
74
|
+
* @property {string} STATUS_RESIGNED - 退職済みの雇用状況を表す定数
|
|
75
75
|
*
|
|
76
76
|
* @function toTerminated - 現在の従業員インスタンスを退職済みに変更する関数
|
|
77
77
|
*****************************************************************************/
|
|
@@ -103,19 +103,17 @@ export default class Employee extends GeocodableMixin(FireModel) {
|
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* 退職年月日
|
|
106
|
-
* - `employmentStatus` が `
|
|
106
|
+
* - `employmentStatus` が `RESIGNED` の場合、必須フィールド。
|
|
107
107
|
* - `employmentStatus` が `ACTIVE` の場合、入力不可(disabled)。
|
|
108
108
|
* - バリデーションルール:
|
|
109
|
-
* - `employmentStatus` が `
|
|
110
|
-
* - `employmentStatus` が `
|
|
109
|
+
* - `employmentStatus` が `RESIGNED` の場合、必須。
|
|
110
|
+
* - `employmentStatus` が `RESIGNED` の場合、`dateOfHire` より前の日付は不可。
|
|
111
111
|
* - `employmentStatus` が `ACTIVE` の場合、常に null でなければならない。
|
|
112
112
|
* - フロントエンドのフォームでは、`employmentStatus` の値に応じて入力フィールドの表示/非表示や必須/任意を切り替えることが推奨される。
|
|
113
113
|
*/
|
|
114
114
|
dateOfTermination: defField("dateOfTermination", {
|
|
115
115
|
validator: (value, item) => {
|
|
116
|
-
if (
|
|
117
|
-
item.employmentStatus === EMPLOYMENT_STATUS_VALUES.TERMINATED.value
|
|
118
|
-
) {
|
|
116
|
+
if (item.employmentStatus === EMPLOYMENT_STATUS_VALUES.RESIGNED.value) {
|
|
119
117
|
if (!value) {
|
|
120
118
|
return VALIDATION_ERRORS.CUSTOM_ERROR(
|
|
121
119
|
"INVALID_DATE_OF_TERMINATION",
|
|
@@ -143,15 +141,13 @@ export default class Employee extends GeocodableMixin(FireModel) {
|
|
|
143
141
|
component: {
|
|
144
142
|
attrs: {
|
|
145
143
|
required: ({ item }) =>
|
|
146
|
-
item.employmentStatus === EMPLOYMENT_STATUS_VALUES.
|
|
144
|
+
item.employmentStatus === EMPLOYMENT_STATUS_VALUES.RESIGNED.value,
|
|
147
145
|
},
|
|
148
146
|
},
|
|
149
147
|
}),
|
|
150
148
|
reasonOfTermination: defField("reasonOfTermination", {
|
|
151
149
|
validator: (value, item) => {
|
|
152
|
-
if (
|
|
153
|
-
item.employmentStatus === EMPLOYMENT_STATUS_VALUES.TERMINATED.value
|
|
154
|
-
) {
|
|
150
|
+
if (item.employmentStatus === EMPLOYMENT_STATUS_VALUES.RESIGNED.value) {
|
|
155
151
|
if (!value) {
|
|
156
152
|
return VALIDATION_ERRORS.CUSTOM_ERROR(
|
|
157
153
|
"INVALID_REASON_OF_TERMINATION",
|
|
@@ -172,7 +168,7 @@ export default class Employee extends GeocodableMixin(FireModel) {
|
|
|
172
168
|
component: {
|
|
173
169
|
attrs: {
|
|
174
170
|
required: ({ item }) =>
|
|
175
|
-
item.employmentStatus === EMPLOYMENT_STATUS_VALUES.
|
|
171
|
+
item.employmentStatus === EMPLOYMENT_STATUS_VALUES.RESIGNED.value,
|
|
176
172
|
},
|
|
177
173
|
},
|
|
178
174
|
}),
|
|
@@ -570,7 +566,7 @@ export default class Employee extends GeocodableMixin(FireModel) {
|
|
|
570
566
|
];
|
|
571
567
|
|
|
572
568
|
static STATUS_ACTIVE = EMPLOYMENT_STATUS_VALUES.ACTIVE.value;
|
|
573
|
-
static
|
|
569
|
+
static STATUS_RESIGNED = EMPLOYMENT_STATUS_VALUES.RESIGNED.value;
|
|
574
570
|
|
|
575
571
|
/** 2026-03-18 追加 */
|
|
576
572
|
static EMPLOYMENT_STATUS = EMPLOYMENT_STATUS_VALUES;
|
|
@@ -682,13 +678,13 @@ export default class Employee extends GeocodableMixin(FireModel) {
|
|
|
682
678
|
|
|
683
679
|
/**
|
|
684
680
|
* 退職状態に関連するフィールドを初期化します。
|
|
685
|
-
* - `employmentStatus` が `
|
|
681
|
+
* - `employmentStatus` が `RESIGNED` でない場合、以下のプロパティを初期化します。
|
|
686
682
|
* - `dateOfTermination`
|
|
687
683
|
* - `reasonOfTermination`
|
|
688
684
|
* @returns {void}
|
|
689
685
|
*/
|
|
690
686
|
_initTerminatedFields() {
|
|
691
|
-
if (this.employmentStatus !== EMPLOYMENT_STATUS_VALUES.
|
|
687
|
+
if (this.employmentStatus !== EMPLOYMENT_STATUS_VALUES.RESIGNED.value) {
|
|
692
688
|
this.dateOfTermination = null;
|
|
693
689
|
this.reasonOfTermination = null;
|
|
694
690
|
}
|
|
@@ -785,7 +781,7 @@ export default class Employee extends GeocodableMixin(FireModel) {
|
|
|
785
781
|
// - 一度退職処理した従業員の復帰処理は現状想定していないが、将来的に必要になった場合は `toActive` メソッド等を追加実装すること。
|
|
786
782
|
if (
|
|
787
783
|
!this._skipToTerminatedCheck &&
|
|
788
|
-
this.employmentStatus === Employee.
|
|
784
|
+
this.employmentStatus === Employee.STATUS_RESIGNED &&
|
|
789
785
|
this._beforeData.employmentStatus === Employee.STATUS_ACTIVE
|
|
790
786
|
) {
|
|
791
787
|
throw new Error(
|
|
@@ -834,7 +830,7 @@ export default class Employee extends GeocodableMixin(FireModel) {
|
|
|
834
830
|
);
|
|
835
831
|
}
|
|
836
832
|
|
|
837
|
-
this.employmentStatus = Employee.
|
|
833
|
+
this.employmentStatus = Employee.STATUS_RESIGNED;
|
|
838
834
|
this.dateOfTermination = dateOfTermination;
|
|
839
835
|
this.reasonOfTermination = reasonOfTermination;
|
|
840
836
|
|
|
@@ -1,13 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
* @file arrangement-notification-status.js
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
* @file ./src/constants/arrangement-notification-status.js
|
|
3
|
+
* @description 配置通知状態定義
|
|
4
|
+
*
|
|
5
|
+
* ### 状態
|
|
6
|
+
* - 配置済(ARRANGED): 管制により配置が行われた状態で、配置通知の初期状態。作業員はまだ確認していない。
|
|
7
|
+
* - 確認済(CONFIRMED): 作業員が配置通知を確認し、了承した状態。
|
|
8
|
+
* - 上番済(ARRIVED): 作業員が現場に到着し、作業を開始できる状態。
|
|
9
|
+
* - 下番済(LEAVED): 作業員が作業を完了し、現場から離脱した状態。
|
|
10
|
+
*
|
|
11
|
+
* ### 状態遷移ルール
|
|
12
|
+
* - 配置済 (ARRANGED) : 確認済 (CONFIRMED) へ遷移可能。その他の状態への遷移は不可。
|
|
13
|
+
* - 確認済 (CONFIRMED) : 上番済 (ARRIVED) へ遷移可能。
|
|
14
|
+
* 運用上は配置から外す処理によって配置通知ドキュメントそのものが削除されるため、配置済 (ARRANGED) への遷移は発生しない想定。
|
|
15
|
+
* - 上番済 (ARRIVED) : 確認済 (CONFIRMED) または下番済 (LEAVED) へ遷移可能。(誤って上番してしまった時)
|
|
16
|
+
* 誤って上番してしまった場合に「確認済」へ戻すことも可能とする。
|
|
17
|
+
* - 下番済 (LEAVED) : 上番済 (ARRIVED) または下番済 (LEAVED) へ遷移可能。(誤って下番してしまった時)
|
|
18
|
+
*****************************************************************************/
|
|
5
19
|
export const VALUES = Object.freeze({
|
|
6
20
|
ARRANGED: {
|
|
7
21
|
value: "ARRANGED",
|
|
8
22
|
title: "配置済",
|
|
9
23
|
order: 1,
|
|
10
24
|
color: "#F57C00", // 🟠 配置通知済み(待機中)
|
|
25
|
+
/**
|
|
26
|
+
* 現在の状態に関わらず、常に使用不可。配置通知の初期状態であり、ユーザーが手動で「配置済」に設定することはないため。
|
|
27
|
+
* @param {*} currentStatus
|
|
28
|
+
* @returns {boolean}
|
|
29
|
+
*/
|
|
30
|
+
disabled: (currentStatus) => {
|
|
31
|
+
return true;
|
|
32
|
+
},
|
|
11
33
|
},
|
|
12
34
|
|
|
13
35
|
CONFIRMED: {
|
|
@@ -15,6 +37,16 @@ export const VALUES = Object.freeze({
|
|
|
15
37
|
title: "確認済",
|
|
16
38
|
order: 2,
|
|
17
39
|
color: "#2196F3", // 🔵 作業員が了承済み(準備中)
|
|
40
|
+
/**
|
|
41
|
+
* 現在の状態が「配置済」または「上番済」でなければ使用不可。
|
|
42
|
+
* - 「配置済」-> 「確認済」への遷移は可能。
|
|
43
|
+
* - 「上番済」-> 「確認済」への遷移は不可。
|
|
44
|
+
* @param {*} currentStatus
|
|
45
|
+
* @returns {boolean}
|
|
46
|
+
*/
|
|
47
|
+
disabled: (currentStatus) => {
|
|
48
|
+
return !(currentStatus === "ARRANGED" || currentStatus === "ARRIVED");
|
|
49
|
+
},
|
|
18
50
|
},
|
|
19
51
|
|
|
20
52
|
ARRIVED: {
|
|
@@ -22,6 +54,15 @@ export const VALUES = Object.freeze({
|
|
|
22
54
|
title: "上番済",
|
|
23
55
|
order: 3,
|
|
24
56
|
color: "#4CAF50", // 🟢 現場到着、作業開始可能
|
|
57
|
+
/**
|
|
58
|
+
* 現在の状態が「確認済」または「下番済」でなければ使用不可。
|
|
59
|
+
* - 「下番済」から「上番済」への遷移は可能(誤って下番してしまった場合に再度上番に戻すことを許容)。
|
|
60
|
+
* @param {*} currentStatus
|
|
61
|
+
* @returns {boolean}
|
|
62
|
+
*/
|
|
63
|
+
disabled: (currentStatus) => {
|
|
64
|
+
return !(currentStatus === "CONFIRMED" || currentStatus === "LEAVED");
|
|
65
|
+
},
|
|
25
66
|
},
|
|
26
67
|
|
|
27
68
|
LEAVED: {
|
|
@@ -29,6 +70,16 @@ export const VALUES = Object.freeze({
|
|
|
29
70
|
title: "下番済",
|
|
30
71
|
order: 4,
|
|
31
72
|
color: "#607D8B", // ⚫ 作業完了、離脱済み
|
|
73
|
+
/**
|
|
74
|
+
* 現在の状態が「上番済」または「下番済」でなければ使用不可。
|
|
75
|
+
* - 「上番済」-> 「下番済」への遷移は可能。
|
|
76
|
+
* - 「下番済」-> 「下番済」への遷移は可能(誤って下番してしまった場合に再度下番することを許容)。
|
|
77
|
+
* @param {*} currentStatus
|
|
78
|
+
* @returns {boolean}
|
|
79
|
+
*/
|
|
80
|
+
disabled: (currentStatus) => {
|
|
81
|
+
return !(currentStatus === "ARRIVED" || currentStatus === "LEAVED");
|
|
82
|
+
},
|
|
32
83
|
},
|
|
33
84
|
|
|
34
85
|
/**
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
export const VALUES = Object.freeze({
|
|
8
8
|
ACTIVE: { value: "ACTIVE", title: "在職中" },
|
|
9
|
-
|
|
9
|
+
RESIGNED: { value: "RESIGNED", title: "退職済み" },
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export const OPTIONS = [
|
|
13
13
|
{ title: VALUES.ACTIVE.title, value: VALUES.ACTIVE.value },
|
|
14
|
-
{ title: VALUES.
|
|
14
|
+
{ title: VALUES.RESIGNED.title, value: VALUES.RESIGNED.value },
|
|
15
15
|
];
|