Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

sergyer
Copy link
Contributor

@sergyer sergyer commented Jan 30, 2025

Added voucher code in attendees data. #1125

@sergyer
Copy link
Contributor Author

sergyer commented Jan 31, 2025

@syjer Any clues as to why the 'Upload to Sonar' build step is failing?

@sergyer
Copy link
Contributor Author

sergyer commented Feb 7, 2025

Hi @cbellone any clues as to why the 'Upload to Sonar' build step is failing?

@cbellone cbellone requested review from syjer and cbellone February 8, 2025 08:55
@@ -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);
Copy link
Member

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());}
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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

@cbellone
Copy link
Member

cbellone commented Feb 8, 2025

Hi @sergyer , sonar integration is currently not working for PRs coming from forked repos.
We'll fix that asap.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants