@shisyamo4131/air-guard-v2-schemas 2.4.2-dev.70 → 2.4.2-dev.71

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Insurance.js +20 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shisyamo4131/air-guard-v2-schemas",
3
- "version": "2.4.2-dev.70",
3
+ "version": "2.4.2-dev.71",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/Insurance.js CHANGED
@@ -33,6 +33,8 @@ export const ERROR_MESSAGES = Object.freeze({
33
33
  * @property {boolean} isRetire - 退職による喪失であるかどうかを表す真偽値。退職による喪失の場合は true、そうでない場合は false になります。
34
34
  * @property {Array} history - 状態遷移の履歴を記録するための配列。各要素は状態遷移前の状態を表すオブジェクトです。
35
35
  *
36
+ * @property {string} enrollmentDate - `enrollmentDateAt` に基づく YYYY-MM-DD 形式の日付文字列 (読み取り専用)
37
+ *
36
38
  * @note
37
39
  * - 各プロパティは `現在の状態` を表すもので、状態の遷移には対応するメソッドを利用します。
38
40
  * - `lossDateAt`(喪失日)、`lossReason`(喪失理由)、`isRetire`(退職フラグ)は、`現在の状態` という意味では不要なプロパティですが、
@@ -87,6 +89,24 @@ export default class Insurance extends BaseClass {
87
89
  [INSURANCE_STATUS.EXEMPT.value]: [INSURANCE_STATUS.ENROLLED.value],
88
90
  };
89
91
 
92
+ afterInitialize(item = {}) {
93
+ super.afterInitialize(item);
94
+
95
+ Object.defineProperties(this, {
96
+ /**
97
+ * enrollmentDate - `enrollmentDateAt` に基づく YYYY-MM-DD 形式の日付文字列 (読み取り専用)
98
+ */
99
+ enrollmentDate: {
100
+ configurable: true,
101
+ enumerable: true,
102
+ get() {
103
+ return formatJstDate(this.enrollmentDateAt) || "";
104
+ },
105
+ set(v) {},
106
+ },
107
+ });
108
+ }
109
+
90
110
  /**
91
111
  * 状態チェック用ヘルパーメソッド
92
112
  */