feat(operations): add automated reconciliation center
This commit is contained in:
@@ -38,6 +38,9 @@ import type {
|
||||
Page,
|
||||
QualitySummary,
|
||||
QualityIssueRow,
|
||||
ReconciliationIssue,
|
||||
ReconciliationQuery,
|
||||
ReconciliationSummary,
|
||||
RawFrameRow,
|
||||
RealtimeLocationRow,
|
||||
SourceReadinessPlan,
|
||||
@@ -292,6 +295,22 @@ export const api = {
|
||||
})
|
||||
}
|
||||
),
|
||||
reconciliationSummary: (days = 30, signal?: AbortSignal) => request<ReconciliationSummary>(
|
||||
`/api/v2/reconciliation/summary?days=${days}`,
|
||||
withSignal(undefined, signal)
|
||||
),
|
||||
reconciliationIssues: (query: ReconciliationQuery, signal?: AbortSignal) => request<Page<ReconciliationIssue>>(
|
||||
'/api/v2/reconciliation/issues',
|
||||
withSignal({ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(query) }, signal)
|
||||
),
|
||||
reconciliationIssue: (id: string, signal?: AbortSignal) => request<ReconciliationIssue>(
|
||||
`/api/v2/reconciliation/issues/${encodeURIComponent(id)}`,
|
||||
withSignal(undefined, signal)
|
||||
),
|
||||
updateReconciliationIssue: (id: string, input: { version: number; status: string; note: string }) => request<ReconciliationIssue>(
|
||||
`/api/v2/reconciliation/issues/${encodeURIComponent(id)}/actions`,
|
||||
{ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(input) }
|
||||
),
|
||||
updateVehicleProfile: (vin: string, input: VehicleProfileInput) => request<VehicleProfile>(`/api/v2/vehicles/${encodeURIComponent(vin)}/profile`, {
|
||||
method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(input)
|
||||
}),
|
||||
|
||||
@@ -957,6 +957,75 @@ export interface RuntimeInfo {
|
||||
platformRelease?: string;
|
||||
}
|
||||
|
||||
export interface ReconciliationQuery {
|
||||
keyword?: string;
|
||||
ruleCode?: string;
|
||||
category?: string;
|
||||
severity?: string;
|
||||
status?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
}
|
||||
|
||||
export interface ReconciliationAction {
|
||||
id: number;
|
||||
action: string;
|
||||
fromStatus: string;
|
||||
toStatus: string;
|
||||
actor: string;
|
||||
note: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface ReconciliationIssue {
|
||||
id: string;
|
||||
ruleCode: string;
|
||||
category: string;
|
||||
severity: string;
|
||||
status: string;
|
||||
vin: string;
|
||||
plate: string;
|
||||
protocolA: string;
|
||||
protocolB: string;
|
||||
title: string;
|
||||
summary: string;
|
||||
evidence: Record<string, unknown>;
|
||||
firstSeenAt: string;
|
||||
lastSeenAt: string;
|
||||
occurrenceCount: number;
|
||||
recoveredAt: string;
|
||||
resolutionNote: string;
|
||||
resolvedBy: string;
|
||||
version: number;
|
||||
actions?: ReconciliationAction[];
|
||||
}
|
||||
|
||||
export interface ReconciliationBucket {
|
||||
name: string;
|
||||
count: number;
|
||||
}
|
||||
|
||||
export interface ReconciliationTrendPoint {
|
||||
date: string;
|
||||
detected: number;
|
||||
new: number;
|
||||
active: number;
|
||||
recovered: number;
|
||||
}
|
||||
|
||||
export interface ReconciliationSummary {
|
||||
active: number;
|
||||
pending: number;
|
||||
confirmed: number;
|
||||
recovered: number;
|
||||
overSla: number;
|
||||
byRule: ReconciliationBucket[];
|
||||
bySeverity: ReconciliationBucket[];
|
||||
trend: ReconciliationTrendPoint[];
|
||||
lastRunAt: string;
|
||||
asOf: string;
|
||||
}
|
||||
|
||||
export interface MapReverseGeocode {
|
||||
provider: string;
|
||||
longitude: number;
|
||||
|
||||
Reference in New Issue
Block a user