@shisyamo4131/air-guard-v2-schemas 2.3.7-dev.3 → 2.3.7-dev.30

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 CHANGED
@@ -14,4 +14,5 @@ export { default as Site } from "./src/Site.js";
14
14
  export { default as SiteOperationSchedule } from "./src/SiteOperationSchedule.js";
15
15
  export { default as SiteOperationScheduleDetail } from "./src/SiteOperationScheduleDetail.js";
16
16
  export { default as SiteOrder } from "./src/SiteOrder.js";
17
+ export { default as System } from "./src/System.js";
17
18
  export { default as User } from "./src/User.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shisyamo4131/air-guard-v2-schemas",
3
- "version": "2.3.7-dev.3",
3
+ "version": "2.3.7-dev.30",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/Company.js CHANGED
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * Company Model
3
- * @version 1.2.0
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 ver 1.1.0
3
- * @author shisyamo4131
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
- * @prop {string} code - customer code
10
- * @prop {string} name - customer name
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("number", {
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";