Add TypeScript interfaces for Tessera domain types
This commit is contained in:
103
web/src/lib/types.ts
Normal file
103
web/src/lib/types.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
export interface Ticket {
|
||||
id: string;
|
||||
subject: string;
|
||||
queue_id: string;
|
||||
status: string;
|
||||
owner_id: string | null;
|
||||
creator_id: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
started_at: string | null;
|
||||
resolved_at: string | null;
|
||||
custom_fields?: CustomFieldValue[];
|
||||
}
|
||||
|
||||
export interface Queue {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string | null;
|
||||
lifecycle_id: string | null;
|
||||
}
|
||||
|
||||
export interface Transaction {
|
||||
id: string;
|
||||
ticket_id: string;
|
||||
transaction_type: string;
|
||||
field: string | null;
|
||||
old_value: string | null;
|
||||
new_value: string | null;
|
||||
data: unknown;
|
||||
creator_id: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface Scrip {
|
||||
id: string;
|
||||
queue_id: string | null;
|
||||
name: string;
|
||||
condition_type: string;
|
||||
action_type: string;
|
||||
action_config: Record<string, unknown>;
|
||||
template_id: string | null;
|
||||
stage: string;
|
||||
sort_order: number;
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
export interface Template {
|
||||
id: string;
|
||||
name: string;
|
||||
queue_id: string | null;
|
||||
subject_template: string;
|
||||
body_template: string;
|
||||
}
|
||||
|
||||
export interface Lifecycle {
|
||||
id: string;
|
||||
name: string;
|
||||
definition: LifecycleDefinition;
|
||||
}
|
||||
|
||||
export interface LifecycleDefinition {
|
||||
statuses: { initial: string[]; active: string[]; inactive: string[] };
|
||||
transitions: Record<string, string[]>;
|
||||
}
|
||||
|
||||
export interface CustomField {
|
||||
id: string;
|
||||
name: string;
|
||||
field_type: string;
|
||||
values: unknown | null;
|
||||
max_values: number;
|
||||
}
|
||||
|
||||
export interface CustomFieldValue {
|
||||
id: string;
|
||||
custom_field_id: string;
|
||||
ticket_id: string;
|
||||
value: string;
|
||||
custom_field?: CustomField;
|
||||
}
|
||||
|
||||
export interface PreviewResult {
|
||||
prepared_scrips: PreparedScrip[];
|
||||
}
|
||||
|
||||
export interface PreparedScrip {
|
||||
scripId: string;
|
||||
scripName: string;
|
||||
actionType: string;
|
||||
actionPayload: unknown;
|
||||
dryRun: boolean;
|
||||
}
|
||||
|
||||
export interface UpdateResult {
|
||||
ticket: Ticket;
|
||||
scrip_results: ScripResult[];
|
||||
}
|
||||
|
||||
export interface ScripResult {
|
||||
scripId: string;
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
Reference in New Issue
Block a user