Skip to content

Commit 2cc68d4

Browse files
committed
add validation on decode from new providers
1 parent 2b332dd commit 2cc68d4

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

internal/core/services/vin_decoding_service.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ func (c vinDecodingService) GetVIN(ctx context.Context, vin string, provider cor
148148
MetaData: null.JSONFrom(raw),
149149
Raw: raw,
150150
}
151+
err = validateVinDecoding(result)
152+
if err != nil {
153+
errFinal = err
154+
continue
155+
}
151156
return result, nil
152157
case coremodels.CarVXVIN:
153158
info, raw, err := c.carvxAPI.GetVINInfo(vin)
@@ -168,6 +173,11 @@ func (c vinDecodingService) GetVIN(ctx context.Context, vin string, provider cor
168173
Raw: raw,
169174
FuelType: info.Data[0].Fuel,
170175
}
176+
err = validateVinDecoding(result)
177+
if err != nil {
178+
errFinal = err
179+
continue
180+
}
171181
return result, nil
172182
case coremodels.AutoIsoProvider:
173183
vinAutoIsoInfo, err := c.autoIsoAPIService.GetVIN(vin)

0 commit comments

Comments
 (0)