@shisyamo4131/air-guard-v2-schemas 2.3.7-dev.35 → 2.3.7-dev.37
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/Certification.js +20 -1
- package/src/constants/index.js +4 -0
package/package.json
CHANGED
package/src/Certification.js
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* @version 1.0.0
|
|
4
4
|
* @author shisyamo4131
|
|
5
5
|
* @description 警備業務資格モデル
|
|
6
|
+
*
|
|
7
|
+
* NOTE: 配列で管理されるので key が必要。2025-12-08 現在、資格名が重複することはない想定。
|
|
8
|
+
* 但し、2バイト文字が key として適切かは要検討。
|
|
6
9
|
*/
|
|
7
10
|
import { BaseClass } from "@shisyamo4131/air-firebase-v2";
|
|
8
11
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
@@ -11,7 +14,7 @@ const classProps = {
|
|
|
11
14
|
name: defField("name", { label: "資格名", required: true }),
|
|
12
15
|
type: defField("certificationType", { required: true }),
|
|
13
16
|
issuedBy: defField("name", { label: "発行元" }),
|
|
14
|
-
issueDateAt: defField("dateAt", { label: "取得日" }),
|
|
17
|
+
issueDateAt: defField("dateAt", { label: "取得日", required: true }),
|
|
15
18
|
expirationDateAt: defField("dateAt", { label: "有効期限" }),
|
|
16
19
|
serialNumber: defField("oneLine", { label: "証明書番号" }),
|
|
17
20
|
};
|
|
@@ -23,8 +26,24 @@ const classProps = {
|
|
|
23
26
|
* @prop {Date} issueDateAt - 取得日
|
|
24
27
|
* @prop {Date} expirationDateAt - 有効期限
|
|
25
28
|
* @prop {string} serialNumber - 証明書番号
|
|
29
|
+
*
|
|
30
|
+
* @prop {string} key - 資格名 (nameと同じ) (読み取り専用)
|
|
26
31
|
*/
|
|
27
32
|
export default class Certification extends BaseClass {
|
|
28
33
|
static className = "資格";
|
|
29
34
|
static classProps = classProps;
|
|
35
|
+
|
|
36
|
+
afterInitialize(item = {}) {
|
|
37
|
+
super.afterInitialize(item);
|
|
38
|
+
Object.defineProperties(this, {
|
|
39
|
+
key: {
|
|
40
|
+
configurable: true,
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get() {
|
|
43
|
+
return this.name;
|
|
44
|
+
},
|
|
45
|
+
set() {},
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
30
49
|
}
|
package/src/constants/index.js
CHANGED
|
@@ -10,6 +10,10 @@ export {
|
|
|
10
10
|
VALUES as BLOOD_TYPE_VALUES,
|
|
11
11
|
OPTIONS as BLOOD_TYPE_OPTIONS,
|
|
12
12
|
} from "./blood-type.js";
|
|
13
|
+
export {
|
|
14
|
+
VALUES as CERTIFICATION_TYPE_VALUES,
|
|
15
|
+
OPTIONS as CERTIFICATION_TYPE_OPTIONS,
|
|
16
|
+
} from "./certification-type.js";
|
|
13
17
|
export {
|
|
14
18
|
VALUES as CONTRACT_STATUS_VALUES,
|
|
15
19
|
OPTIONS as CONTRACT_STATUS_OPTIONS,
|