feat(platform): include identity resolution in vehicle detail

This commit is contained in:
lingniu
2026-07-04 01:09:35 +08:00
parent 703a7b112f
commit beb5034b9b
5 changed files with 84 additions and 61 deletions

View File

@@ -75,6 +75,18 @@ func TestHandlerVehicleDetailResolvesPlateToVIN(t *testing.T) {
if !strings.Contains(rec.Body.String(), `"vin":"LB9A32A24R0LS1426"`) {
t.Fatalf("response should resolve plate to VIN: %s", rec.Body.String())
}
var body struct {
Data VehicleDetail `json:"data"`
}
if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil {
t.Fatalf("response JSON should decode: %v body=%s", err, rec.Body.String())
}
if body.Data.Resolution == nil || !body.Data.Resolution.Resolved || body.Data.Resolution.VIN != "LB9A32A24R0LS1426" {
t.Fatalf("vehicle detail should include canonical identity resolution, got %+v body=%s", body.Data.Resolution, rec.Body.String())
}
if len(body.Data.Resolution.Protocols) < 2 {
t.Fatalf("vehicle detail resolution should include source protocols, got %+v", body.Data.Resolution.Protocols)
}
}
func TestHandlerVehicleDetailAcceptsKeyword(t *testing.T) {