Skip to content

Commit

Permalink
add bulk scan
Browse files Browse the repository at this point in the history
(cherry picked from commit e6422ee)
  • Loading branch information
cbellone committed Apr 6, 2016
1 parent 5382f86 commit 58c8384
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/main/java/alfio/controller/api/AttendeeApiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

@RestController
@RequestMapping("/api/attendees")
Expand Down Expand Up @@ -71,6 +72,14 @@ public ResponseEntity<TicketAndCheckInResult> scanBadge(@RequestBody SponsorScan
return ResponseEntity.ok(attendeeManager.registerSponsorScan(request.eventName, request.ticketIdentifier, principal.getName()));
}

@RequestMapping(value = "/sponsor-scan/bulk", method = RequestMethod.POST)
public ResponseEntity<List<TicketAndCheckInResult>> scanBadges(@RequestBody List<SponsorScanRequest> requests, Principal principal) {
String username = principal.getName();
return ResponseEntity.ok(requests.stream()
.map(request -> attendeeManager.registerSponsorScan(request.eventName, request.ticketIdentifier, username))
.collect(Collectors.toList()));
}

@RequestMapping(value = "/{eventKey}/sponsor-scan/mine", method = RequestMethod.GET)
public ResponseEntity<List<SponsorAttendeeData>> getScannedBadges(@PathVariable("eventKey") String eventShortName, @RequestParam(value = "from", required = false) String from, Principal principal) {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/alfio/model/system/ConfigurationKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public enum ConfigurationKeys {
STRIPE_PUBLIC_KEY("Stripe's public key", false, SettingCategory.PAYMENT, ComponentType.TEXT, false, EnumSet.of(SYSTEM)),

SPECIAL_PRICE_CODE_LENGTH("Length of special price code", false, SettingCategory.GENERAL, ComponentType.TEXT, false, EnumSet.of(SYSTEM)),
MAX_AMOUNT_OF_TICKETS_BY_RESERVATION("Max amount of tickets", false, SettingCategory.GENERAL, ComponentType.TEXT, false, EnumSet.of(SYSTEM, ORGANIZATION, EVENT, TICKET_CATEGORY)),
MAX_AMOUNT_OF_TICKETS_BY_RESERVATION("How many tickets can be purchased in a single reservation (default 5)", false, SettingCategory.GENERAL, ComponentType.TEXT, false, EnumSet.of(SYSTEM, ORGANIZATION, EVENT, TICKET_CATEGORY)),
ASSIGNMENT_REMINDER_START("How many days before the event should be sent a reminder to the users about Tickets assignment? (default: 10 days)", false, SettingCategory.GENERAL, ComponentType.TEXT, false, EnumSet.of(SYSTEM, ORGANIZATION, EVENT)),
ASSIGNMENT_REMINDER_INTERVAL("How long should be the 'quiet period' (in days) between the reminders? (default: 3 days)", false, SettingCategory.GENERAL, ComponentType.TEXT, false, EnumSet.of(SYSTEM, ORGANIZATION, EVENT)),
RESERVATION_TIMEOUT("The amount of time, in MINUTES, that the user have to complete the reservation process (default: 25 min)", false, SettingCategory.GENERAL, ComponentType.TEXT, false, EnumSet.of(SYSTEM, ORGANIZATION, EVENT)),
Expand Down

0 comments on commit 58c8384

Please sign in to comment.