Search in sources :

Example 1 with LocationDescriptor

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);
}
Also used : Organization(alfio.model.user.Organization) DateTimeModification(alfio.model.modification.DateTimeModification) LocationDescriptor(alfio.model.modification.support.LocationDescriptor) TicketCategoryModification(alfio.model.modification.TicketCategoryModification) EventModification(alfio.model.modification.EventModification) Before(org.junit.Before)

Example 2 with LocationDescriptor

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);
}
Also used : LocalDateTime(java.time.LocalDateTime) Organization(alfio.model.user.Organization) DateTimeModification(alfio.model.modification.DateTimeModification) LocationDescriptor(alfio.model.modification.support.LocationDescriptor) EventModification(alfio.model.modification.EventModification) Event(alfio.model.Event)

Example 3 with LocationDescriptor

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);
}
Also used : Organization(alfio.model.user.Organization) LocationDescriptor(alfio.model.modification.support.LocationDescriptor)

Aggregations

LocationDescriptor (alfio.model.modification.support.LocationDescriptor)3 Organization (alfio.model.user.Organization)3 DateTimeModification (alfio.model.modification.DateTimeModification)2 EventModification (alfio.model.modification.EventModification)2 Event (alfio.model.Event)1 TicketCategoryModification (alfio.model.modification.TicketCategoryModification)1 LocalDateTime (java.time.LocalDateTime)1 Before (org.junit.Before)1