@aiquants/daily-report 0.1.1 → 0.2.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.
- package/dist/client.d.mts +10 -3
- package/dist/client.d.ts +10 -3
- package/dist/client.js +4 -4
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +4 -4
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +2 -2
- package/dist/server.mjs.map +1 -1
- package/dist/{sse-schema-yl5AaSsj.d.mts → sse-schema-DKUjXMW3.d.mts} +34 -1
- package/dist/{sse-schema-CK7cUnEo.d.ts → sse-schema-DO9Qe8XF.d.ts} +34 -1
- package/dist/{types-CVhwLhSN.d.mts → types-DrjeK3_G.d.mts} +1 -0
- package/dist/{types-CVhwLhSN.d.ts → types-DrjeK3_G.d.ts} +1 -0
- package/package.json +5 -5
- package/src/client/components/daily-report-detail-list.tsx +11 -2
- package/src/client/components/daily-report-list.tsx +13 -1
- package/src/client/config-context.tsx +9 -0
- package/src/client/contexts/daily-report-action-context.tsx +1 -0
- package/src/server/service.ts +2 -0
- package/src/shared/sse-schema.ts +1 -0
- package/src/shared/types.ts +1 -0
|
@@ -38,6 +38,11 @@ export type DailyReportFieldLabels = {
|
|
|
38
38
|
relationsEmpty: string
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
export type SourceTypeConfig = {
|
|
42
|
+
label: string
|
|
43
|
+
badgeClassName?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
/** クライアント層の設定一式。 */
|
|
42
47
|
export type DailyReportClientConfig = {
|
|
43
48
|
/** 画面タイトル (ヘッダーへ渡す)。 */
|
|
@@ -50,6 +55,8 @@ export type DailyReportClientConfig = {
|
|
|
50
55
|
draftLabelName: string
|
|
51
56
|
/** 詳細/一覧カードのフィールド見出しラベル。既定は中立英語。アプリが自ドメインの表記を注入する。 */
|
|
52
57
|
fieldLabels: DailyReportFieldLabels
|
|
58
|
+
/** 外部ソース区分ごとのバッジ表示設定。 */
|
|
59
|
+
sourceTypeConfigs?: Record<string, SourceTypeConfig>
|
|
53
60
|
/** ヘッダー描画スロット。アプリのヘッダーコンポーネントを差し込む。 */
|
|
54
61
|
renderHeader: (props: DailyReportHeaderProps) => ReactNode
|
|
55
62
|
/** 開発向けコントロール (SSE 購読トグル等) を表示するか。 */
|
|
@@ -62,6 +69,7 @@ export type DailyReportClientConfig = {
|
|
|
62
69
|
*/
|
|
63
70
|
export type DailyReportClientConfigInput = Partial<Omit<DailyReportClientConfig, "fieldLabels">> & {
|
|
64
71
|
fieldLabels?: Partial<DailyReportFieldLabels>
|
|
72
|
+
sourceTypeConfigs?: Record<string, SourceTypeConfig>
|
|
65
73
|
}
|
|
66
74
|
|
|
67
75
|
/** 中立英語のフィールドラベル既定 (ドメイン非依存)。 */
|
|
@@ -94,6 +102,7 @@ export const defaultDailyReportClientConfig: DailyReportClientConfig = {
|
|
|
94
102
|
// 中立プレースホルダー。実運用のラベル名 (アプリ固有) は Provider / config prop で上書きする。
|
|
95
103
|
draftLabelName: "draft",
|
|
96
104
|
fieldLabels: defaultDailyReportFieldLabels,
|
|
105
|
+
sourceTypeConfigs: {},
|
|
97
106
|
renderHeader: ({ title, annotation }) => (
|
|
98
107
|
<header className="flex flex-wrap items-baseline justify-between gap-2 px-2 py-1">
|
|
99
108
|
<span className="text-nowrap text-slate-700 text-sm dark:text-slate-200">{title}</span>
|
|
@@ -703,6 +703,7 @@ export const DailyReportActionProvider = ({ children, user, initialItems = [], u
|
|
|
703
703
|
createdAt: now,
|
|
704
704
|
author: getUserDisplayName(user),
|
|
705
705
|
userId: user?.id ?? "unknown",
|
|
706
|
+
sourceType: "Internal",
|
|
706
707
|
employeeName: getUserDisplayName(user),
|
|
707
708
|
updatedBy: getUserDisplayName(user),
|
|
708
709
|
updatedAt: now,
|
package/src/server/service.ts
CHANGED
|
@@ -326,6 +326,7 @@ export function createDailyReportService(config: DailyReportServiceConfig) {
|
|
|
326
326
|
date: formatDateValue(hub.businessDate, "YYYY-MM-DD"),
|
|
327
327
|
author: row.creatorName ?? maskAuditActor(hub.createdBy) ?? "",
|
|
328
328
|
userId: hub.userId ? encodeUserId(hub.userId) : "",
|
|
329
|
+
sourceType: hub.sourceType ?? "Internal",
|
|
329
330
|
createdAt: formatDateValue(hub.createdAt, "YYYY-MM-DD HH:mm:ss"),
|
|
330
331
|
updatedAt: formatDateValue(hub.updatedAt, "YYYY-MM-DD HH:mm:ss"),
|
|
331
332
|
updatedBy: maskAuditActor(hub.updatedBy),
|
|
@@ -1034,6 +1035,7 @@ export function createDailyReportService(config: DailyReportServiceConfig) {
|
|
|
1034
1035
|
createdAt: formatDateValue(hub.createdAt, "YYYY-MM-DD HH:mm:ss"),
|
|
1035
1036
|
author: userName,
|
|
1036
1037
|
userId: encodeUserId(userId),
|
|
1038
|
+
sourceType: "Internal",
|
|
1037
1039
|
employeeName: userName,
|
|
1038
1040
|
// 監査列と同様、クライアント公開時は生内部 ID を難読化する (mapHubRecord と整合)
|
|
1039
1041
|
updatedBy: encodeUserId(userId),
|
package/src/shared/sse-schema.ts
CHANGED
|
@@ -39,6 +39,7 @@ export const dailyReportDetailSchema = z.object({
|
|
|
39
39
|
createdAt: z.string().nullable(),
|
|
40
40
|
author: z.string(),
|
|
41
41
|
userId: z.string(),
|
|
42
|
+
sourceType: z.string().nullable(),
|
|
42
43
|
employeeName: z.string().nullable(),
|
|
43
44
|
updatedBy: z.string().nullable(),
|
|
44
45
|
updatedAt: z.string().nullable(),
|