@shisyamo4131/air-guard-v2-schemas 2.3.7-dev.6 → 2.3.7-dev.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shisyamo4131/air-guard-v2-schemas",
3
- "version": "2.3.7-dev.6",
3
+ "version": "2.3.7-dev.9",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/Company.js CHANGED
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Company Model
3
- * @version 1.2.0
3
+ * @version 1.3.0
4
4
  * @author shisyamo4131
5
+ * @update 2025-12-01 Add Stripe integration fields (stripeCustomerId, subscription).
5
6
  * @update 2025-11-27 Add bank information fields for billing.
6
7
  * @update 2025-11-23 Set `usePrefix` to false.
7
8
  */
@@ -92,6 +93,24 @@ const classProps = {
92
93
  },
93
94
  },
94
95
  }),
96
+
97
+ /** Stripe連携フィールド */
98
+ stripeCustomerId: defField("oneLine", {
99
+ label: "Stripe顧客ID",
100
+ hidden: true,
101
+ length: 100,
102
+ }),
103
+
104
+ subscription: defField("object", {
105
+ label: "サブスクリプション情報",
106
+ hidden: true,
107
+ default: () => ({
108
+ id: null,
109
+ status: null,
110
+ currentPeriodEnd: null,
111
+ employeeLimit: 10,
112
+ }),
113
+ }),
95
114
  };
96
115
 
97
116
  export default class Company extends FireModel {
@@ -1,8 +1,9 @@
1
1
  /*****************************************************************************
2
2
  * SiteOperationSchedule Model ver 1.1.0
3
- * @version 1.1.0
3
+ * @version 1.1.1
4
4
  * @author shisyamo4131
5
5
  *
6
+ * @update 2025-11-28 v1.1.1 - Removed the `agreement` parameter from `syncToOperationResult` method.
6
7
  * @update 2025-11-22 v1.1.0 - Moved `duplicate`, `notify`, `syncToOperationResult`,
7
8
  * and `toEvent` methods from client side code.
8
9
  *
@@ -167,7 +168,8 @@
167
168
  * @method syncToOperationResult - Creates an OperationResult document based on the current SiteOperationSchedule
168
169
  * - The OperationResult document ID will be the same as the SiteOperationSchedule document ID.
169
170
  * - Sets the `operationResultId` property of the SiteOperationSchedule to the created OperationResult document ID.
170
- * - Accepts an `agreement` object containing necessary properties for creating the OperationResult.
171
+ * - If an OperationResult already exists, it will be overwritten.
172
+ * - [UPDATE 2025-11-28] Removed the `agreement` parameter. The agreement is now fetched internally.
171
173
  *
172
174
  * @method toEvent - Converts the SiteOperationSchedule instance to a VCalendar event object
173
175
  * - Returns an object with properties required for displaying events in Vuetify's VCalendar component.
@@ -679,9 +681,14 @@ export default class SiteOperationSchedule extends Operation {
679
681
  * 既に存在する場合は上書きされます。
680
682
  * - 現場稼働予定ドキュメントの `operationResultId` プロパティに
681
683
  * 作成された稼働実績ドキュメントの ID が設定されます。(当該ドキュメント ID と同一)
682
- * @param {Object} agreement - 取極め情報オブジェクト。稼働実績ドキュメントの生成に必要なプロパティを含みます。
684
+ * @param {Object} notifications - 配置通知オブジェクトのマップ。
685
+ * - キー: 配置通知の一意キー(`notificationKey` プロパティ)
686
+ * - 値: 配置通知ドキュメントオブジェクト
687
+ * @returns {Promise<void>}
688
+ *
689
+ * @update 2025-11-28 - Removed the `agreement` parameter.
683
690
  */
684
- async syncToOperationResult(agreement, notifications = {}) {
691
+ async syncToOperationResult(notifications = {}) {
685
692
  if (!this.docId) {
686
693
  throw new Error(
687
694
  "不正な処理です。作成前の現場稼働予定から稼働実績を作成することはできません。"
@@ -712,10 +719,8 @@ export default class SiteOperationSchedule extends Operation {
712
719
  ...this.toObject(),
713
720
  employees,
714
721
  outsourcers,
715
- // agreement: agreement || null,
716
722
  siteOperationScheduleId: this.docId,
717
723
  });
718
- // operationResult.refreshBillingDateAt();
719
724
  await this.constructor.runTransaction(async (transaction) => {
720
725
  const docRef = await operationResult.create({
721
726
  docId: this.docId,