use of alfio.model.modification.support.LocationDescriptor in project alf.io by alfio-event.
the class ConfigurationManagerIntegrationTest method prepareEnv.
@Before
public void prepareEnv() {
// setup...
organizationRepository.create("org", "org", "email@example.com");
Organization organization = organizationRepository.findByName("org").get();
userManager.insertUser(organization.getId(), USERNAME, "test", "test", "test@example.com", Role.OWNER, User.Type.INTERNAL);
Map<String, String> desc = new HashMap<>();
desc.put("en", "muh description");
desc.put("it", "muh description");
desc.put("de", "muh description");
List<TicketCategoryModification> ticketsCategory = Collections.singletonList(new TicketCategoryModification(null, "default", 20, new DateTimeModification(LocalDate.now(), LocalTime.now()), new DateTimeModification(LocalDate.now(), LocalTime.now()), Collections.singletonMap("en", "desc"), BigDecimal.TEN, false, "", false, null, null, null, null, null));
EventModification em = new EventModification(null, Event.EventType.INTERNAL, "url", "url", "url", null, null, "eventShortName", "displayName", organization.getId(), "muh location", "0.0", "0.0", ZoneId.systemDefault().getId(), desc, new DateTimeModification(LocalDate.now(), LocalTime.now()), new DateTimeModification(LocalDate.now(), LocalTime.now()), BigDecimal.TEN, "CHF", 20, BigDecimal.ONE, true, null, ticketsCategory, false, new LocationDescriptor("", "", "", ""), 7, null, null);
eventManager.createEvent(em);
event = eventManager.getSingleEvent("eventShortName", "test");
ticketCategory = ticketCategoryRepository.findAllTicketCategories(event.getId()).get(0);
}
use of alfio.model.modification.support.LocationDescriptor in project alf.io by alfio-event.
the class IntegrationTestUtil method initEvent.
public static Pair<Event, String> initEvent(List<TicketCategoryModification> categories, OrganizationRepository organizationRepository, UserManager userManager, EventManager eventManager, EventRepository eventRepository, List<EventModification.AdditionalService> additionalServices) {
String organizationName = UUID.randomUUID().toString();
String username = UUID.randomUUID().toString();
String eventName = UUID.randomUUID().toString();
userManager.createOrganization(organizationName, "org", "email@example.com");
Organization organization = organizationRepository.findByName(organizationName).get();
userManager.insertUser(organization.getId(), username, "test", "test", "test@example.com", Role.OPERATOR, User.Type.INTERNAL);
userManager.insertUser(organization.getId(), username + "_owner", "test", "test", "test@example.com", Role.OWNER, User.Type.INTERNAL);
LocalDateTime expiration = LocalDateTime.now().plusDays(5).plusHours(1);
Map<String, String> desc = new HashMap<>();
desc.put("en", "muh description");
desc.put("it", "muh description");
desc.put("de", "muh description");
EventModification em = new EventModification(null, Event.EventType.INTERNAL, "url", "url", "url", "url", null, eventName, "event display name", organization.getId(), "muh location", "0.0", "0.0", ZoneId.systemDefault().getId(), desc, new DateTimeModification(LocalDate.now().plusDays(5), LocalTime.now()), new DateTimeModification(expiration.toLocalDate(), expiration.toLocalTime()), BigDecimal.TEN, "CHF", AVAILABLE_SEATS, BigDecimal.ONE, true, Collections.singletonList(PaymentProxy.OFFLINE), categories, false, new LocationDescriptor("", "", "", ""), 7, null, additionalServices);
eventManager.createEvent(em);
Event event = eventManager.getSingleEvent(eventName, username);
Assert.assertEquals(AVAILABLE_SEATS, eventRepository.countExistingTickets(event.getId()).intValue());
return Pair.of(event, username);
}
use of alfio.model.modification.support.LocationDescriptor in project alf.io by alfio-event.
the class DataMigratorIntegrationTest method initEvent.
private Pair<Event, String> initEvent(List<TicketCategoryModification> categories, String displayName) {
String organizationName = UUID.randomUUID().toString();
String username = UUID.randomUUID().toString();
String eventName = UUID.randomUUID().toString();
organizationRepository.create(organizationName, "org", "email@example.com");
Organization organization = organizationRepository.findByName(organizationName).get();
userManager.insertUser(organization.getId(), username, "test", "test", "test@example.com", Role.OPERATOR, User.Type.INTERNAL);
Map<String, String> desc = new HashMap<>();
desc.put("en", "muh description");
desc.put("it", "muh description");
desc.put("de", "muh description");
EventModification em = new EventModification(null, Event.EventType.INTERNAL, "url", "url", "url", null, null, eventName, displayName, organization.getId(), "muh location", "0.0", "0.0", ZoneId.systemDefault().getId(), desc, new DateTimeModification(LocalDate.now().plusDays(5), LocalTime.now()), new DateTimeModification(LocalDate.now().plusDays(5), LocalTime.now().plusHours(1)), BigDecimal.TEN, "CHF", AVAILABLE_SEATS, BigDecimal.ONE, true, null, categories, false, new LocationDescriptor("", "", "", ""), 7, null, null);
eventManager.createEvent(em);
return Pair.of(eventManager.getSingleEvent(eventName, username), username);
}
Aggregations