Skip to content

Commit

Permalink
default to OPTIONAL_UNLIMITED_AMOUNT when supplement policy is null (…
Browse files Browse the repository at this point in the history
…i.e. when copying from a past event)
  • Loading branch information
cbellone committed Jan 8, 2025
1 parent 4e6977d commit b4a52f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/alfio/manager/AdditionalServiceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public EventModification.AdditionalService insertAdditionalService(Event event,
additionalService.getVat(),
additionalService.getVatType(),
additionalService.getType(),
additionalService.getSupplementPolicy(),
Objects.requireNonNullElse(additionalService.getSupplementPolicy(), OPTIONAL_UNLIMITED_AMOUNT),
additionalService.getMinPrice() != null ? MonetaryUtil.unitToCents(additionalService.getMinPrice(), event.getCurrency()) : null,
additionalService.getMaxPrice() != null ? MonetaryUtil.unitToCents(additionalService.getMaxPrice(), event.getCurrency()) : null);
Validate.isTrue(result.getAffectedRowCount() == 1, "too many records updated");
Expand Down

0 comments on commit b4a52f4

Please sign in to comment.