use of alfio.model.Audit.EventType in project alf.io by alfio-event.
the class EuVatChecker method logSuccessfulValidation.
public void logSuccessfulValidation(VatDetail detail, String reservationId, PurchaseContext purchaseContext) {
List<Map<String, Object>> modifications = List.of(Map.of("vatNumber", detail.getVatNr(), "country", detail.getCountry(), "validationType", detail.getType()));
Audit.EventType eventType = null;
switch(detail.getType()) {
case VIES:
case EXTRA_EU:
eventType = VAT_VALIDATION_SUCCESSFUL;
break;
case SKIPPED:
eventType = VAT_VALIDATION_SKIPPED;
break;
case FORMAL:
eventType = VAT_FORMAL_VALIDATION_SUCCESSFUL;
break;
}
auditingRepository.insert(reservationId, null, purchaseContext, eventType, new Date(), RESERVATION, reservationId, modifications);
}
Aggregations