-
-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added voucher code #1451
base: main
Are you sure you want to change the base?
Added voucher code #1451
Conversation
@syjer Any clues as to why the 'Upload to Sonar' build step is failing? |
Hi @cbellone any clues as to why the 'Upload to Sonar' build step is failing? |
@@ -357,7 +357,7 @@ public ResponseEntity<String> rearrangeCategories(@PathVariable String eventName | |||
|
|||
private static final String PAYMENT_METHOD = "Payment Method"; | |||
private static final String EXTERNAL_REFERENCE = "External Reference"; | |||
static final List<String> FIXED_FIELDS = Arrays.asList("ID", "Category", "Event", "Status", "OriginalPrice", "PaidPrice", "Discount", "VAT", "ReservationID", "Full Name", "First Name", "Last Name", "E-Mail", "Locked", "Language", "Confirmation", "Billing Address", "Country Code", "Payment ID", PAYMENT_METHOD, EXTERNAL_REFERENCE); | |||
static final List<String> FIXED_FIELDS = Arrays.asList("ID", "Category", "Event", "Status", "OriginalPrice", "PaidPrice", "Discount", "VAT", "ReservationID", "Full Name", "First Name", "Last Name", "E-Mail", "Locked", "Language", "Confirmation", "Billing Address", "Country Code", "Voucher Code" ,"Payment ID", PAYMENT_METHOD, EXTERNAL_REFERENCE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with the labels we use in the application, "Voucher code" must be renamed to "Promo Code"
@@ -429,6 +429,7 @@ private Stream<String[]> exportLines(String eventName, Principal principal, List | |||
if(fields.contains("Confirmation")) {line.add(reservation.getConfirmationTimestamp().withZoneSameInstant(eventZoneId).toString());} | |||
if(fields.contains("Billing Address")) {line.add(reservation.getBillingAddress());} | |||
if(fields.contains("Country Code")) {line.add(reservation.getVatCountryCode());} | |||
if(fields.contains("Voucher Code")) {line.add(trs.getPromoCode());} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
update tickets_reservation set promo_code_id_fk = :promotionCodeDiscountId\ | ||
where email_address = :email | ||
""") | ||
int setPromotionCodeDiscountId(@Bind("email") String email, @Bind("promotionCodeDiscountId") Integer promotionCodeDiscountId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this query is only used by the integration test. Please remove it from the repository and run it directly in the test
promoCodeDiscountRepository.addPromoCode(TEST_PROMO_CODE, eventId, organizationId, ZonedDateTime.now(), ZonedDateTime.now() | ||
.plusDays(3), 10, PromoCodeDiscount.DiscountType.FIXED_AMOUNT, "[1,2,3]", 1, "test promo code", "[email protected]", PromoCodeDiscount.CodeType.DISCOUNT, 21, "usd"); | ||
var promoCodeId = promoCodeDiscountRepository.findAllInEvent(eventId).get(0).getId(); | ||
ticketReservationRepository.setPromotionCodeDiscountId(email, promoCodeId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above. You can run this update using NamedParameterJdbcTemplate. See for example DemoModeDataManagerIntegrationTest
Hi @sergyer , sonar integration is currently not working for PRs coming from forked repos. Since your PR does not contain much code, we can evaluate its security implications by ourselves; I don't see any security issues being introduced. |
Added voucher code in attendees data. #1125