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

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.40",
3
+ "version": "2.3.7-dev.44",
4
4
  "description": "Schemas for AirGuard V2",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/Agreement.js CHANGED
@@ -76,11 +76,10 @@
76
76
  *****************************************************************************/
77
77
  import WorkingResult from "./WorkingResult.js";
78
78
  import {
79
- VALUES as BILLING_UNIT_TYPE,
80
- OPTIONS as BILLING_UNIT_TYPE_OPTIONS,
81
- } from "./constants/billing-unit-type.js";
79
+ BILLING_UNIT_TYPE_VALUES,
80
+ BILLING_UNIT_TYPE_OPTIONS,
81
+ } from "./constants/index.js";
82
82
  import { defField } from "./parts/fieldDefinitions.js";
83
- import CutoffDate from "./utils/CutoffDate.js";
84
83
 
85
84
  const classProps = {
86
85
  ...WorkingResult.classProps,
@@ -98,7 +97,7 @@ const classProps = {
98
97
  required: true,
99
98
  }),
100
99
  billingUnitType: defField("select", {
101
- default: BILLING_UNIT_TYPE.PER_DAY.value,
100
+ default: BILLING_UNIT_TYPE_VALUES.PER_DAY.value,
102
101
  label: "請求単位",
103
102
  required: true,
104
103
  component: {
@@ -111,23 +110,14 @@ const classProps = {
111
110
  label: "請求に休憩時間を含める",
112
111
  default: false,
113
112
  }),
114
- cutoffDate: defField("select", {
115
- label: "締日区分",
116
- default: CutoffDate.VALUES.END_OF_MONTH,
117
- required: true,
118
- component: {
119
- attrs: {
120
- items: CutoffDate.OPTIONS,
121
- },
122
- },
123
- }),
113
+ cutoffDate: defField("cutoffDate", { required: true }),
124
114
  };
125
115
 
126
116
  export default class Agreement extends WorkingResult {
127
117
  static className = "取極め";
128
118
  static classProps = classProps;
129
119
 
130
- static BILLING_UNIT_TYPE = BILLING_UNIT_TYPE;
120
+ static BILLING_UNIT_TYPE = BILLING_UNIT_TYPE_VALUES;
131
121
 
132
122
  /**
133
123
  * Returns an object containing price-related properties.
package/src/Customer.js CHANGED
@@ -9,8 +9,11 @@
9
9
  import FireModel from "@shisyamo4131/air-firebase-v2";
10
10
  import { defField } from "./parts/fieldDefinitions.js";
11
11
  import { defAccessor } from "./parts/accessorDefinitions.js";
12
- import { VALUES } from "./constants/contract-status.js";
13
12
  import CutoffDate from "./utils/CutoffDate.js";
13
+ import {
14
+ CONTRACT_STATUS_VALUES,
15
+ PAYMENT_MONTH_OPTIONS,
16
+ } from "./constants/index.js";
14
17
 
15
18
  const classProps = {
16
19
  code: defField("code", { label: "取引先コード" }),
@@ -25,21 +28,14 @@ const classProps = {
25
28
  tel: defField("tel", { colsDefinition: { cols: 12, sm: 6 } }),
26
29
  fax: defField("fax", { colsDefinition: { cols: 12, sm: 6 } }),
27
30
  contractStatus: defField("contractStatus", { required: true }),
31
+ cutoffDate: defField("cutoffDate", { required: true }),
28
32
  paymentMonth: defField("select", {
29
33
  default: 1,
30
34
  label: "入金サイト(月数)",
31
35
  required: true,
32
36
  component: {
33
37
  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
- ],
38
+ items: PAYMENT_MONTH_OPTIONS,
43
39
  },
44
40
  },
45
41
  }),
@@ -78,6 +74,7 @@ const classProps = {
78
74
  * @prop {string} prefecture - prefecture name derived from `prefCode` (read-only)
79
75
  *
80
76
  * @static
77
+ * @prop {object} STATUS - constant mapping for contract statuses
81
78
  * @prop {string} STATUS_ACTIVE - constant for active contract status
82
79
  * @prop {string} STATUS_TERMINATED - constant for terminated contract status
83
80
  *
@@ -107,8 +104,9 @@ export default class Customer extends FireModel {
107
104
  { key: "fullAddress", title: "所在地" },
108
105
  ];
109
106
 
110
- static STATUS_ACTIVE = VALUES.ACTIVE.value;
111
- static STATUS_TERMINATED = VALUES.TERMINATED.value;
107
+ static STATUS = CONTRACT_STATUS_VALUES;
108
+ static STATUS_ACTIVE = CONTRACT_STATUS_VALUES.ACTIVE.value;
109
+ static STATUS_TERMINATED = CONTRACT_STATUS_VALUES.TERMINATED.value;
112
110
 
113
111
  afterInitialize(item = {}) {
114
112
  super.afterInitialize(item);
@@ -35,6 +35,10 @@ export {
35
35
  VALUES as GENDER_VALUES,
36
36
  OPTIONS as GENDER_OPTIONS,
37
37
  } from "./gender.js";
38
+ export {
39
+ VALUES as PAYMENT_MONTH_VALUES,
40
+ OPTIONS as PAYMENT_MONTH_OPTIONS,
41
+ } from "./payment-month.js";
38
42
  export {
39
43
  VALUES as PREFECTURES_VALUES,
40
44
  OPTIONS as PREFECTURES_OPTIONS,
@@ -0,0 +1,21 @@
1
+ // prettier-ignore
2
+
3
+ export const VALUES = Object.freeze({
4
+ 0: { value: 0, title: "当月" },
5
+ 1: { value: 1, title: "翌月" },
6
+ 2: { value: 2, title: "翌々月" },
7
+ 3: { value: 3, title: "3ヶ月後" },
8
+ 4: { value: 4, title: "4ヶ月後" },
9
+ 5: { value: 5, title: "5ヶ月後" },
10
+ 6: { value: 6, title: "6ヶ月後" },
11
+ });
12
+
13
+ export const OPTIONS = [
14
+ { title: VALUES[0].title, value: VALUES[0].value },
15
+ { title: VALUES[1].title, value: VALUES[1].value },
16
+ { title: VALUES[2].title, value: VALUES[2].value },
17
+ { title: VALUES[3].title, value: VALUES[3].value },
18
+ { title: VALUES[4].title, value: VALUES[4].value },
19
+ { title: VALUES[5].title, value: VALUES[5].value },
20
+ { title: VALUES[6].title, value: VALUES[6].value },
21
+ ];
@@ -39,6 +39,7 @@ import {
39
39
  VALUES as SITE_STATUS_VALUES,
40
40
  OPTIONS as SITE_STATUS_OPTIONS,
41
41
  } from "../constants/site-status.js";
42
+ import CutoffDate from "../utils/CutoffDate.js";
42
43
 
43
44
  export const DEFAULT_WORKING_MINUTES = 480;
44
45
  export const DEFAULT_BREAK_MINUTES = 60;
@@ -537,6 +538,17 @@ export const fieldDefinitions = {
537
538
  },
538
539
  },
539
540
  },
541
+ cutoffDate: {
542
+ ...generalDefinitions.select,
543
+ default: CutoffDate.VALUES.END_OF_MONTH,
544
+ label: "締日",
545
+ component: {
546
+ name: generalDefinitions.select.component.name,
547
+ attrs: {
548
+ items: CutoffDate.OPTIONS,
549
+ },
550
+ },
551
+ },
540
552
  dayType: {
541
553
  ...generalDefinitions.select,
542
554
  default: DAY_TYPE_VALUES.WEEKDAY.value,