@shisyamo4131/air-guard-v2-schemas 2.3.0 → 2.3.2
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 +1 -1
- package/src/Agreement.js +6 -111
- package/src/ArrangementNotification.js +2 -10
- package/src/Operation.js +2 -7
- package/src/OperationResult.js +4 -2
- package/src/WorkingResult.js +5 -0
- package/src/constants/arrangement-notification-status.js +10 -10
- package/src/constants/billing-unit-type.js +7 -12
- package/src/constants/day-type.js +15 -18
- package/src/constants/gender.js +7 -8
- package/src/constants/index.js +38 -9
- package/src/constants/prefectures.js +50 -50
- package/src/constants/shift-type.js +7 -13
- package/src/parts/accessorDefinitions.js +4 -6
- package/src/parts/fieldDefinitions.js +18 -12
package/package.json
CHANGED
package/src/Agreement.js
CHANGED
|
@@ -75,12 +75,9 @@
|
|
|
75
75
|
* - @param {Date} v - The new `dateAt` value
|
|
76
76
|
*****************************************************************************/
|
|
77
77
|
import WorkingResult from "./WorkingResult.js";
|
|
78
|
-
import { DAY_TYPE } from "./constants/day-type.js";
|
|
79
|
-
import { SHIFT_TYPE } from "./constants/shift-type.js";
|
|
80
78
|
import {
|
|
81
|
-
BILLING_UNIT_TYPE,
|
|
82
|
-
|
|
83
|
-
BILLING_UNIT_TYPE_DEFAULT,
|
|
79
|
+
VALUES as BILLING_UNIT_TYPE,
|
|
80
|
+
OPTIONS as BILLING_UNIT_TYPE_OPTIONS,
|
|
84
81
|
} from "./constants/billing-unit-type.js";
|
|
85
82
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
86
83
|
import CutoffDate from "./utils/CutoffDate.js";
|
|
@@ -101,12 +98,12 @@ const classProps = {
|
|
|
101
98
|
required: true,
|
|
102
99
|
}),
|
|
103
100
|
billingUnitType: defField("select", {
|
|
104
|
-
default:
|
|
101
|
+
default: BILLING_UNIT_TYPE.PER_DAY.value,
|
|
105
102
|
label: "請求単位",
|
|
106
103
|
required: true,
|
|
107
104
|
component: {
|
|
108
105
|
attrs: {
|
|
109
|
-
items:
|
|
106
|
+
items: BILLING_UNIT_TYPE_OPTIONS,
|
|
110
107
|
},
|
|
111
108
|
},
|
|
112
109
|
}),
|
|
@@ -126,113 +123,11 @@ const classProps = {
|
|
|
126
123
|
}),
|
|
127
124
|
};
|
|
128
125
|
|
|
129
|
-
/**
|
|
130
|
-
* Table headers for displaying agreement details
|
|
131
|
-
*/
|
|
132
|
-
const headers = [
|
|
133
|
-
{
|
|
134
|
-
title: "適用開始日",
|
|
135
|
-
key: "dateAt",
|
|
136
|
-
value: (item) => item.dateAt.toLocaleDateString(),
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
title: "締日",
|
|
140
|
-
key: "cutoffDate",
|
|
141
|
-
value: (item) => {
|
|
142
|
-
return CutoffDate.getDisplayText(item.cutoffDate);
|
|
143
|
-
},
|
|
144
|
-
align: "center",
|
|
145
|
-
sortable: false,
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
title: "区分",
|
|
149
|
-
key: "type",
|
|
150
|
-
value: (item) =>
|
|
151
|
-
`${DAY_TYPE[item.dayType]}${SHIFT_TYPE[item.shiftType].title}`,
|
|
152
|
-
align: "center",
|
|
153
|
-
sortable: false,
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
title: "勤務時間",
|
|
157
|
-
key: "time",
|
|
158
|
-
value: (item) => `${item.startTime} ~ ${item.endTime}`,
|
|
159
|
-
align: "center",
|
|
160
|
-
sortable: false,
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
title: "規定実働時間",
|
|
164
|
-
key: "regulationWorkMinutes",
|
|
165
|
-
value: (item) => `${item.regulationWorkMinutes}分`,
|
|
166
|
-
align: "center",
|
|
167
|
-
sortable: false,
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
title: "休憩時間",
|
|
171
|
-
key: "breakMinutes",
|
|
172
|
-
value: (item) => `${item.breakMinutes}分`,
|
|
173
|
-
align: "center",
|
|
174
|
-
sortable: false,
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
title: "残業時間",
|
|
178
|
-
key: "overtimeWorkMinutes",
|
|
179
|
-
value: (item) => `${item.overtimeWorkMinutes}分`,
|
|
180
|
-
align: "center",
|
|
181
|
-
sortable: false,
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
title: "通常",
|
|
185
|
-
align: "center",
|
|
186
|
-
children: [
|
|
187
|
-
{
|
|
188
|
-
title: "単価",
|
|
189
|
-
key: "unitPriceBase",
|
|
190
|
-
value: (item) => item.unitPriceBase.toLocaleString(),
|
|
191
|
-
align: "center",
|
|
192
|
-
sortable: false,
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
title: "時間外",
|
|
196
|
-
key: "overtimeUnitPriceBase",
|
|
197
|
-
value: (item) => item.overtimeUnitPriceBase.toLocaleString(),
|
|
198
|
-
align: "center",
|
|
199
|
-
sortable: false,
|
|
200
|
-
},
|
|
201
|
-
],
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
title: "資格者",
|
|
205
|
-
align: "center",
|
|
206
|
-
children: [
|
|
207
|
-
{
|
|
208
|
-
title: "単価",
|
|
209
|
-
key: "unitPriceQualified",
|
|
210
|
-
value: (item) => item.unitPriceQualified.toLocaleString(),
|
|
211
|
-
align: "center",
|
|
212
|
-
sortable: false,
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
title: "時間外",
|
|
216
|
-
key: "overtimeUnitPriceQualified",
|
|
217
|
-
value: (item) => item.overtimeUnitPriceQualified.toLocaleString(),
|
|
218
|
-
align: "center",
|
|
219
|
-
sortable: false,
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
title: "請求単位",
|
|
225
|
-
key: "billingUnitType",
|
|
226
|
-
value: (item) => BILLING_UNIT_TYPE[item.billingUnitType],
|
|
227
|
-
align: "center",
|
|
228
|
-
sortable: false,
|
|
229
|
-
},
|
|
230
|
-
];
|
|
231
|
-
|
|
232
126
|
export default class Agreement extends WorkingResult {
|
|
233
127
|
static className = "取極め";
|
|
234
128
|
static classProps = classProps;
|
|
235
|
-
|
|
129
|
+
|
|
130
|
+
static BILLING_UNIT_TYPE = BILLING_UNIT_TYPE;
|
|
236
131
|
|
|
237
132
|
/**
|
|
238
133
|
* Returns an object containing price-related properties.
|
|
@@ -135,10 +135,7 @@
|
|
|
135
135
|
import SiteOperationScheduleDetail from "./SiteOperationScheduleDetail.js";
|
|
136
136
|
import { getDateAt, ContextualError } from "./utils/index.js";
|
|
137
137
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
138
|
-
import {
|
|
139
|
-
VALUES,
|
|
140
|
-
OPTIONS,
|
|
141
|
-
} from "./constants/arrangement-notification-status.js";
|
|
138
|
+
import { VALUES } from "./constants/arrangement-notification-status.js";
|
|
142
139
|
|
|
143
140
|
const classProps = {
|
|
144
141
|
status: defField("arrangementNotificationStatus", { required: true }),
|
|
@@ -168,12 +165,7 @@ export default class ArrangementNotification extends SiteOperationScheduleDetail
|
|
|
168
165
|
static logicalDelete = false;
|
|
169
166
|
static classProps = classProps;
|
|
170
167
|
|
|
171
|
-
static
|
|
172
|
-
static STATUS_ARRANGED = VALUES.ARRANGED.value;
|
|
173
|
-
static STATUS_CONFIRMED = VALUES.CONFIRMED.value;
|
|
174
|
-
static STATUS_ARRIVED = VALUES.ARRIVED.value;
|
|
175
|
-
static STATUS_LEAVED = VALUES.LEAVED.value;
|
|
176
|
-
static STATUS_OPTIONS = OPTIONS;
|
|
168
|
+
static STATUS = VALUES;
|
|
177
169
|
|
|
178
170
|
afterInitialize(item = {}) {
|
|
179
171
|
// Define computed properties that are defined on SiteOperationScheduleDetail
|
package/src/Operation.js
CHANGED
|
@@ -133,8 +133,8 @@
|
|
|
133
133
|
import WorkingResult from "./WorkingResult.js";
|
|
134
134
|
import OperationDetail from "./OperationDetail.js";
|
|
135
135
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
136
|
-
import { DAY_TYPE } from "./constants/day-type.js";
|
|
137
|
-
import { SHIFT_TYPE } from "./constants/shift-type.js";
|
|
136
|
+
import { VALUES as DAY_TYPE } from "./constants/day-type.js";
|
|
137
|
+
import { VALUES as SHIFT_TYPE } from "./constants/shift-type.js";
|
|
138
138
|
|
|
139
139
|
const classProps = {
|
|
140
140
|
siteId: defField("siteId", { required: true }),
|
|
@@ -177,12 +177,7 @@ export default class Operation extends WorkingResult {
|
|
|
177
177
|
static classProps = classProps;
|
|
178
178
|
|
|
179
179
|
static DAY_TYPE = DAY_TYPE;
|
|
180
|
-
static DAY_TYPE_DAY = DAY_TYPE.DAY;
|
|
181
|
-
static DAY_TYPE_NIGHT = DAY_TYPE.NIGHT;
|
|
182
|
-
|
|
183
180
|
static SHIFT_TYPE = SHIFT_TYPE;
|
|
184
|
-
static SHIFT_TYPE_DAY = SHIFT_TYPE.DAY.value;
|
|
185
|
-
static SHIFT_TYPE_NIGHT = SHIFT_TYPE.NIGHT.value;
|
|
186
181
|
|
|
187
182
|
/**
|
|
188
183
|
* Constructor
|
package/src/OperationResult.js
CHANGED
|
@@ -179,7 +179,7 @@ import { ContextualError } from "./utils/ContextualError.js";
|
|
|
179
179
|
import OperationResultDetail from "./OperationResultDetail.js";
|
|
180
180
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
181
181
|
import Tax from "./Tax.js";
|
|
182
|
-
import {
|
|
182
|
+
import { VALUES as BILLING_UNIT_TYPE } from "./constants/billing-unit-type.js";
|
|
183
183
|
import RoundSetting from "./RoundSetting.js";
|
|
184
184
|
import CutoffDate from "./utils/CutoffDate.js";
|
|
185
185
|
import Site from "./Site.js";
|
|
@@ -247,6 +247,7 @@ export default class OperationResult extends Operation {
|
|
|
247
247
|
{ title: "現場", key: "siteId", value: "siteId" },
|
|
248
248
|
];
|
|
249
249
|
|
|
250
|
+
static BILLING_UNIT_TYPE = BILLING_UNIT_TYPE;
|
|
250
251
|
/**
|
|
251
252
|
* afterInitialize
|
|
252
253
|
*/
|
|
@@ -343,7 +344,8 @@ export default class OperationResult extends Operation {
|
|
|
343
344
|
} else {
|
|
344
345
|
// agreementがある場合のみbillingUnitTypeとincludeBreakInBillingを使用
|
|
345
346
|
const isPerHour =
|
|
346
|
-
this.agreement?.billingUnitType ===
|
|
347
|
+
this.agreement?.billingUnitType ===
|
|
348
|
+
BILLING_UNIT_TYPE.PER_HOUR.value;
|
|
347
349
|
|
|
348
350
|
if (isPerHour) {
|
|
349
351
|
// 時間単位請求の場合
|
package/src/WorkingResult.js
CHANGED
|
@@ -62,6 +62,8 @@ import FireModel from "@shisyamo4131/air-firebase-v2";
|
|
|
62
62
|
import { defField } from "./parts/fieldDefinitions.js";
|
|
63
63
|
import { getDateAt } from "./utils/index.js";
|
|
64
64
|
import { getDayType } from "./constants/day-type.js";
|
|
65
|
+
import { VALUES as DAY_TYPE } from "./constants/day-type.js";
|
|
66
|
+
import { VALUES as SHIFT_TYPE } from "./constants/shift-type.js";
|
|
65
67
|
|
|
66
68
|
const classProps = {
|
|
67
69
|
dateAt: defField("dateAt", { required: true }),
|
|
@@ -106,6 +108,9 @@ export default class WorkingResult extends FireModel {
|
|
|
106
108
|
static logicalDelete = false;
|
|
107
109
|
static classProps = classProps;
|
|
108
110
|
|
|
111
|
+
static DAY_TYPE = DAY_TYPE;
|
|
112
|
+
static SHIFT_TYPE = SHIFT_TYPE;
|
|
113
|
+
|
|
109
114
|
/**
|
|
110
115
|
* Constructor
|
|
111
116
|
* - Prevent direct instantiation of WorkingResult class.
|
|
@@ -5,28 +5,28 @@
|
|
|
5
5
|
export const VALUES = Object.freeze({
|
|
6
6
|
ARRANGED: {
|
|
7
7
|
value: "ARRANGED",
|
|
8
|
-
|
|
8
|
+
title: "配置済",
|
|
9
9
|
order: 1,
|
|
10
10
|
color: "#F57C00", // 🟠 配置通知済み(待機中)
|
|
11
11
|
},
|
|
12
12
|
|
|
13
13
|
CONFIRMED: {
|
|
14
14
|
value: "CONFIRMED",
|
|
15
|
-
|
|
15
|
+
title: "確認済",
|
|
16
16
|
order: 2,
|
|
17
17
|
color: "#2196F3", // 🔵 作業員が了承済み(準備中)
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
ARRIVED: {
|
|
21
21
|
value: "ARRIVED",
|
|
22
|
-
|
|
22
|
+
title: "上番済",
|
|
23
23
|
order: 3,
|
|
24
24
|
color: "#4CAF50", // 🟢 現場到着、作業開始可能
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
LEAVED: {
|
|
28
28
|
value: "LEAVED",
|
|
29
|
-
|
|
29
|
+
title: "下番済",
|
|
30
30
|
order: 4,
|
|
31
31
|
color: "#607D8B", // ⚫ 作業完了、離脱済み
|
|
32
32
|
},
|
|
@@ -37,7 +37,7 @@ export const VALUES = Object.freeze({
|
|
|
37
37
|
*/
|
|
38
38
|
// CANCELED: {
|
|
39
39
|
// value: "CANCELED",
|
|
40
|
-
//
|
|
40
|
+
// title: "現着中止",
|
|
41
41
|
// order: 5,
|
|
42
42
|
// color: "#F44336", // 🔴 異常状態、作業中止
|
|
43
43
|
// },
|
|
@@ -45,24 +45,24 @@ export const VALUES = Object.freeze({
|
|
|
45
45
|
|
|
46
46
|
export const OPTIONS = [
|
|
47
47
|
{
|
|
48
|
-
title: VALUES.ARRANGED.
|
|
48
|
+
title: VALUES.ARRANGED.title,
|
|
49
49
|
value: VALUES.ARRANGED.value,
|
|
50
50
|
color: VALUES.ARRANGED.color,
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
title: VALUES.CONFIRMED.
|
|
53
|
+
title: VALUES.CONFIRMED.title,
|
|
54
54
|
value: VALUES.CONFIRMED.value,
|
|
55
55
|
color: VALUES.CONFIRMED.color,
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
title: VALUES.ARRIVED.
|
|
58
|
+
title: VALUES.ARRIVED.title,
|
|
59
59
|
value: VALUES.ARRIVED.value,
|
|
60
60
|
color: VALUES.ARRIVED.color,
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
|
-
title: VALUES.LEAVED.
|
|
63
|
+
title: VALUES.LEAVED.title,
|
|
64
64
|
value: VALUES.LEAVED.value,
|
|
65
65
|
color: VALUES.LEAVED.color,
|
|
66
66
|
},
|
|
67
|
-
// { title: VALUES.CANCELED.
|
|
67
|
+
// { title: VALUES.CANCELED.title, value: VALUES.CANCELED.value },
|
|
68
68
|
];
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
// prettier-ignore
|
|
2
|
-
export const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const BILLING_UNIT_TYPE = Object.freeze({
|
|
7
|
-
PER_DAY: "日",
|
|
8
|
-
PER_HOUR: "時間",
|
|
2
|
+
export const VALUES = Object.freeze({
|
|
3
|
+
PER_DAY: { value: "PER_DAY", title: "日" },
|
|
4
|
+
PER_HOUR: { value: "PER_HOUR", title: "時間" },
|
|
9
5
|
});
|
|
10
6
|
|
|
11
|
-
export const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
);
|
|
7
|
+
export const OPTIONS = [
|
|
8
|
+
{ title: VALUES.PER_DAY.title, value: VALUES.PER_DAY.value },
|
|
9
|
+
{ title: VALUES.PER_HOUR.title, value: VALUES.PER_HOUR.value },
|
|
10
|
+
];
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
// prettier-ignore
|
|
2
2
|
import holiday_jp from "@holiday-jp/holiday_jp";
|
|
3
3
|
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export const DAY_TYPE = Object.freeze({
|
|
11
|
-
WEEKDAY: "平日",
|
|
12
|
-
SATURDAY: "土曜",
|
|
13
|
-
SUNDAY: "日曜",
|
|
14
|
-
HOLIDAY: "祝日",
|
|
4
|
+
export const VALUES = Object.freeze({
|
|
5
|
+
WEEKDAY: { value: "WEEKDAY", title: "平日" },
|
|
6
|
+
SATURDAY: { value: "SATURDAY", title: "土曜" },
|
|
7
|
+
SUNDAY: { value: "SUNDAY", title: "日曜" },
|
|
8
|
+
HOLIDAY: { value: "HOLIDAY", title: "祝日" },
|
|
15
9
|
});
|
|
16
10
|
|
|
17
|
-
export const
|
|
18
|
-
|
|
19
|
-
}
|
|
11
|
+
export const OPTIONS = [
|
|
12
|
+
{ title: VALUES.WEEKDAY.title, value: VALUES.WEEKDAY.value },
|
|
13
|
+
{ title: VALUES.SATURDAY.title, value: VALUES.SATURDAY.value },
|
|
14
|
+
{ title: VALUES.SUNDAY.title, value: VALUES.SUNDAY.value },
|
|
15
|
+
{ title: VALUES.HOLIDAY.title, value: VALUES.HOLIDAY.value },
|
|
16
|
+
];
|
|
20
17
|
|
|
21
18
|
/**
|
|
22
19
|
* Returns the corresponding day type based on the given date's day of the week.
|
|
@@ -33,12 +30,12 @@ export const getDayType = (date) => {
|
|
|
33
30
|
throw new TypeError("Input must be a Date object");
|
|
34
31
|
}
|
|
35
32
|
if (holiday_jp.isHoliday(date)) {
|
|
36
|
-
return
|
|
33
|
+
return VALUES.HOLIDAY.value;
|
|
37
34
|
} else if (date.getDay() === 0) {
|
|
38
|
-
return
|
|
35
|
+
return VALUES.SUNDAY.value;
|
|
39
36
|
} else if (date.getDay() === 6) {
|
|
40
|
-
return
|
|
37
|
+
return VALUES.SATURDAY.value;
|
|
41
38
|
} else {
|
|
42
|
-
return
|
|
39
|
+
return VALUES.WEEKDAY.value;
|
|
43
40
|
}
|
|
44
41
|
};
|
package/src/constants/gender.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// prettier-ignore
|
|
2
|
-
export const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
MALE: "男性",
|
|
6
|
-
FEMALE: "女性",
|
|
2
|
+
export const VALUES = Object.freeze({
|
|
3
|
+
MALE: { value: "MALE", title: "男性" },
|
|
4
|
+
FEMALE: { value: "FEMALE", title: "女性" },
|
|
7
5
|
});
|
|
8
6
|
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
}
|
|
7
|
+
export const OPTIONS = [
|
|
8
|
+
{ title: VALUES.MALE.title, value: VALUES.MALE.value },
|
|
9
|
+
{ title: VALUES.FEMALE.title, value: VALUES.FEMALE.value },
|
|
10
|
+
];
|
package/src/constants/index.js
CHANGED
|
@@ -1,9 +1,38 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
1
|
+
export {
|
|
2
|
+
VALUES as ARRANGEMENT_NOTIFICATION_STATUS_VALUES,
|
|
3
|
+
OPTIONS as ARRANGEMENT_NOTIFICATION_STATUS_OPTIONS,
|
|
4
|
+
} from "./arrangement-notification-status.js";
|
|
5
|
+
export {
|
|
6
|
+
VALUES as BILLING_UNIT_TYPE_VALUES,
|
|
7
|
+
OPTIONS as BILLING_UNIT_TYPE_OPTIONS,
|
|
8
|
+
} from "./billing-unit-type.js";
|
|
9
|
+
export {
|
|
10
|
+
VALUES as CONTRACT_STATUS_VALUES,
|
|
11
|
+
OPTIONS as CONTRACT_STATUS_OPTIONS,
|
|
12
|
+
} from "./contract-status.js";
|
|
13
|
+
export {
|
|
14
|
+
VALUES as DAY_TYPE_VALUES,
|
|
15
|
+
OPTIONS as DAY_TYPE_OPTIONS,
|
|
16
|
+
getDayType,
|
|
17
|
+
} from "./day-type.js";
|
|
18
|
+
export {
|
|
19
|
+
VALUES as EMPLOYMENT_STATUS_VALUES,
|
|
20
|
+
OPTIONS as EMPLOYMENT_STATUS_OPTIONS,
|
|
21
|
+
} from "./employment-status.js";
|
|
22
|
+
export {
|
|
23
|
+
VALUES as GENDER_VALUES,
|
|
24
|
+
OPTIONS as GENDER_OPTIONS,
|
|
25
|
+
} from "./gender.js";
|
|
26
|
+
export {
|
|
27
|
+
VALUES as PREFECTURES_VALUES,
|
|
28
|
+
OPTIONS as PREFECTURES_OPTIONS,
|
|
29
|
+
} from "./prefectures.js";
|
|
30
|
+
export {
|
|
31
|
+
VALUES as SHIFT_TYPE_VALUES,
|
|
32
|
+
OPTIONS as SHIFT_TYPE_OPTIONS,
|
|
33
|
+
VALIDATOR as SHIFT_TYPE_VALIDATOR,
|
|
34
|
+
} from "./shift-type.js";
|
|
35
|
+
export {
|
|
36
|
+
VALUES as SITE_STATUS_VALUES,
|
|
37
|
+
OPTIONS as SITE_STATUS_OPTIONS,
|
|
38
|
+
} from "./site-status.js";
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
// prettier-ignore
|
|
2
|
-
export const
|
|
3
|
-
"01": {
|
|
4
|
-
"02": {
|
|
5
|
-
"03": {
|
|
6
|
-
"04": {
|
|
7
|
-
"05": {
|
|
8
|
-
"06": {
|
|
9
|
-
"07": {
|
|
10
|
-
"08": {
|
|
11
|
-
"09": {
|
|
12
|
-
"10": {
|
|
13
|
-
"11": {
|
|
14
|
-
"12": {
|
|
15
|
-
"13": {
|
|
16
|
-
"14": {
|
|
17
|
-
"15": {
|
|
18
|
-
"16": {
|
|
19
|
-
"17": {
|
|
20
|
-
"18": {
|
|
21
|
-
"19": {
|
|
22
|
-
"20": {
|
|
23
|
-
"21": {
|
|
24
|
-
"22": {
|
|
25
|
-
"23": {
|
|
26
|
-
"24": {
|
|
27
|
-
"25": {
|
|
28
|
-
"26": {
|
|
29
|
-
"27": {
|
|
30
|
-
"28": {
|
|
31
|
-
"29": {
|
|
32
|
-
"30": {
|
|
33
|
-
"31": {
|
|
34
|
-
"32": {
|
|
35
|
-
"33": {
|
|
36
|
-
"34": {
|
|
37
|
-
"35": {
|
|
38
|
-
"36": {
|
|
39
|
-
"37": {
|
|
40
|
-
"38": {
|
|
41
|
-
"39": {
|
|
42
|
-
"40": {
|
|
43
|
-
"41": {
|
|
44
|
-
"42": {
|
|
45
|
-
"43": {
|
|
46
|
-
"44": {
|
|
47
|
-
"45": {
|
|
48
|
-
"46": {
|
|
49
|
-
"47": {
|
|
2
|
+
export const VALUES = Object.freeze({
|
|
3
|
+
"01": { value: "01", title: "北海道" },
|
|
4
|
+
"02": { value: "02", title: "青森県" },
|
|
5
|
+
"03": { value: "03", title: "岩手県" },
|
|
6
|
+
"04": { value: "04", title: "宮城県" },
|
|
7
|
+
"05": { value: "05", title: "秋田県" },
|
|
8
|
+
"06": { value: "06", title: "山形県" },
|
|
9
|
+
"07": { value: "07", title: "福島県" },
|
|
10
|
+
"08": { value: "08", title: "茨城県" },
|
|
11
|
+
"09": { value: "09", title: "栃木県" },
|
|
12
|
+
"10": { value: "10", title: "群馬県" },
|
|
13
|
+
"11": { value: "11", title: "埼玉県" },
|
|
14
|
+
"12": { value: "12", title: "千葉県" },
|
|
15
|
+
"13": { value: "13", title: "東京都" },
|
|
16
|
+
"14": { value: "14", title: "神奈川県" },
|
|
17
|
+
"15": { value: "15", title: "新潟県" },
|
|
18
|
+
"16": { value: "16", title: "富山県" },
|
|
19
|
+
"17": { value: "17", title: "石川県" },
|
|
20
|
+
"18": { value: "18", title: "福井県" },
|
|
21
|
+
"19": { value: "19", title: "山梨県" },
|
|
22
|
+
"20": { value: "20", title: "長野県" },
|
|
23
|
+
"21": { value: "21", title: "岐阜県" },
|
|
24
|
+
"22": { value: "22", title: "静岡県" },
|
|
25
|
+
"23": { value: "23", title: "愛知県" },
|
|
26
|
+
"24": { value: "24", title: "三重県" },
|
|
27
|
+
"25": { value: "25", title: "滋賀県" },
|
|
28
|
+
"26": { value: "26", title: "京都府" },
|
|
29
|
+
"27": { value: "27", title: "大阪府" },
|
|
30
|
+
"28": { value: "28", title: "兵庫県" },
|
|
31
|
+
"29": { value: "29", title: "奈良県" },
|
|
32
|
+
"30": { value: "30", title: "和歌山県" },
|
|
33
|
+
"31": { value: "31", title: "鳥取県" },
|
|
34
|
+
"32": { value: "32", title: "島根県" },
|
|
35
|
+
"33": { value: "33", title: "岡山県" },
|
|
36
|
+
"34": { value: "34", title: "広島県" },
|
|
37
|
+
"35": { value: "35", title: "山口県" },
|
|
38
|
+
"36": { value: "36", title: "徳島県" },
|
|
39
|
+
"37": { value: "37", title: "香川県" },
|
|
40
|
+
"38": { value: "38", title: "愛媛県" },
|
|
41
|
+
"39": { value: "39", title: "高知県" },
|
|
42
|
+
"40": { value: "40", title: "福岡県" },
|
|
43
|
+
"41": { value: "41", title: "佐賀県" },
|
|
44
|
+
"42": { value: "42", title: "長崎県" },
|
|
45
|
+
"43": { value: "43", title: "熊本県" },
|
|
46
|
+
"44": { value: "44", title: "大分県" },
|
|
47
|
+
"45": { value: "45", title: "宮崎県" },
|
|
48
|
+
"46": { value: "46", title: "鹿児島県" },
|
|
49
|
+
"47": { value: "47", title: "沖縄県" },
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
export const
|
|
52
|
+
export const OPTIONS = Object.entries(VALUES)
|
|
53
53
|
.sort((a, b) => a[0].localeCompare(b[0])) // キー(都道府県コード)でソート
|
|
54
54
|
.map(([key, value]) => {
|
|
55
|
-
return { value: key, title: value.
|
|
55
|
+
return { value: key, title: value.title };
|
|
56
56
|
});
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
// prettier-ignore
|
|
2
|
-
export const
|
|
3
|
-
export const SHIFT_TYPE_DAY = "DAY";
|
|
4
|
-
export const SHIFT_TYPE_NIGHT = "NIGHT";
|
|
5
|
-
|
|
6
|
-
export const SHIFT_TYPE = Object.freeze({
|
|
2
|
+
export const VALUES = Object.freeze({
|
|
7
3
|
DAY: { value: "DAY", title: "日勤", color: "deep-orange" },
|
|
8
4
|
NIGHT: { value: "NIGHT", title: "夜勤", color: "indigo" },
|
|
9
5
|
});
|
|
10
6
|
|
|
11
|
-
export const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
);
|
|
7
|
+
export const OPTIONS = [
|
|
8
|
+
{ title: VALUES.DAY.title, value: VALUES.DAY.value },
|
|
9
|
+
{ title: VALUES.NIGHT.title, value: VALUES.NIGHT.value },
|
|
10
|
+
];
|
|
16
11
|
|
|
17
|
-
export const
|
|
18
|
-
|
|
19
|
-
return arr.includes(value);
|
|
12
|
+
export const VALIDATOR = (value) => {
|
|
13
|
+
return Object.keys(VALUES).includes(value);
|
|
20
14
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OPTIONS } from "../constants/prefectures.js";
|
|
2
2
|
/**
|
|
3
3
|
* @typedef {object} AccessorImplementation - アクセサの実装を定義するオブジェクト。
|
|
4
4
|
* @property {function} get - getter関数。
|
|
@@ -54,20 +54,18 @@ const accessorImplementations = {
|
|
|
54
54
|
|
|
55
55
|
if (!this.prefCode) return ""; // No warning if prefCode is falsy but present
|
|
56
56
|
|
|
57
|
-
const result =
|
|
58
|
-
({ value }) => value === this.prefCode
|
|
59
|
-
);
|
|
57
|
+
const result = OPTIONS.find(({ value }) => value === this.prefCode);
|
|
60
58
|
|
|
61
59
|
if (!result) {
|
|
62
60
|
console.warn(
|
|
63
|
-
`[アクセサ: prefecture] prefCode '${this.prefCode}' は
|
|
61
|
+
`[アクセサ: prefecture] prefCode '${this.prefCode}' は OPTIONS に見つかりません。`
|
|
64
62
|
);
|
|
65
63
|
return "";
|
|
66
64
|
}
|
|
67
65
|
|
|
68
66
|
if (!result.hasOwnProperty("title")) {
|
|
69
67
|
console.warn(
|
|
70
|
-
`[アクセサ: prefecture]
|
|
68
|
+
`[アクセサ: prefecture] OPTIONS の prefCode '${this.prefCode}' に title が定義されていません。`
|
|
71
69
|
);
|
|
72
70
|
return "";
|
|
73
71
|
}
|
|
@@ -6,16 +6,22 @@ import {
|
|
|
6
6
|
VALUES as CONTRACT_STATUS_VALUES,
|
|
7
7
|
OPTIONS as CONTRACT_STATUS_OPTIONS,
|
|
8
8
|
} from "../constants/contract-status.js";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
OPTIONS as DAY_TYPE_OPTIONS,
|
|
11
|
+
VALUES as DAY_TYPE_VALUES,
|
|
12
|
+
} from "../constants/day-type.js";
|
|
10
13
|
import {
|
|
11
14
|
VALUES as EMPLOYMENT_STATUS_VALUES,
|
|
12
15
|
OPTIONS as EMPLOYMENT_STATUS_OPTIONS,
|
|
13
16
|
} from "../constants/employment-status.js";
|
|
14
|
-
import { GENDER_ARRAY, GENDER_DEFAULT } from "../constants/gender.js";
|
|
15
|
-
import { PREFECTURES_ARRAY } from "../constants/prefectures.js";
|
|
16
17
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
VALUES as GENDER_VALUES,
|
|
19
|
+
OPTIONS as GENDER_OPTIONS,
|
|
20
|
+
} from "../constants/gender.js";
|
|
21
|
+
import { OPTIONS as PREFECTURES_OPTIONS } from "../constants/prefectures.js";
|
|
22
|
+
import {
|
|
23
|
+
VALUES as SHIFT_TYPE_VALUES,
|
|
24
|
+
OPTIONS as SHIFT_TYPE_OPTIONS,
|
|
19
25
|
} from "../constants/shift-type.js";
|
|
20
26
|
import {
|
|
21
27
|
VALUES as SITE_STATUS_VALUES,
|
|
@@ -412,12 +418,12 @@ export const fieldDefinitions = {
|
|
|
412
418
|
},
|
|
413
419
|
dayType: {
|
|
414
420
|
...generalDefinitions.select,
|
|
415
|
-
default:
|
|
421
|
+
default: DAY_TYPE_VALUES.WEEKDAY.value,
|
|
416
422
|
label: "曜日区分",
|
|
417
423
|
component: {
|
|
418
424
|
name: generalDefinitions.select.component.name,
|
|
419
425
|
attrs: {
|
|
420
|
-
items:
|
|
426
|
+
items: DAY_TYPE_OPTIONS,
|
|
421
427
|
},
|
|
422
428
|
},
|
|
423
429
|
},
|
|
@@ -434,12 +440,12 @@ export const fieldDefinitions = {
|
|
|
434
440
|
},
|
|
435
441
|
gender: {
|
|
436
442
|
...generalDefinitions.select,
|
|
437
|
-
default:
|
|
443
|
+
default: GENDER_VALUES.MALE.value,
|
|
438
444
|
label: "性別",
|
|
439
445
|
component: {
|
|
440
446
|
name: generalDefinitions.select.component.name,
|
|
441
447
|
attrs: {
|
|
442
|
-
items:
|
|
448
|
+
items: GENDER_OPTIONS,
|
|
443
449
|
},
|
|
444
450
|
},
|
|
445
451
|
},
|
|
@@ -450,18 +456,18 @@ export const fieldDefinitions = {
|
|
|
450
456
|
component: {
|
|
451
457
|
name: generalDefinitions.select.component.name,
|
|
452
458
|
attrs: {
|
|
453
|
-
items:
|
|
459
|
+
items: PREFECTURES_OPTIONS,
|
|
454
460
|
},
|
|
455
461
|
},
|
|
456
462
|
},
|
|
457
463
|
shiftType: {
|
|
458
464
|
...generalDefinitions.select,
|
|
459
|
-
default:
|
|
465
|
+
default: SHIFT_TYPE_VALUES.DAY.value,
|
|
460
466
|
label: "勤務区分",
|
|
461
467
|
component: {
|
|
462
468
|
name: generalDefinitions.select.component.name,
|
|
463
469
|
attrs: {
|
|
464
|
-
items:
|
|
470
|
+
items: SHIFT_TYPE_OPTIONS,
|
|
465
471
|
},
|
|
466
472
|
},
|
|
467
473
|
},
|