Skip to content

Commit

Permalink
#333 valid checkin from/to: add property in java model
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed Sep 21, 2017
1 parent fb41c99 commit 2b478a4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/main/java/alfio/model/FullTicketInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,17 @@ public FullTicketInfo(@Column("t_id") int id,
@Column("tc_tc_status") TicketCategory.Status tcStatus,
@Column("tc_event_id") int tcEventId,
@Column("tc_bounded") boolean bounded,
@Column("tc_category_code") String code) {
@Column("tc_category_code") String code,
@Column("tc_valid_checkin_from") ZonedDateTime validCheckInFrom,
@Column("tc_valid_checkin_to") ZonedDateTime validCheckInTo
) {

this.ticket = new Ticket(id, uuid, creation, categoryId, status, eventId, ticketsReservationId, fullName, firstName, lastName, email,
lockedAssignment, userLanguage, ticketSrcPriceCts, ticketFinalPriceCts, ticketVatCts, ticketDiscountCts);
this.ticketReservation = new TicketReservation(trId, trValidity, trStatus, trFullName, trFirstName, trLastName, trEmail, trBillingAddress,
trConfirmationTimestamp, trLatestReminder, trPaymentMethod, trReminderSent, trPromoCodeDiscountId, trAutomatic, resUserLanguage, directAssignment, invoiceNumber, invoiceModel, reservationVatStatus, vatNr, vatCountry, invoiceRequested);
this.ticketCategory = new TicketCategory(tcId, tcUtcInception, tcUtcExpiration, tcMaxTickets, tcName,
tcAccessRestricted, tcStatus, tcEventId, bounded, tcSrcPriceCts, code);
tcAccessRestricted, tcStatus, tcEventId, bounded, tcSrcPriceCts, code, validCheckInFrom, validCheckInTo);

}
}
8 changes: 7 additions & 1 deletion src/main/java/alfio/model/TicketCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public enum Status {
private final boolean bounded;
private final int srcPriceCts;
private final String code;
private final ZonedDateTime validCheckInFrom;
private final ZonedDateTime validCheckInTo;

public TicketCategory(@JsonProperty("id") @Column("id") int id,
@JsonProperty("utcInception") @Column("inception") ZonedDateTime utcInception,
Expand All @@ -58,7 +60,9 @@ public TicketCategory(@JsonProperty("id") @Column("id") int id,
@JsonProperty("eventId") @Column("event_id") int eventId,
@JsonProperty("bounded") @Column("bounded") boolean bounded,
@JsonProperty("srcPriceCts") @Column("src_price_cts") int srcPriceCts,
@JsonProperty("code") @Column("category_code") String code) {
@JsonProperty("code") @Column("category_code") String code,
@JsonProperty("validCheckInFrom") @Column("valid_checkin_from") ZonedDateTime validCheckInFrom,
@JsonProperty("validCheckInTo") @Column("valid_checkin_to") ZonedDateTime validCheckInTo) {
this.id = id;
this.utcInception = utcInception;
this.utcExpiration = utcExpiration;
Expand All @@ -70,6 +74,8 @@ public TicketCategory(@JsonProperty("id") @Column("id") int id,
this.bounded = bounded;
this.srcPriceCts = srcPriceCts;
this.code = code;
this.validCheckInFrom = validCheckInFrom;
this.validCheckInTo = validCheckInTo;
}

public BigDecimal getPrice() {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/alfio/repository/TicketRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ Integer countAllModifiedTicketsWithReservationAndTransaction(@Bind("eventId") in
" tr.confirmation_ts tr_confirmation_ts, tr.latest_reminder_ts tr_latest_reminder_ts, tr.payment_method tr_payment_method, " +
" tr.offline_payment_reminder_sent tr_offline_payment_reminder_sent, tr.promo_code_id_fk tr_promo_code_id_fk, tr.automatic tr_automatic, tr.user_language tr_user_language, tr.direct_assignment tr_direct_assignment, tr.invoice_number tr_invoice_number, tr.invoice_model tr_invoice_model, " +
" tr.vat_status tr_vat_status, tr.vat_nr tr_vat_nr, tr.vat_country tr_vat_country, tr.invoice_requested tr_invoice_requested," +
" tc.id tc_id, tc.inception tc_inception, tc.expiration tc_expiration, tc.max_tickets tc_max_tickets, tc.name tc_name, tc.src_price_cts tc_src_price_cts, tc.access_restricted tc_access_restricted, tc.tc_status tc_tc_status, tc.event_id tc_event_id, tc.bounded tc_bounded, tc.category_code tc_category_code " +
" tc.id tc_id, tc.inception tc_inception, tc.expiration tc_expiration, tc.max_tickets tc_max_tickets, tc.name tc_name, tc.src_price_cts tc_src_price_cts, tc.access_restricted tc_access_restricted, tc.tc_status tc_tc_status, tc.event_id tc_event_id, tc.bounded tc_bounded, tc.category_code tc_category_code, " +
" tc.valid_checkin_from tc_valid_checkin_from, tc.valid_checkin_to tc_valid_checkin_to " +
" from ticket t " +
" inner join tickets_reservation tr on t.tickets_reservation_id = tr.id " +
" inner join ticket_category tc on t.category_id = tc.id ";
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/alfio/util/TemplateResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public Map<String, Object> prepareSampleModel(Organization organization, Event e
TICKET_PDF("/alfio/templates/ticket.ms", true, "application/pdf", TemplateManager.TemplateOutput.HTML) {
@Override
public Map<String, Object> prepareSampleModel(Organization organization, Event event, Optional<ImageData> imageData) {
TicketCategory ticketCategory = new TicketCategory(0, ZonedDateTime.now(), ZonedDateTime.now(), 42, "Ticket", false, TicketCategory.Status.ACTIVE, event.getId(), false, 1000, null);
TicketCategory ticketCategory = new TicketCategory(0, ZonedDateTime.now(), ZonedDateTime.now(), 42, "Ticket", false, TicketCategory.Status.ACTIVE, event.getId(), false, 1000, null, null, null);
return buildModelForTicketPDF(organization, event, sampleTicketReservation(), ticketCategory, sampleTicket(), imageData, "ABCD");
}
},
Expand Down

0 comments on commit 2b478a4

Please sign in to comment.