feat(platform): expose multi-source vehicle evidence

This commit is contained in:
lingniu
2026-07-16 16:35:04 +08:00
parent 196cfa018f
commit 17c4591040
21 changed files with 1129 additions and 11 deletions

View File

@@ -56,6 +56,7 @@ import type {
VehicleIdentityResolution,
VehicleServiceOverview,
VehicleServiceSummary,
VehicleSourceEvidence,
VehicleRow
} from './types';
import { getAccessToken, notifyUnauthorizedSession } from '../v2/auth/session';
@@ -242,6 +243,12 @@ export const api = {
vehicleDetail: (params = new URLSearchParams(), signal?: AbortSignal) => request<VehicleDetail>(`/api/vehicle-service?${params.toString()}`, withSignal(undefined, signal)),
vehicleProfile: (vin: string) => request<VehicleProfile>(`/api/v2/vehicles/${encodeURIComponent(vin)}/profile`),
latestTelemetry: (vin: string, signal?: AbortSignal) => request<LatestTelemetryResponse>(`/api/v2/vehicles/${encodeURIComponent(vin)}/telemetry/latest`, withSignal(undefined, signal)),
vehicleSourceEvidence: (vin: string, date?: string, signal?: AbortSignal) => {
const params = new URLSearchParams();
if (date) params.set('date', date);
const suffix = params.toString() ? `?${params.toString()}` : '';
return request<VehicleSourceEvidence>(`/api/v2/vehicles/${encodeURIComponent(vin)}/source-evidence${suffix}`, withSignal(undefined, signal));
},
updateVehicleProfile: (vin: string, input: VehicleProfileInput) => request<VehicleProfile>(`/api/v2/vehicles/${encodeURIComponent(vin)}/profile`, {
method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(input)
}),

View File

@@ -502,6 +502,67 @@ export interface VehicleSourceConsistency {
detail: string;
}
export interface VehicleSourceEvidence {
vin: string;
plate: string;
mileageDate: string;
recommendedLocationProtocol: string;
recommendedLocationLabel: string;
locationConflict: boolean;
conflictDistanceM?: number;
locationSources: VehicleLocationSourceEvidence[];
mileageSources: VehicleMileageSourceEvidence[];
comparison: VehicleSourceEvidenceComparison;
asOf: string;
}
export interface VehicleLocationSourceEvidence {
protocol: string;
sourceLabel: string;
terminalLabel: string;
sourceKind: string;
selectedWithinProtocol: boolean;
recommended: boolean;
enabled: boolean;
priority: number;
online: boolean;
qualityStatus: string;
qualityReason: string;
longitude?: number;
latitude?: number;
speedKmh?: number;
totalMileageKm?: number;
socPercent?: number;
eventTime: string;
receivedAt: string;
}
export interface VehicleMileageSourceEvidence {
protocol: string;
sourceLabel: string;
terminalLabel: string;
sourceKind: string;
selectedWithinProtocol: boolean;
recommended: boolean;
enabled: boolean;
priority: number;
qualityStatus: string;
qualityReason: string;
firstTotalMileageKm?: number;
latestTotalMileageKm?: number;
dailyMileageKm?: number;
sampleCount: number;
firstEventTime: string;
latestEventTime: string;
}
export interface VehicleSourceEvidenceComparison {
locationMaxDistanceM: number;
totalMileageDeltaKm: number;
dailyMileageDeltaKm: number;
reportTimeDeltaSeconds: number;
}
export interface VehicleServiceOverview {
vin: string;
plate: string;