@shisyamo4131/air-guard-v2-schemas 2.4.2-dev.74 → 2.4.2-dev.75
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/index.js +2 -0
- package/package.json +1 -1
- package/src/ArrangementNotification.js +8 -0
- package/src/Notification.js +95 -0
- package/src/NotificationRecipient.js +68 -0
- package/src/parts/fieldDefinitions/array.js +11 -0
- package/src/parts/fieldDefinitions/dateAt.js +5 -0
- package/src/parts/fieldDefinitions/multipleLine.js +4 -0
package/index.js
CHANGED
|
@@ -16,6 +16,8 @@ export { default as Employee } from "./src/Employee.js";
|
|
|
16
16
|
export { VALIDATION_ERRORS } from "./src/errorDefinitions.js";
|
|
17
17
|
export { GeocodableMixin } from "./src/mixins/GeocodableMixin.js";
|
|
18
18
|
export { default as Insurance } from "./src/Insurance.js";
|
|
19
|
+
export { default as Notification } from "./src/Notification.js";
|
|
20
|
+
export { default as NotificationRecipient } from "./src/NotificationRecipient.js";
|
|
19
21
|
export { default as OperationBilling } from "./src/OperationBilling.js";
|
|
20
22
|
export { default as OperationResult } from "./src/OperationResult.js";
|
|
21
23
|
export { default as OperationResultDetail } from "./src/OperationResultDetail.js";
|
package/package.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
* @prop {string} actualEndTime - Actual end time (HH:MM format)
|
|
17
17
|
* @prop {number} actualBreakMinutes - Actual break time (minutes)
|
|
18
18
|
* @prop {string} status - Arrangement notification status
|
|
19
|
+
* @prop {Date} notificationSentAt - Push notification sent date and time
|
|
20
|
+
* @prop {string} notificationError - Push notification send error message
|
|
19
21
|
* ---------------------------------------------------------------------------
|
|
20
22
|
* @computed {Date} actualStartAt - Actual start date and time (Date object) (read-only)
|
|
21
23
|
* - Returns a Date object with `actualStartTime` set based on `dateAt`.
|
|
@@ -159,6 +161,12 @@ const classProps = {
|
|
|
159
161
|
default: 60,
|
|
160
162
|
required: true,
|
|
161
163
|
}),
|
|
164
|
+
notificationSentAt: defField("notificationSentAt", {
|
|
165
|
+
hidden: true,
|
|
166
|
+
}),
|
|
167
|
+
notificationError: defField("notificationError", {
|
|
168
|
+
hidden: true,
|
|
169
|
+
}),
|
|
162
170
|
};
|
|
163
171
|
|
|
164
172
|
export default class ArrangementNotification extends SiteOperationScheduleDetail {
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
* @file src/Notification.js
|
|
3
|
+
*****************************************************************************/
|
|
4
|
+
import FireModel from "@shisyamo4131/air-firebase-v2";
|
|
5
|
+
import { defField } from "./parts/fieldDefinitions.js";
|
|
6
|
+
|
|
7
|
+
/*****************************************************************************
|
|
8
|
+
* @class Notification
|
|
9
|
+
* @extends FireModel
|
|
10
|
+
*
|
|
11
|
+
* @description
|
|
12
|
+
* 通知ドキュメントのスキーマ定義。
|
|
13
|
+
* Companies/{companyId}/Notifications/{notificationId} に格納される。
|
|
14
|
+
* 通知の送信履歴と結果を管理するための親ドキュメント。
|
|
15
|
+
*
|
|
16
|
+
* @property {string} title - 通知タイトル
|
|
17
|
+
* @property {string} body - 通知本文
|
|
18
|
+
* @property {string} imageUrl - 画像URL(任意)
|
|
19
|
+
* @property {Object} data - カスタムデータ(任意)
|
|
20
|
+
* @property {Array<string>} recipientUserIds - 送信先ユーザーIDの配列
|
|
21
|
+
* @property {number} totalCount - 送信対象数
|
|
22
|
+
* @property {number} successCount - 送信成功数
|
|
23
|
+
* @property {number} failureCount - 送信失敗数
|
|
24
|
+
* @property {string} status - 送信ステータス(pending, processing, sent, failed, completed)
|
|
25
|
+
* @property {string} sourceType - 送信元タイプ(manual, arrangement, billing など)
|
|
26
|
+
* @property {string} sourceId - 送信元ドキュメントID
|
|
27
|
+
* @property {string} createdBy - 作成者UID
|
|
28
|
+
*
|
|
29
|
+
* @note
|
|
30
|
+
* - status の値:
|
|
31
|
+
* - pending: 送信待ち
|
|
32
|
+
* - processing: 送信中
|
|
33
|
+
* - sent: 送信成功
|
|
34
|
+
* - failed: 送信失敗
|
|
35
|
+
* - completed: 全送信完了
|
|
36
|
+
* - sourceType の例:
|
|
37
|
+
* - manual: 手動送信(UI から)
|
|
38
|
+
* - arrangement: 配置通知
|
|
39
|
+
* - billing: 請求通知
|
|
40
|
+
*
|
|
41
|
+
* @author shisyamo4131
|
|
42
|
+
*****************************************************************************/
|
|
43
|
+
export default class Notification extends FireModel {
|
|
44
|
+
static className = "通知";
|
|
45
|
+
static collectionPath = "Notifications";
|
|
46
|
+
static classProps = {
|
|
47
|
+
title: defField("oneLine", { label: "通知タイトル", required: true }),
|
|
48
|
+
body: defField("multipleLine", { label: "通知本文", required: true }),
|
|
49
|
+
imageUrl: defField("oneLine", { label: "画像URL", required: false }),
|
|
50
|
+
data: defField("object", { label: "カスタムデータ", required: false }),
|
|
51
|
+
recipientUserIds: defField("recipientUserIds", { required: false }),
|
|
52
|
+
totalCount: defField("number", {
|
|
53
|
+
label: "送信対象数",
|
|
54
|
+
default: 0,
|
|
55
|
+
required: false,
|
|
56
|
+
hidden: true,
|
|
57
|
+
}),
|
|
58
|
+
successCount: defField("number", {
|
|
59
|
+
label: "送信成功数",
|
|
60
|
+
default: 0,
|
|
61
|
+
required: false,
|
|
62
|
+
hidden: true,
|
|
63
|
+
}),
|
|
64
|
+
failureCount: defField("number", {
|
|
65
|
+
label: "送信失敗数",
|
|
66
|
+
default: 0,
|
|
67
|
+
required: false,
|
|
68
|
+
hidden: true,
|
|
69
|
+
}),
|
|
70
|
+
status: defField("oneLine", {
|
|
71
|
+
label: "送信ステータス",
|
|
72
|
+
default: "pending",
|
|
73
|
+
required: false,
|
|
74
|
+
hidden: true,
|
|
75
|
+
}),
|
|
76
|
+
sourceType: defField("oneLine", {
|
|
77
|
+
label: "送信元タイプ",
|
|
78
|
+
default: "",
|
|
79
|
+
required: false,
|
|
80
|
+
hidden: true,
|
|
81
|
+
}),
|
|
82
|
+
sourceId: defField("oneLine", {
|
|
83
|
+
label: "送信元ID",
|
|
84
|
+
default: "",
|
|
85
|
+
required: false,
|
|
86
|
+
hidden: true,
|
|
87
|
+
}),
|
|
88
|
+
createdBy: defField("oneLine", {
|
|
89
|
+
label: "作成者",
|
|
90
|
+
default: "",
|
|
91
|
+
required: false,
|
|
92
|
+
hidden: true,
|
|
93
|
+
}),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
* @file src/NotificationRecipient.js
|
|
3
|
+
*****************************************************************************/
|
|
4
|
+
import { BaseClass } from "@shisyamo4131/air-firebase-v2";
|
|
5
|
+
import { defField } from "./parts/fieldDefinitions.js";
|
|
6
|
+
|
|
7
|
+
/*****************************************************************************
|
|
8
|
+
* @class NotificationRecipient
|
|
9
|
+
* @extends BaseClass
|
|
10
|
+
*
|
|
11
|
+
* @description
|
|
12
|
+
* 通知の受信者情報を管理するサブコレクションのスキーマ定義。
|
|
13
|
+
* Companies/{companyId}/Notifications/{notificationId}/Recipients/{recipientId} に格納される。
|
|
14
|
+
* 個別ユーザーごとの送信結果を記録する。
|
|
15
|
+
*
|
|
16
|
+
* @property {string} notificationId - 親 Notification ドキュメントのID
|
|
17
|
+
* @property {string} userId - 受信者のユーザーID
|
|
18
|
+
* @property {string} status - 送信ステータス(pending, sent, failed)
|
|
19
|
+
* @property {Date} sentAt - 送信日時
|
|
20
|
+
* @property {string} error - エラーメッセージ
|
|
21
|
+
*
|
|
22
|
+
* @note
|
|
23
|
+
* - NotificationRecipient は BaseClass を継承(FireModel ではない)
|
|
24
|
+
* - Notification ドキュメントのサブコレクションとして格納される
|
|
25
|
+
* - Cloud Functions のみが作成・更新、アプリ側は読み取り専用
|
|
26
|
+
* - status の値:
|
|
27
|
+
* - pending: 送信待ち
|
|
28
|
+
* - sent: 送信成功
|
|
29
|
+
* - failed: 送信失敗
|
|
30
|
+
* - sentAt: 送信が完了した日時(成功・失敗問わず)
|
|
31
|
+
* - error: 送信失敗時のエラーメッセージ
|
|
32
|
+
*
|
|
33
|
+
* @author shisyamo4131
|
|
34
|
+
*****************************************************************************/
|
|
35
|
+
export default class NotificationRecipient extends BaseClass {
|
|
36
|
+
static className = "通知受信者";
|
|
37
|
+
static classProps = {
|
|
38
|
+
notificationId: defField("oneLine", {
|
|
39
|
+
label: "通知ID",
|
|
40
|
+
default: "",
|
|
41
|
+
required: true,
|
|
42
|
+
hidden: true,
|
|
43
|
+
}),
|
|
44
|
+
userId: defField("oneLine", {
|
|
45
|
+
label: "ユーザーID",
|
|
46
|
+
default: "",
|
|
47
|
+
required: true,
|
|
48
|
+
hidden: true,
|
|
49
|
+
}),
|
|
50
|
+
status: defField("oneLine", {
|
|
51
|
+
label: "送信ステータス",
|
|
52
|
+
default: "pending",
|
|
53
|
+
required: false,
|
|
54
|
+
hidden: true,
|
|
55
|
+
}),
|
|
56
|
+
sentAt: defField("dateTimeAt", {
|
|
57
|
+
label: "送信日時",
|
|
58
|
+
required: false,
|
|
59
|
+
hidden: true,
|
|
60
|
+
}),
|
|
61
|
+
error: defField("oneLine", {
|
|
62
|
+
label: "エラーメッセージ",
|
|
63
|
+
default: "",
|
|
64
|
+
required: false,
|
|
65
|
+
hidden: true,
|
|
66
|
+
}),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -36,4 +36,15 @@ export const arrayFields = {
|
|
|
36
36
|
required: false,
|
|
37
37
|
hidden: false,
|
|
38
38
|
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 通知の送信先ユーザーID配列
|
|
42
|
+
* Notification ドキュメントで使用
|
|
43
|
+
*/
|
|
44
|
+
recipientUserIds: {
|
|
45
|
+
...generalDefinitions.array,
|
|
46
|
+
label: "送信先ユーザーID",
|
|
47
|
+
required: false,
|
|
48
|
+
hidden: true,
|
|
49
|
+
},
|
|
39
50
|
};
|
|
@@ -5,6 +5,10 @@ import { generalDefinitions } from "./defaultDefinition.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export const multipleLineFields = {
|
|
7
7
|
multipleLine: generalDefinitions.multipleLine,
|
|
8
|
+
notificationError: {
|
|
9
|
+
...generalDefinitions.multipleLine,
|
|
10
|
+
label: "通知送信エラー",
|
|
11
|
+
},
|
|
8
12
|
remarks: {
|
|
9
13
|
...generalDefinitions.multipleLine,
|
|
10
14
|
label: "備考",
|