@shisyamo4131/air-guard-v2-schemas 1.0.0

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.
Files changed (38) hide show
  1. package/index.js +15 -0
  2. package/package.json +44 -0
  3. package/src/Agreement.js +262 -0
  4. package/src/ArrangementNotification.js +505 -0
  5. package/src/Billing.js +159 -0
  6. package/src/Company.js +176 -0
  7. package/src/Customer.js +98 -0
  8. package/src/Employee.js +201 -0
  9. package/src/Operation.js +779 -0
  10. package/src/OperationBilling.js +193 -0
  11. package/src/OperationDetail.js +147 -0
  12. package/src/OperationResult.js +437 -0
  13. package/src/OperationResultDetail.js +72 -0
  14. package/src/Outsourcer.js +46 -0
  15. package/src/RoundSetting.js +123 -0
  16. package/src/Site.js +192 -0
  17. package/src/SiteOperationSchedule.js +503 -0
  18. package/src/SiteOperationScheduleDetail.js +99 -0
  19. package/src/SiteOrder.js +62 -0
  20. package/src/Tax.js +39 -0
  21. package/src/User.js +41 -0
  22. package/src/WorkingResult.js +297 -0
  23. package/src/apis/index.js +9 -0
  24. package/src/constants/arrangement-notification-status.js +68 -0
  25. package/src/constants/billing-unit-type.js +15 -0
  26. package/src/constants/contract-status.js +15 -0
  27. package/src/constants/day-type.js +44 -0
  28. package/src/constants/employment-status.js +15 -0
  29. package/src/constants/gender.js +11 -0
  30. package/src/constants/index.js +9 -0
  31. package/src/constants/prefectures.js +56 -0
  32. package/src/constants/shift-type.js +20 -0
  33. package/src/constants/site-status.js +15 -0
  34. package/src/parts/accessorDefinitions.js +109 -0
  35. package/src/parts/fieldDefinitions.js +642 -0
  36. package/src/utils/ContextualError.js +49 -0
  37. package/src/utils/CutoffDate.js +223 -0
  38. package/src/utils/index.js +48 -0
package/src/Tax.js ADDED
@@ -0,0 +1,39 @@
1
+ /*****************************************************************************
2
+ * Tax Model ver 1.0.0
3
+ * @author shisyamo4131
4
+ * ---------------------------------------------------------------------------
5
+ * - A class for calculating consumption tax based on historical rates.
6
+ * - Uses RoundSetting for rounding tax amounts.
7
+ * ---------------------------------------------------------------------------
8
+ * @static getRate(date) - Gets the applicable tax rate for a given date
9
+ * @static calc(amount, date) - Calculates the tax for a given amount and date
10
+ *****************************************************************************/
11
+ import RoundSetting from "./RoundSetting.js";
12
+
13
+ const _RATES = Object.freeze({
14
+ "1989-04-01": { date: "1989-04-01", rate: 0.03 },
15
+ "1997-04-01": { date: "1997-04-01", rate: 0.05 },
16
+ "2014-04-01": { date: "2014-04-01", rate: 0.08 },
17
+ "2019-10-01": { date: "2019-10-01", rate: 0.1 },
18
+ });
19
+
20
+ export default class Tax {
21
+ static getRate(date) {
22
+ const applicableDates = Object.keys(_RATES).filter((d) => d <= date);
23
+ if (applicableDates.length === 0) {
24
+ throw new Error(`No tax rate found for date: ${date}`);
25
+ }
26
+ const latestDate = applicableDates[applicableDates.length - 1];
27
+ return _RATES[latestDate].rate;
28
+ }
29
+
30
+ static calc(amount, date) {
31
+ if (typeof amount !== "number" || isNaN(amount)) {
32
+ throw new Error("Amount must be a valid number");
33
+ }
34
+ const rate = this.getRate(date);
35
+ let tax = amount * rate;
36
+ tax = RoundSetting.apply(tax);
37
+ return tax;
38
+ }
39
+ }
package/src/User.js ADDED
@@ -0,0 +1,41 @@
1
+ /*****************************************************************************
2
+ * User Model ver 1.0.0
3
+ * @author shisyamo4131
4
+ *****************************************************************************/
5
+ import FireModel from "@shisyamo4131/air-firebase-v2";
6
+ import { defField } from "./parts/fieldDefinitions.js";
7
+
8
+ const classProps = {
9
+ email: defField("email", { required: true }),
10
+ displayName: defField("displayName", { required: true }),
11
+ /**
12
+ * employee-id
13
+ * - 従業員には該当しないユーザーが存在する可能性もあるため、必須にはしない。
14
+ */
15
+ employeeId: defField("oneLine", { label: "従業員ID", hidden: true }),
16
+ roles: {
17
+ type: Array,
18
+ default: () => [],
19
+ label: "権限",
20
+ required: false,
21
+ hidden: true,
22
+ },
23
+ disabled: defField("check", {
24
+ label: "使用不可",
25
+ default: false,
26
+ required: false,
27
+ hidden: true,
28
+ }),
29
+ };
30
+
31
+ export default class User extends FireModel {
32
+ static className = "ユーザー";
33
+ static collectionPath = "Users";
34
+ static classProps = classProps;
35
+
36
+ static headers = [
37
+ { title: "email", key: "email" },
38
+ { title: "表示名", key: "displayName" },
39
+ { title: "管理者", key: "roles" },
40
+ ];
41
+ }
@@ -0,0 +1,297 @@
1
+ /*****************************************************************************
2
+ * WorkingResult ver 1.0.0
3
+ * @author shisyamo4131
4
+ * ---------------------------------------------------------------------------
5
+ * A class representing the working result for a specific date and shift extending FireModel.
6
+ * - This class is intended to be inherited by other classes so, it cannot be instantiated directly.
7
+ * - `dateAt` is defined as a trigger property. When it is set, `dayType` is automatically updated.
8
+ * - Subclasses can override `setDateAtCallback` to add custom behavior when `dateAt` changes.
9
+ * ---------------------------------------------------------------------------
10
+ * @props {Date} dateAt - Applicable start date (trigger property)
11
+ * @props {string} dayType - Day type (e.g., `WEEKDAY`, `WEEKEND`, `HOLIDAY`)
12
+ * @props {string} shiftType - Shift type (`DAY`, `NIGHT`)
13
+ * @props {string} startTime - Start time (HH:MM format)
14
+ * @props {boolean} isStartNextDay - Next day start flag
15
+ * - `true` if the actual work starts the day after the placement date `dateAt`
16
+ * @props {string} endTime - End time (HH:MM format)
17
+ * @props {number} breakMinutes - Break time (minutes)
18
+ * @props {number} regulationWorkMinutes - Regulation work minutes
19
+ * - The maximum working time defined by `unitPriceBase` (or `unitPriceQualified`).
20
+ * - Exceeding this time is considered overtime.
21
+ * ---------------------------------------------------------------------------
22
+ * @computed {string} key - Unique key combining `date`, `dayType`, and `shiftType` (read-only)
23
+ * - A unique identifier for the working result, combining `date`, `dayType`, and `shiftType`.
24
+ * @computed {string} date - Date string in YYYY-MM-DD format based on `dateAt` (read-only)
25
+ * - Returns a string in the format YYYY-MM-DD based on `dateAt`.
26
+ * @computed {boolean} isSpansNextDay - Flag indicating whether the date spans from start date to end date (read-only)
27
+ * - `true` if `startTime` is later than `endTime`
28
+ * @computed {Date} startAt - Start date and time (Date object) (read-only)
29
+ * - Returns a Date object with `startTime` set based on `dateAt`.
30
+ * - If `isStartNextDay` is true, add 1 day.
31
+ * @computed {Date} endAt - End date and time (Date object) (read-only)
32
+ * - Returns a Date object with `endTime` set based on `dateAt`.
33
+ * - If `isStartNextDay` is true, add 1 day.
34
+ * - If `isSpansNextDay` is true, add 1 day.
35
+ * @computed {number} totalWorkMinutes - Total working time in minutes (excluding break time) (read-only)
36
+ * - Calculated as the difference between `endAt` and `startAt` minus `breakMinutes`
37
+ * - If the difference between `endAt` and `startAt` is negative, returns 0.
38
+ * - If `startAt` or `endAt` is not set, returns 0.
39
+ * @computed {number} regularTimeWorkMinutes - Regular working time in minutes (read-only)
40
+ * - The portion of `totalWorkMinutes` that is considered within the contract's `regulationWorkMinutes`.
41
+ * - If actual working time is less than regulation time (e.g., early leave), it equals `totalWorkMinutes`.
42
+ * - If actual working time exceeds regulation time (overtime), it equals `regulationWorkMinutes`.
43
+ * @computed {number} overtimeWorkMinutes - Overtime work in minutes (read-only)
44
+ * - Calculated as `totalWorkMinutes` minus `regulationWorkMinutes`
45
+ * - Overtime work is not negative; the minimum is 0.
46
+ * ---------------------------------------------------------------------------
47
+ * @getter {number} startHour - Start hour (0-23) (read-only)
48
+ * - Extracted from `startTime`.
49
+ * @getter {number} startMinute - Start minute (0-59) (read-only)
50
+ * - Extracted from `startTime`.
51
+ * @getter {number} endHour - End hour (0-23) (read-only)
52
+ * - Extracted from `endTime`.
53
+ * @getter {number} endMinute - End minute (0-59) (read-only)
54
+ * - Extracted from `endTime`.
55
+ * ---------------------------------------------------------------------------
56
+ * @method {function} setDateAtCallback - Callback method called when `dateAt` is set
57
+ * - Override this method in subclasses to add custom behavior when `dateAt` changes.
58
+ * - By default, updates `dayType` based on the new `dateAt` value.
59
+ * - @param {Date} v - The new `dateAt` value
60
+ *****************************************************************************/
61
+ import FireModel from "@shisyamo4131/air-firebase-v2";
62
+ import { defField } from "./parts/fieldDefinitions.js";
63
+ import { getDateAt } from "./utils/index.js";
64
+ import { getDayType } from "./constants/day-type.js";
65
+
66
+ const classProps = {
67
+ dateAt: defField("dateAt", { required: true }),
68
+ dayType: defField("dayType", { required: true }),
69
+ shiftType: defField("shiftType", { required: true }),
70
+ startTime: defField("time", {
71
+ label: "開始時刻",
72
+ required: true,
73
+ default: "08:00",
74
+ }),
75
+ isStartNextDay: defField("check", { label: "翌日開始" }),
76
+ endTime: defField("time", {
77
+ label: "終了時刻",
78
+ required: true,
79
+ default: "17:00",
80
+ }),
81
+ breakMinutes: defField("breakMinutes", { required: true }),
82
+ regulationWorkMinutes: defField("regulationWorkMinutes", { required: true }),
83
+ };
84
+
85
+ /**
86
+ * Wrapper to define computed properties.
87
+ * @param {*} obj
88
+ * @param {*} properties
89
+ */
90
+ function defineComputedProperties(obj, properties) {
91
+ const descriptors = {};
92
+ for (const [key, descriptor] of Object.entries(properties)) {
93
+ descriptors[key] = {
94
+ configurable: true,
95
+ enumerable: true,
96
+ ...descriptor,
97
+ };
98
+ }
99
+ Object.defineProperties(obj, descriptors);
100
+ }
101
+
102
+ export default class WorkingResult extends FireModel {
103
+ static className = "WorkingResult";
104
+ static collectionPath = "WorkingResults";
105
+ static useAutonumber = false;
106
+ static logicalDelete = false;
107
+ static classProps = classProps;
108
+
109
+ /**
110
+ * Constructor
111
+ * - Prevent direct instantiation of WorkingResult class.
112
+ * @param {*} item
113
+ */
114
+ constructor(item = {}) {
115
+ if (new.target === WorkingResult) {
116
+ throw new Error(
117
+ "WorkingResult is an abstract class and cannot be instantiated directly."
118
+ );
119
+ }
120
+ super(item);
121
+ }
122
+
123
+ /**
124
+ * afterInitialize
125
+ * @param {*} item
126
+ */
127
+ afterInitialize(item = {}) {
128
+ super.afterInitialize(item);
129
+
130
+ /** Define triggers */
131
+ let _dateAt = this.dateAt;
132
+ defineComputedProperties(this, {
133
+ /**
134
+ * dateAt - Convert `dateAt` property to use getter/setter
135
+ * - When `dateAt` is set, call `setDateAtCallback` to update dependent properties.
136
+ */
137
+ dateAt: {
138
+ get() {
139
+ return _dateAt;
140
+ },
141
+ set(v) {
142
+ if (_dateAt && v.getTime() === _dateAt.getTime()) {
143
+ return;
144
+ }
145
+ const newDate = new Date(v);
146
+ newDate.setHours(0, 0, 0, 0); // 時刻部分をクリア
147
+ _dateAt = newDate;
148
+ this.setDateAtCallback(newDate);
149
+ },
150
+ },
151
+ });
152
+
153
+ /** Define computed properties */
154
+ defineComputedProperties(this, {
155
+ /**
156
+ * key - Unique key combining date, dayType, and shiftType
157
+ * - A unique identifier for the working result, combining `date`, `dayType`, and `shiftType`.
158
+ */
159
+ key: {
160
+ get: () => {
161
+ return `${this.date}-${this.dayType}-${this.shiftType}`;
162
+ },
163
+ set: () => {},
164
+ },
165
+ /**
166
+ * date - Date string in YYYY-MM-DD format based on `dateAt`
167
+ * - Returns a string in the format YYYY-MM-DD based on `dateAt`.
168
+ * - If `dateAt` is not set, returns an empty string.
169
+ */
170
+ date: {
171
+ get: () => {
172
+ if (!this.dateAt) return "";
173
+ const year = this.dateAt.getFullYear();
174
+ const month = String(this.dateAt.getMonth() + 1).padStart(2, "0"); // 月は0始まり
175
+ const day = String(this.dateAt.getDate()).padStart(2, "0");
176
+ return `${year}-${month}-${day}`;
177
+ },
178
+ set: (v) => {},
179
+ },
180
+ /**
181
+ * isSpansNextDay - Flag indicating whether the date spans from start date to end date
182
+ * - `true` if `startTime` is later than `endTime`
183
+ */
184
+ isSpansNextDay: {
185
+ get: () => this.startTime > this.endTime,
186
+ set: (v) => {},
187
+ },
188
+ /**
189
+ * startAt - Start date and time (Date object)
190
+ * - Returns a Date object with `startTime` set based on `dateAt`.
191
+ * - If `isStartNextDay` is true, add 1 day.
192
+ */
193
+ startAt: {
194
+ get() {
195
+ const dateOffset = this.isStartNextDay ? 1 : 0;
196
+ return getDateAt(this.dateAt, this.startTime, dateOffset);
197
+ },
198
+ set(v) {},
199
+ },
200
+ /**
201
+ * endAt - End date and time (Date object)
202
+ * - Returns a Date object with `endTime` set based on `dateAt`.
203
+ * - If `isStartNextDay` is true, add 1 day.
204
+ * - If `isSpansNextDay` is true, add 1 day.
205
+ */
206
+ endAt: {
207
+ get() {
208
+ const dateOffset =
209
+ (this.isSpansNextDay ? 1 : 0) + (this.isStartNextDay ? 1 : 0);
210
+ return getDateAt(this.dateAt, this.endTime, dateOffset);
211
+ },
212
+ set(v) {},
213
+ },
214
+ /**
215
+ * totalWorkMinutes - Total working time in minutes (excluding break time)
216
+ * - Calculated as the difference between `endAt` and `startAt` minus `breakMinutes`
217
+ * - If the difference between `endAt` and `startAt` is negative, returns 0.
218
+ * - If `startAt` or `endAt` is not set, returns 0.
219
+ */
220
+ totalWorkMinutes: {
221
+ get: () => {
222
+ const start = this.startAt;
223
+ const end = this.endAt;
224
+ const breakMinutes = this.breakMinutes || 0;
225
+ const diff = (end - start) / (1000 * 60); // ミリ秒を分に変換
226
+ return Math.max(0, diff - breakMinutes);
227
+ },
228
+ set: (v) => {},
229
+ },
230
+ /**
231
+ * regularTimeWorkMinutes - Regular working time in minutes
232
+ * - The portion of `totalWorkMinutes` that is considered within the contract's `regulationWorkMinutes`.
233
+ * - If actual working time is less than regulation time (e.g., early leave), it equals `totalWorkMinutes`.
234
+ * - If actual working time exceeds regulation time (overtime), it equals `regulationWorkMinutes`.
235
+ */
236
+ regularTimeWorkMinutes: {
237
+ get: () => {
238
+ return Math.min(this.totalWorkMinutes, this.regulationWorkMinutes);
239
+ },
240
+ set: (v) => {},
241
+ },
242
+ /**
243
+ * overtimeWorkMinutes - Overtime working time in minutes
244
+ * - The value obtained by subtracting `regulationWorkMinutes` from `totalWorkMinutes`.
245
+ * - Overtime working time is capped at 0 to prevent negative values.
246
+ */
247
+ overtimeWorkMinutes: {
248
+ get: () => {
249
+ const diff = this.totalWorkMinutes - this.regulationWorkMinutes;
250
+ return Math.max(0, diff);
251
+ },
252
+ set: (v) => {},
253
+ },
254
+ });
255
+ }
256
+
257
+ /**
258
+ * A function called when `dateAt` is set.
259
+ * - Override this method in subclasses to add custom behavior when `dateAt` changes.
260
+ * @param {*} v
261
+ */
262
+ setDateAtCallback(v) {
263
+ this.dayType = getDayType(v);
264
+ }
265
+
266
+ /**
267
+ * Returns the start hour extracted from `startTime`.
268
+ * - Returns 0 if `startTime` is not set.
269
+ */
270
+ get startHour() {
271
+ return this.startTime ? Number(this.startTime.split(":")[0]) : 0;
272
+ }
273
+
274
+ /**
275
+ * Returns the start minute extracted from `startTime`.
276
+ * - Returns 0 if `startTime` is not set.
277
+ */
278
+ get startMinute() {
279
+ return this.startTime ? Number(this.startTime.split(":")[1]) : 0;
280
+ }
281
+
282
+ /**
283
+ * Returns the end hour extracted from `endTime`.
284
+ * - Returns 0 if `endTime` is not set.
285
+ */
286
+ get endHour() {
287
+ return this.endTime ? Number(this.endTime.split(":")[0]) : 0;
288
+ }
289
+
290
+ /**
291
+ * Returns the end minute extracted from `endTime`.
292
+ * - Returns 0 if `endTime` is not set.
293
+ */
294
+ get endMinute() {
295
+ return this.endTime ? Number(this.endTime.split(":")[1]) : 0;
296
+ }
297
+ }
@@ -0,0 +1,9 @@
1
+ export function fetchDocsApi(constructor) {
2
+ const instance = new constructor();
3
+ return async (search) => await instance.fetchDocs({ constraints: search });
4
+ }
5
+
6
+ export function fetchItemByKeyApi(constructor) {
7
+ const instance = new constructor();
8
+ return async (docId) => await instance.fetchDoc({ docId });
9
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @file arrangement-notification-status.js
3
+ */
4
+
5
+ export const VALUES = Object.freeze({
6
+ ARRANGED: {
7
+ value: "ARRANGED",
8
+ label: "配置済",
9
+ order: 1,
10
+ color: "#F57C00", // 🟠 配置通知済み(待機中)
11
+ },
12
+
13
+ CONFIRMED: {
14
+ value: "CONFIRMED",
15
+ label: "確認済",
16
+ order: 2,
17
+ color: "#2196F3", // 🔵 作業員が了承済み(準備中)
18
+ },
19
+
20
+ ARRIVED: {
21
+ value: "ARRIVED",
22
+ label: "上番済",
23
+ order: 3,
24
+ color: "#4CAF50", // 🟢 現場到着、作業開始可能
25
+ },
26
+
27
+ LEAVED: {
28
+ value: "LEAVED",
29
+ label: "下番済",
30
+ order: 4,
31
+ color: "#607D8B", // ⚫ 作業完了、離脱済み
32
+ },
33
+
34
+ /**
35
+ * 現着中止は作業員ごとのステータスではなく、現場稼働予定や稼働実績のステータスであるため
36
+ * ここからは削除。
37
+ */
38
+ // CANCELED: {
39
+ // value: "CANCELED",
40
+ // label: "現着中止",
41
+ // order: 5,
42
+ // color: "#F44336", // 🔴 異常状態、作業中止
43
+ // },
44
+ });
45
+
46
+ export const OPTIONS = [
47
+ {
48
+ title: VALUES.ARRANGED.label,
49
+ value: VALUES.ARRANGED.value,
50
+ color: VALUES.ARRANGED.color,
51
+ },
52
+ {
53
+ title: VALUES.CONFIRMED.label,
54
+ value: VALUES.CONFIRMED.value,
55
+ color: VALUES.CONFIRMED.color,
56
+ },
57
+ {
58
+ title: VALUES.ARRIVED.label,
59
+ value: VALUES.ARRIVED.value,
60
+ color: VALUES.ARRIVED.color,
61
+ },
62
+ {
63
+ title: VALUES.LEAVED.label,
64
+ value: VALUES.LEAVED.value,
65
+ color: VALUES.LEAVED.color,
66
+ },
67
+ // { title: VALUES.CANCELED.label, value: VALUES.CANCELED.value },
68
+ ];
@@ -0,0 +1,15 @@
1
+ // prettier-ignore
2
+ export const BILLING_UNIT_TYPE_DEFAULT = "PER_DAY";
3
+ export const BILLING_UNIT_TYPE_PER_DAY = "PER_DAY";
4
+ export const BILLING_UNIT_TYPE_PER_HOUR = "PER_HOUR";
5
+
6
+ export const BILLING_UNIT_TYPE = Object.freeze({
7
+ PER_DAY: "日",
8
+ PER_HOUR: "時間",
9
+ });
10
+
11
+ export const BILLING_UNIT_TYPE_ARRAY = Object.entries(BILLING_UNIT_TYPE).map(
12
+ ([key, value]) => {
13
+ return { value: key, title: value };
14
+ }
15
+ );
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @file src/constants/contract-status.js
3
+ * @description Contract status constants and options.
4
+ * @author shisyamo4131
5
+ */
6
+
7
+ export const VALUES = Object.freeze({
8
+ ACTIVE: { value: "ACTIVE", title: "契約中" },
9
+ TERMINATED: { value: "TERMINATED", title: "契約終了" },
10
+ });
11
+
12
+ export const OPTIONS = [
13
+ { title: VALUES.ACTIVE.title, value: VALUES.ACTIVE.value },
14
+ { title: VALUES.TERMINATED.title, value: VALUES.TERMINATED.value },
15
+ ];
@@ -0,0 +1,44 @@
1
+ // prettier-ignore
2
+ import holiday_jp from "@holiday-jp/holiday_jp";
3
+
4
+ export const DAY_TYPE_DEFAULT = "WEEKDAY";
5
+ export const DAY_TYPE_WEEKDAY = "WEEKDAY";
6
+ export const DAY_TYPE_SATURDAY = "SATURDAY";
7
+ export const DAY_TYPE_SUNDAY = "SUNDAY";
8
+ export const DAY_TYPE_HOLIDAY = "HOLIDAY";
9
+
10
+ export const DAY_TYPE = Object.freeze({
11
+ WEEKDAY: "平日",
12
+ SATURDAY: "土曜",
13
+ SUNDAY: "日曜",
14
+ HOLIDAY: "祝日",
15
+ });
16
+
17
+ export const DAY_TYPE_ARRAY = Object.entries(DAY_TYPE).map(([key, value]) => {
18
+ return { value: key, title: value };
19
+ });
20
+
21
+ /**
22
+ * Returns the corresponding day type based on the given date's day of the week.
23
+ * If the date is a holiday, it returns "HOLIDAY".
24
+ * If the date is a Sunday, it returns "SUNDAY".
25
+ * If the date is a Saturday, it returns "SATURDAY".
26
+ * Otherwise, it returns "WEEKDAY".
27
+ * @param {Date} date
28
+ * @returns {string} - The day type corresponding to the date.
29
+ * @throws {TypeError} if date is not a Date object
30
+ */
31
+ export const getDayType = (date) => {
32
+ if (!(date instanceof Date)) {
33
+ throw new TypeError("Input must be a Date object");
34
+ }
35
+ if (holiday_jp.isHoliday(date)) {
36
+ return DAY_TYPE_HOLIDAY;
37
+ } else if (date.getDay() === 0) {
38
+ return DAY_TYPE_SUNDAY;
39
+ } else if (date.getDay() === 6) {
40
+ return DAY_TYPE_SATURDAY;
41
+ } else {
42
+ return DAY_TYPE_WEEKDAY;
43
+ }
44
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @file src/constants/employment-status.js
3
+ * @description Employment status constants and options.
4
+ * @author shisyamo4131
5
+ */
6
+
7
+ export const VALUES = Object.freeze({
8
+ ACTIVE: { value: "ACTIVE", title: "在職中" },
9
+ TERMINATED: { value: "TERMINATED", title: "退職済み" },
10
+ });
11
+
12
+ export const OPTIONS = [
13
+ { title: VALUES.ACTIVE.title, value: VALUES.ACTIVE.value },
14
+ { title: VALUES.TERMINATED.title, value: VALUES.TERMINATED.value },
15
+ ];
@@ -0,0 +1,11 @@
1
+ // prettier-ignore
2
+ export const GENDER_DEFAULT = "MALE";
3
+
4
+ export const GENDER = Object.freeze({
5
+ MALE: "男性",
6
+ FEMALE: "女性",
7
+ });
8
+
9
+ export const GENDER_ARRAY = Object.entries(GENDER).map(([key, value]) => {
10
+ return { value: key, title: value };
11
+ });
@@ -0,0 +1,9 @@
1
+ export * from "./arrangement-notification-status.js";
2
+ export * from "./billing-unit-type.js";
3
+ export * from "./contract-status.js";
4
+ export * from "./day-type.js";
5
+ export * from "./employment-status.js";
6
+ export * from "./gender.js";
7
+ export * from "./prefectures.js";
8
+ export * from "./shift-type.js";
9
+ export * from "./site-status.js";
@@ -0,0 +1,56 @@
1
+ // prettier-ignore
2
+ export const PREFECTURES = Object.freeze({
3
+ "01": { name: "北海道" },
4
+ "02": { name: "青森県" },
5
+ "03": { name: "岩手県" },
6
+ "04": { name: "宮城県" },
7
+ "05": { name: "秋田県" },
8
+ "06": { name: "山形県" },
9
+ "07": { name: "福島県" },
10
+ "08": { name: "茨城県" },
11
+ "09": { name: "栃木県" },
12
+ "10": { name: "群馬県" },
13
+ "11": { name: "埼玉県" },
14
+ "12": { name: "千葉県" },
15
+ "13": { name: "東京都" },
16
+ "14": { name: "神奈川県" },
17
+ "15": { name: "新潟県" },
18
+ "16": { name: "富山県" },
19
+ "17": { name: "石川県" },
20
+ "18": { name: "福井県" },
21
+ "19": { name: "山梨県" },
22
+ "20": { name: "長野県" },
23
+ "21": { name: "岐阜県" },
24
+ "22": { name: "静岡県" },
25
+ "23": { name: "愛知県" },
26
+ "24": { name: "三重県" },
27
+ "25": { name: "滋賀県" },
28
+ "26": { name: "京都府" },
29
+ "27": { name: "大阪府" },
30
+ "28": { name: "兵庫県" },
31
+ "29": { name: "奈良県" },
32
+ "30": { name: "和歌山県" },
33
+ "31": { name: "鳥取県" },
34
+ "32": { name: "島根県" },
35
+ "33": { name: "岡山県" },
36
+ "34": { name: "広島県" },
37
+ "35": { name: "山口県" },
38
+ "36": { name: "徳島県" },
39
+ "37": { name: "香川県" },
40
+ "38": { name: "愛媛県" },
41
+ "39": { name: "高知県" },
42
+ "40": { name: "福岡県" },
43
+ "41": { name: "佐賀県" },
44
+ "42": { name: "長崎県" },
45
+ "43": { name: "熊本県" },
46
+ "44": { name: "大分県" },
47
+ "45": { name: "宮崎県" },
48
+ "46": { name: "鹿児島県" },
49
+ "47": { name: "沖縄県" },
50
+ });
51
+
52
+ export const PREFECTURES_ARRAY = Object.entries(PREFECTURES)
53
+ .sort((a, b) => a[0].localeCompare(b[0])) // キー(都道府県コード)でソート
54
+ .map(([key, value]) => {
55
+ return { value: key, title: value.name };
56
+ });
@@ -0,0 +1,20 @@
1
+ // prettier-ignore
2
+ export const SHIFT_TYPE_DEFAULT = "DAY";
3
+ export const SHIFT_TYPE_DAY = "DAY";
4
+ export const SHIFT_TYPE_NIGHT = "NIGHT";
5
+
6
+ export const SHIFT_TYPE = Object.freeze({
7
+ DAY: { value: "DAY", title: "日勤", color: "deep-orange" },
8
+ NIGHT: { value: "NIGHT", title: "夜勤", color: "indigo" },
9
+ });
10
+
11
+ export const SHIFT_TYPE_ARRAY = Object.entries(SHIFT_TYPE).map(
12
+ ([key, value]) => {
13
+ return { value: key, title: value.title, color: value.color };
14
+ }
15
+ );
16
+
17
+ export const SHIFT_TYPE_VALIDATOR = (value) => {
18
+ const arr = Object.keys(SHIFT_TYPE);
19
+ return arr.includes(value);
20
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @file src/constants/site-status.js
3
+ * @description Site status constants and options.
4
+ * @author shisyamo4131
5
+ */
6
+
7
+ export const VALUES = Object.freeze({
8
+ ACTIVE: { value: "ACTIVE", title: "稼働中" },
9
+ TERMINATED: { value: "TERMINATED", title: "終了" },
10
+ });
11
+
12
+ export const OPTIONS = [
13
+ { title: VALUES.ACTIVE.title, value: VALUES.ACTIVE.value },
14
+ { title: VALUES.TERMINATED.title, value: VALUES.TERMINATED.value },
15
+ ];