Merge branch 't3code/improve-job-status-notification-details'
This commit is contained in:
50
lib/types.ts
50
lib/types.ts
@@ -152,6 +152,53 @@ export type TaskStage =
|
||||
| 'insights.generate'
|
||||
| 'insights.persist';
|
||||
|
||||
export type TaskStageContext = {
|
||||
progress?: {
|
||||
current: number;
|
||||
total: number;
|
||||
unit: string;
|
||||
} | null;
|
||||
counters?: Record<string, number>;
|
||||
subject?: {
|
||||
ticker?: string;
|
||||
accessionNumber?: string;
|
||||
label?: string;
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type TaskNotificationStat = {
|
||||
label: string;
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type TaskNotificationAction = {
|
||||
id:
|
||||
| 'open_details'
|
||||
| 'open_filings'
|
||||
| 'open_analysis'
|
||||
| 'open_analysis_report'
|
||||
| 'open_search'
|
||||
| 'open_portfolio';
|
||||
label: string;
|
||||
href: string | null;
|
||||
primary?: boolean;
|
||||
};
|
||||
|
||||
export type TaskNotificationView = {
|
||||
title: string;
|
||||
statusLine: string;
|
||||
detailLine: string | null;
|
||||
tone: 'info' | 'success' | 'error';
|
||||
progress: {
|
||||
current: number;
|
||||
total: number;
|
||||
unit: string;
|
||||
percent: number | null;
|
||||
} | null;
|
||||
stats: TaskNotificationStat[];
|
||||
actions: TaskNotificationAction[];
|
||||
};
|
||||
|
||||
export type Task = {
|
||||
id: string;
|
||||
user_id: string;
|
||||
@@ -159,6 +206,7 @@ export type Task = {
|
||||
status: TaskStatus;
|
||||
stage: TaskStage;
|
||||
stage_detail: string | null;
|
||||
stage_context: TaskStageContext | null;
|
||||
resource_key: string | null;
|
||||
notification_read_at: string | null;
|
||||
notification_silenced_at: string | null;
|
||||
@@ -172,6 +220,7 @@ export type Task = {
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
finished_at: string | null;
|
||||
notification: TaskNotificationView;
|
||||
};
|
||||
|
||||
export type TaskStageEvent = {
|
||||
@@ -180,6 +229,7 @@ export type TaskStageEvent = {
|
||||
user_id: string;
|
||||
stage: TaskStage;
|
||||
stage_detail: string | null;
|
||||
stage_context: TaskStageContext | null;
|
||||
status: TaskStatus;
|
||||
created_at: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user