@shisyamo4131/air-guard-v2-schemas 2.3.7-dev.44 → 2.3.7-dev.45

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.44",
3
+ "version": "2.3.7-dev.45",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/Customer.js CHANGED
@@ -41,7 +41,7 @@ const classProps = {
41
41
  }),
42
42
  paymentDate: defField("select", {
43
43
  label: "入金サイト(日付)",
44
- default: CutoffDate.VALUES.END_OF_MONTH,
44
+ default: CutoffDate.VALUES[0].value,
45
45
  required: true,
46
46
  component: {
47
47
  attrs: {
@@ -135,7 +135,7 @@ export default class Customer extends FireModel {
135
135
  const finalMonth = targetMonth % 12;
136
136
 
137
137
  let dueDate;
138
- if (this.paymentDate === CutoffDate.VALUES.END_OF_MONTH) {
138
+ if (this.paymentDate === CutoffDate.VALUES[0].value) {
139
139
  // 月末の場合
140
140
  dueDate = new Date(Date.UTC(targetYear, finalMonth + 1, 0));
141
141
  } else {
@@ -540,7 +540,7 @@ export const fieldDefinitions = {
540
540
  },
541
541
  cutoffDate: {
542
542
  ...generalDefinitions.select,
543
- default: CutoffDate.VALUES.END_OF_MONTH,
543
+ default: CutoffDate.VALUES[0].value,
544
544
  label: "締日",
545
545
  component: {
546
546
  name: generalDefinitions.select.component.name,
@@ -22,24 +22,24 @@ export default class CutoffDate {
22
22
  * Cutoff date constant values
23
23
  */
24
24
  static VALUES = Object.freeze({
25
- DAY_5: 5,
26
- DAY_10: 10,
27
- DAY_15: 15,
28
- DAY_20: 20,
29
- DAY_25: 25,
30
- END_OF_MONTH: 0,
25
+ 5: { value: 5, title: "5日" },
26
+ 10: { value: 10, title: "10日" },
27
+ 15: { value: 15, title: "15日" },
28
+ 20: { value: 20, title: "20日" },
29
+ 25: { value: 25, title: "25日" },
30
+ 0: { value: 0, title: "月末" },
31
31
  });
32
32
 
33
33
  /**
34
34
  * Options for selection components
35
35
  */
36
36
  static OPTIONS = [
37
- { title: "5日", value: CutoffDate.VALUES.DAY_5 },
38
- { title: "10日", value: CutoffDate.VALUES.DAY_10 },
39
- { title: "15日", value: CutoffDate.VALUES.DAY_15 },
40
- { title: "20日", value: CutoffDate.VALUES.DAY_20 },
41
- { title: "25日", value: CutoffDate.VALUES.DAY_25 },
42
- { title: "月末", value: CutoffDate.VALUES.END_OF_MONTH },
37
+ { title: "5日", value: CutoffDate.VALUES[5].value },
38
+ { title: "10日", value: CutoffDate.VALUES[10].value },
39
+ { title: "15日", value: CutoffDate.VALUES[15].value },
40
+ { title: "20日", value: CutoffDate.VALUES[20].value },
41
+ { title: "25日", value: CutoffDate.VALUES[25].value },
42
+ { title: "月末", value: CutoffDate.VALUES[0].value },
43
43
  ];
44
44
 
45
45
  /**
@@ -50,11 +50,11 @@ export default class CutoffDate {
50
50
  * @returns {number} Actual cutoff day
51
51
  * @example
52
52
  * // Get cutoff day for February 2024 with month-end setting
53
- * const cutoffDay = CutoffDate.calculateActualCutoffDay(2024, 1, CutoffDate.VALUES.END_OF_MONTH);
53
+ * const cutoffDay = CutoffDate.calculateActualCutoffDay(2024, 1, CutoffDate.VALUES[0].value);
54
54
  * // Returns 29 (leap year)
55
55
  */
56
56
  static calculateActualCutoffDay(year, month, cutoffDateValue) {
57
- if (cutoffDateValue === CutoffDate.VALUES.END_OF_MONTH) {
57
+ if (cutoffDateValue === CutoffDate.VALUES[0].value) {
58
58
  // Get last day of the month using UTC
59
59
  return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
60
60
  }