@shisyamo4131/air-guard-v2-schemas 1.3.1-dev.8 → 1.3.1-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": "1.3.1-dev.8",
3
+ "version": "1.3.1-dev.9",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -56,6 +56,10 @@
56
56
  * @prop {boolean} isLocked - Lock flag
57
57
  * - When set to true, the OperationResult is locked from edits exept for editing as OperationBilling.
58
58
  * @prop {Agreement|null} agreement - Associated Agreement object
59
+ * - The Agreement instance associated with this OperationResult for pricing and billing information.
60
+ * - When set, it influences billing calculations such as unit prices and billing dates.
61
+ * @prop {boolean} allowEmptyAgreement - Flag to ignore missing Agreement
62
+ * - When set to true, allows the OperationResult to be valid even if no Agreement is associated.
59
63
  *
60
64
  * @readonly
61
65
  * @prop {string} date - Date string in YYYY-MM-DD format based on `dateAt` (read-only)
@@ -56,7 +56,10 @@
56
56
  * @prop {boolean} isLocked - Lock flag
57
57
  * - When set to true, the OperationResult is locked from edits exept for editing as OperationBilling.
58
58
  * @prop {Agreement|null} agreement - Associated Agreement object
59
- *
59
+ * - The Agreement instance associated with this OperationResult for pricing and billing information.
60
+ * - When set, it influences billing calculations such as unit prices and billing dates.
61
+ * @prop {boolean} allowEmptyAgreement - Flag to ignore missing Agreement
62
+ * - When set to true, allows the OperationResult to be valid even if no Agreement is associated.
60
63
  * @readonly
61
64
  * @prop {string} date - Date string in YYYY-MM-DD format based on `dateAt` (read-only)
62
65
  * - Returns a string in the format YYYY-MM-DD based on `dateAt`.
@@ -209,7 +212,7 @@ const classProps = {
209
212
  default: false,
210
213
  }),
211
214
  agreement: defField("object", { label: "取極め", customClass: Agreement }),
212
- ignoreEmptyAgreement: defField("check", {
215
+ allowEmptyAgreement: defField("check", {
213
216
  label: "取極めなしを無視",
214
217
  default: false,
215
218
  }),
@@ -444,7 +447,7 @@ export default class OperationResult extends Operation {
444
447
  enumerable: true,
445
448
  get() {
446
449
  if (this.hasAgreement) return true;
447
- return this.ignoreEmptyAgreement;
450
+ return this.allowEmptyAgreement;
448
451
  },
449
452
  set(v) {},
450
453
  },
@@ -484,14 +487,14 @@ export default class OperationResult extends Operation {
484
487
  }
485
488
 
486
489
  /**
487
- * Override create method to validate billingDateAt when ignoreEmptyAgreement is true
490
+ * Override create method to validate billingDateAt when allowEmptyAgreement is true
488
491
  * @param {*} options
489
492
  * @returns {Promise<DocumentReference>}
490
493
  */
491
494
  async create(options = {}) {
492
- if (this.ignoreEmptyAgreement && !this.billingDateAt) {
495
+ if (this.allowEmptyAgreement && !this.billingDateAt) {
493
496
  throw new Error(
494
- "[OperationResult] Billing date is required when 'ignoreEmptyAgreement' is true."
497
+ "[OperationResult] Billing date is required when 'allowEmptyAgreement' is true."
495
498
  );
496
499
  }
497
500
  return await super.create(options);
@@ -499,7 +502,7 @@ export default class OperationResult extends Operation {
499
502
 
500
503
  /**
501
504
  * Override update method to prevent editing if isLocked is true
502
- * - Also validate billingDateAt when ignoreEmptyAgreement is true
505
+ * - Also validate billingDateAt when allowEmptyAgreement is true
503
506
  * @param {*} options
504
507
  * @returns {Promise<void>}
505
508
  */
@@ -509,9 +512,9 @@ export default class OperationResult extends Operation {
509
512
  "[OperationResult] This OperationResult is locked and cannot be edited."
510
513
  );
511
514
  }
512
- if (this.ignoreEmptyAgreement && !this.billingDateAt) {
515
+ if (this.allowEmptyAgreement && !this.billingDateAt) {
513
516
  throw new Error(
514
- "[OperationResult] Billing date is required when 'ignoreEmptyAgreement' is true."
517
+ "[OperationResult] Billing date is required when 'allowEmptyAgreement' is true."
515
518
  );
516
519
  }
517
520
  return await super.update(options);