@shisyamo4131/air-guard-v2-schemas 2.3.7-dev.4 → 2.3.7-dev.40
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/index.js +2 -0
- package/package.json +1 -1
- package/src/Certification.js +49 -0
- package/src/Company.js +27 -1
- package/src/Customer.js +50 -36
- package/src/Employee.js +383 -58
- package/src/OperationBilling.js +28 -14
- package/src/OperationResult.js +29 -10
- package/src/Site.js +45 -9
- package/src/SiteOperationSchedule.js +27 -20
- package/src/System.js +43 -0
- package/src/apis/index.js +4 -0
- package/src/constants/blood-type.js +14 -0
- package/src/constants/certification-type.js +34 -0
- package/src/constants/emergency-contact-relation.js +16 -0
- package/src/constants/index.js +12 -0
- package/src/parts/accessorDefinitions.js +13 -27
- package/src/parts/fieldDefinitions.js +135 -3
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as Agreement } from "./src/Agreement.js";
|
|
2
2
|
export { default as ArrangementNotification } from "./src/ArrangementNotification.js";
|
|
3
3
|
export { default as Billing } from "./src/Billing.js";
|
|
4
|
+
export { default as Certification } from "./src/Certification.js";
|
|
4
5
|
export { default as Company } from "./src/Company.js";
|
|
5
6
|
export { default as Customer, CustomerMinimal } from "./src/Customer.js";
|
|
6
7
|
export { default as CutoffDate } from "./src/utils/CutoffDate.js";
|
|
@@ -14,4 +15,5 @@ export { default as Site } from "./src/Site.js";
|
|
|
14
15
|
export { default as SiteOperationSchedule } from "./src/SiteOperationSchedule.js";
|
|
15
16
|
export { default as SiteOperationScheduleDetail } from "./src/SiteOperationScheduleDetail.js";
|
|
16
17
|
export { default as SiteOrder } from "./src/SiteOrder.js";
|
|
18
|
+
export { default as System } from "./src/System.js";
|
|
17
19
|
export { default as User } from "./src/User.js";
|
package/package.json
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Certification Model
|
|
3
|
+
* @version 1.0.0
|
|
4
|
+
* @author shisyamo4131
|
|
5
|
+
* @description 警備業務資格モデル
|
|
6
|
+
*
|
|
7
|
+
* NOTE: 配列で管理されるので key が必要。2025-12-08 現在、資格名が重複することはない想定。
|
|
8
|
+
* 但し、2バイト文字が key として適切かは要検討。
|
|
9
|
+
*/
|
|
10
|
+
import { BaseClass } from "@shisyamo4131/air-firebase-v2";
|
|
11
|
+
import { defField } from "./parts/fieldDefinitions.js";
|
|
12
|
+
|
|
13
|
+
const classProps = {
|
|
14
|
+
name: defField("name", { label: "資格名", required: true }),
|
|
15
|
+
type: defField("certificationType", { required: true }),
|
|
16
|
+
issuedBy: defField("name", { label: "発行元" }),
|
|
17
|
+
issueDateAt: defField("dateAt", { label: "取得日", required: true }),
|
|
18
|
+
expirationDateAt: defField("dateAt", { label: "有効期限" }),
|
|
19
|
+
serialNumber: defField("oneLine", { label: "証明書番号" }),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @prop {string} name - 資格名
|
|
24
|
+
* @prop {string} type - 資格種別 (CERTIFICATION_TYPE_VALUES)
|
|
25
|
+
* @prop {string} issuedBy - 発行元
|
|
26
|
+
* @prop {Date} issueDateAt - 取得日
|
|
27
|
+
* @prop {Date} expirationDateAt - 有効期限
|
|
28
|
+
* @prop {string} serialNumber - 証明書番号
|
|
29
|
+
*
|
|
30
|
+
* @prop {string} key - 資格名 (nameと同じ) (読み取り専用)
|
|
31
|
+
*/
|
|
32
|
+
export default class Certification extends BaseClass {
|
|
33
|
+
static className = "資格";
|
|
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
|
+
}
|
|
49
|
+
}
|
package/src/Company.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Company Model
|
|
3
|
-
* @version 1.
|
|
3
|
+
* @version 1.4.0
|
|
4
4
|
* @author shisyamo4131
|
|
5
|
+
* @update 2025-12-02 Add maintenance information properties.
|
|
6
|
+
* @update 2025-12-01 Add Stripe integration fields (stripeCustomerId, subscription).
|
|
5
7
|
* @update 2025-11-27 Add bank information fields for billing.
|
|
6
8
|
* @update 2025-11-23 Set `usePrefix` to false.
|
|
7
9
|
*/
|
|
@@ -92,6 +94,30 @@ const classProps = {
|
|
|
92
94
|
},
|
|
93
95
|
},
|
|
94
96
|
}),
|
|
97
|
+
|
|
98
|
+
/** Stripe連携フィールド */
|
|
99
|
+
stripeCustomerId: defField("oneLine", {
|
|
100
|
+
label: "Stripe顧客ID",
|
|
101
|
+
hidden: true,
|
|
102
|
+
length: 100,
|
|
103
|
+
}),
|
|
104
|
+
|
|
105
|
+
subscription: defField("object", {
|
|
106
|
+
label: "サブスクリプション情報",
|
|
107
|
+
hidden: true,
|
|
108
|
+
default: () => ({
|
|
109
|
+
id: null,
|
|
110
|
+
status: null,
|
|
111
|
+
currentPeriodEnd: null,
|
|
112
|
+
employeeLimit: 10,
|
|
113
|
+
}),
|
|
114
|
+
}),
|
|
115
|
+
|
|
116
|
+
/** メンテナンス情報 */
|
|
117
|
+
maintenanceMode: defField("check", { default: false, hidden: true }),
|
|
118
|
+
maintenanceReason: defField("oneLine", { default: null, hidden: true }),
|
|
119
|
+
maintenanceStartAt: defField("dateAt", { default: null, hidden: true }),
|
|
120
|
+
maintenanceStartedBy: defField("oneLine", { default: null, hidden: true }),
|
|
95
121
|
};
|
|
96
122
|
|
|
97
123
|
export default class Company extends FireModel {
|
package/src/Customer.js
CHANGED
|
@@ -1,39 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* Customer
|
|
3
|
-
* @
|
|
4
|
-
*
|
|
5
|
-
* @description Customer model.
|
|
6
|
-
*
|
|
1
|
+
/**
|
|
2
|
+
* Customer
|
|
3
|
+
* @version 1.1.1
|
|
4
|
+
* @description This module defines the Customer model for managing customer data.
|
|
7
5
|
* @hasMany Sites - related sites associated with the customer
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
10
|
-
|
|
11
|
-
* @prop {string} nameKana - customer name in kana
|
|
12
|
-
* @prop {string} zipcode - postal code
|
|
13
|
-
* @prop {string} prefCode - prefecture code
|
|
14
|
-
* @prop {string} city - city name
|
|
15
|
-
* @prop {string} address - address details
|
|
16
|
-
* @prop {string} building - building name
|
|
17
|
-
* @prop {object} location - geographical location
|
|
18
|
-
* @prop {string} tel - telephone number
|
|
19
|
-
* @prop {string} fax - fax number
|
|
20
|
-
* @prop {string} contractStatus - contract status
|
|
21
|
-
* @prop {number} paymentMonth - payment site in months
|
|
22
|
-
* @prop {string} paymentDate - payment site date
|
|
23
|
-
* @prop {string} remarks - additional remarks
|
|
24
|
-
*
|
|
25
|
-
* @readonly
|
|
26
|
-
* @prop {string} fullAddress - full address combining prefecture, city, and address (read-only)
|
|
27
|
-
* @prop {string} prefecture - prefecture name derived from `prefCode` (read-only)
|
|
28
|
-
*
|
|
29
|
-
* @static
|
|
30
|
-
* @prop {string} STATUS_ACTIVE - constant for active contract status
|
|
31
|
-
* @prop {string} STATUS_TERMINATED - constant for terminated contract status
|
|
32
|
-
*
|
|
33
|
-
* @method getPaymentDueDateAt
|
|
34
|
-
* @param {Date} baseDate - base date in UTC (JST - 9 hours)
|
|
35
|
-
* @returns {Date} payment due date in UTC (JST - 9 hours)
|
|
36
|
-
*****************************************************************************/
|
|
6
|
+
* @author shisyamo4131
|
|
7
|
+
* @update 2025-12-08 - Changed `paymentMonth` type from direct number to select field.
|
|
8
|
+
*/
|
|
37
9
|
import FireModel from "@shisyamo4131/air-firebase-v2";
|
|
38
10
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
39
11
|
import { defAccessor } from "./parts/accessorDefinitions.js";
|
|
@@ -53,10 +25,23 @@ const classProps = {
|
|
|
53
25
|
tel: defField("tel", { colsDefinition: { cols: 12, sm: 6 } }),
|
|
54
26
|
fax: defField("fax", { colsDefinition: { cols: 12, sm: 6 } }),
|
|
55
27
|
contractStatus: defField("contractStatus", { required: true }),
|
|
56
|
-
paymentMonth: defField("
|
|
28
|
+
paymentMonth: defField("select", {
|
|
57
29
|
default: 1,
|
|
58
30
|
label: "入金サイト(月数)",
|
|
59
31
|
required: true,
|
|
32
|
+
component: {
|
|
33
|
+
attrs: {
|
|
34
|
+
items: [
|
|
35
|
+
{ title: "当月", value: 0 },
|
|
36
|
+
{ title: "翌月", value: 1 },
|
|
37
|
+
{ title: "翌々月", value: 2 },
|
|
38
|
+
{ title: "3ヶ月後", value: 3 },
|
|
39
|
+
{ title: "4ヶ月後", value: 4 },
|
|
40
|
+
{ title: "5ヶ月後", value: 5 },
|
|
41
|
+
{ title: "6ヶ月後", value: 6 },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
60
45
|
}),
|
|
61
46
|
paymentDate: defField("select", {
|
|
62
47
|
label: "入金サイト(日付)",
|
|
@@ -71,6 +56,35 @@ const classProps = {
|
|
|
71
56
|
remarks: defField("multipleLine", { label: "備考" }),
|
|
72
57
|
};
|
|
73
58
|
|
|
59
|
+
/*****************************************************************************
|
|
60
|
+
* @prop {string} code - customer code
|
|
61
|
+
* @prop {string} name - customer name
|
|
62
|
+
* @prop {string} nameKana - customer name in kana
|
|
63
|
+
* @prop {string} zipcode - postal code
|
|
64
|
+
* @prop {string} prefCode - prefecture code
|
|
65
|
+
* @prop {string} city - city name
|
|
66
|
+
* @prop {string} address - address details
|
|
67
|
+
* @prop {string} building - building name
|
|
68
|
+
* @prop {object} location - geographical location
|
|
69
|
+
* @prop {string} tel - telephone number
|
|
70
|
+
* @prop {string} fax - fax number
|
|
71
|
+
* @prop {string} contractStatus - contract status
|
|
72
|
+
* @prop {number} paymentMonth - payment site in months
|
|
73
|
+
* @prop {string} paymentDate - payment site date
|
|
74
|
+
* @prop {string} remarks - additional remarks
|
|
75
|
+
*
|
|
76
|
+
* @readonly
|
|
77
|
+
* @prop {string} fullAddress - full address combining prefecture, city, and address (read-only)
|
|
78
|
+
* @prop {string} prefecture - prefecture name derived from `prefCode` (read-only)
|
|
79
|
+
*
|
|
80
|
+
* @static
|
|
81
|
+
* @prop {string} STATUS_ACTIVE - constant for active contract status
|
|
82
|
+
* @prop {string} STATUS_TERMINATED - constant for terminated contract status
|
|
83
|
+
*
|
|
84
|
+
* @method getPaymentDueDateAt
|
|
85
|
+
* @param {Date} baseDate - base date in UTC (JST - 9 hours)
|
|
86
|
+
* @returns {Date} payment due date in UTC (JST - 9 hours)
|
|
87
|
+
*****************************************************************************/
|
|
74
88
|
export default class Customer extends FireModel {
|
|
75
89
|
static className = "取引先";
|
|
76
90
|
static collectionPath = "Customers";
|