@shisyamo4131/air-guard-v2-schemas 2.4.2-dev.80 → 2.4.2-dev.81
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/Employee.js +13 -17
- package/src/constants/employment-status.js +2 -2
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
|
|
|
@@ -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
|
];
|