@shisyamo4131/air-guard-v2-schemas 2.3.7-dev.13 → 2.3.7-dev.15

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.13",
3
+ "version": "2.3.7-dev.15",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/Employee.js CHANGED
@@ -24,10 +24,13 @@ const classProps = {
24
24
  address: defField("address", { required: true }),
25
25
  building: defField("building"),
26
26
  location: defField("location", { hidden: true }), // 非表示でOK
27
+ mobile: defField("mobile", { required: true }),
28
+ email: defField("email", { required: false }),
27
29
  dateOfHire: defField("dateAt", { label: "入社日", required: true }),
28
30
  employmentStatus: defField("employmentStatus", { required: true }),
29
31
  dateOfTermination: defField("dateAt", {
30
32
  label: "退職日",
33
+ default: null,
31
34
  component: {
32
35
  attrs: {
33
36
  required: (item) => item.employmentStatus === "terminated",
@@ -89,6 +92,8 @@ const classProps = {
89
92
  * @props {string} address - Address details.
90
93
  * @props {string} building - Building name.
91
94
  * @props {object} location - Geographical location.
95
+ * @props {string} mobile - Mobile phone number.
96
+ * @props {string} email - Email address.
92
97
  * @props {Date} dateOfHire - Date of hire.
93
98
  * @props {string} employmentStatus - Employment status.
94
99
  * @props {Date} dateOfTermination - Date of termination.
@@ -181,7 +181,6 @@
181
181
  * @method delete - Override delete method to allow deletion even when isLocked is true
182
182
  *****************************************************************************/
183
183
  import OperationResult from "./OperationResult.js";
184
- import Operation from "./Operation.js";
185
184
 
186
185
  export default class OperationBilling extends OperationResult {
187
186
  static className = "稼働請求";
@@ -192,28 +191,38 @@ export default class OperationBilling extends OperationResult {
192
191
  { title: "売上金額", key: "salesAmount", value: "salesAmount" },
193
192
  ];
194
193
 
195
- async create() {
196
- return Promise.reject(new Error("[OperationBilling.js] Not implemented."));
194
+ /**
195
+ * Override beforeUpdate to skip `isLocked` check and sync customerId and apply agreement if key changed
196
+ * @returns {Promise<void>}
197
+ */
198
+ async beforeUpdate() {
199
+ // Sync customerId and apply agreement if key changed
200
+ if (this.key === this._beforeData.key) return;
201
+ await this._syncCustomerIdAndApplyAgreement();
197
202
  }
198
203
 
199
204
  /**
200
- * Override update method to allow editing even when isLocked is true
201
- * @param {*} options
202
- * @returns {Promise<void>}
205
+ * Override create method to disallow creation of OperationBilling instances
206
+ * @returns
203
207
  */
204
- async update(options = {}) {
205
- // isLockedのチェックをスキップして、親クラス(Operation)のupdateを直接呼び出す
206
- return await Operation.prototype.update.call(this, options);
208
+ async create() {
209
+ return Promise.reject(
210
+ new Error(
211
+ "[OperationBilling.js] Creation of OperationBilling is not implemented."
212
+ )
213
+ );
207
214
  }
208
215
 
209
216
  /**
210
- * Override delete method to allow deletion even when isLocked is true
211
- * @param {*} options
217
+ * Override delete method to disallow deletion of OperationBilling instances
212
218
  * @returns {Promise<void>}
213
219
  */
214
- async delete(options = {}) {
215
- // isLockedのチェックをスキップして、親クラス(Operation)のdeleteを直接呼び出す
216
- return await Operation.prototype.delete.call(this, options);
220
+ async delete() {
221
+ return Promise.reject(
222
+ new Error(
223
+ "[OperationBilling.js] Deletion of OperationBilling is not implemented."
224
+ )
225
+ );
217
226
  }
218
227
 
219
228
  /**
@@ -293,6 +293,18 @@ export const fieldDefinitions = {
293
293
  },
294
294
  },
295
295
  },
296
+ mobile: {
297
+ ...generalDefinitions.oneLine,
298
+ label: "携帯電話",
299
+ length: 13,
300
+ component: {
301
+ name: generalDefinitions.oneLine.component.name,
302
+ attrs: {
303
+ counter: true,
304
+ inputType: "tel",
305
+ },
306
+ },
307
+ },
296
308
  name: {
297
309
  ...generalDefinitions.oneLine,
298
310
  label: "名前",