Package uk.org.woodcraft.bookings.datamodel

Examples of uk.org.woodcraft.bookings.datamodel.Organisation


    return orgs;
  }

  public Collection<Unit> getUnitsForCurrentOrg()
  {
    Organisation currentOrg = (Organisation)getSessionObject(SessionConstants.SIGNUP_ORG);
   
    Collection<Unit> units = new ArrayList<Unit>();
    if (currentOrg != null) units = CannedQueries.unitsForOrg(currentOrg.getKey(), false, false);
    Unit userAddedUnit = (Unit)getSessionObject(SessionConstants.SIGNUP_ADDED_UNIT);
    if (userAddedUnit != null && currentOrg != null && userAddedUnit.getOrganisationKey().equals(currentOrg.getKey())) {
      units.add(userAddedUnit);
    }
    return units;
  }
View Full Code Here


    assertDetached(bookings);
  }
 
  @Test
  public void testBookingsForOrg() {
    Organisation org = CannedQueries.orgByName("Woodcraft Folk");   
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);
   
    Collection<Booking> bookings = CannedQueries.bookingsForOrg(org, event1);
    TestUtils.assertNames(bookings, "Test person", "Test person 2","Person booked after earlybird", "Test person in unit 2", "Second person in unit 2");
    assertDetached(bookings);
View Full Code Here

    if (getModel() == null)
    {
      User user = new User();
      user.setIsNew(true);
     
      Organisation selectedOrg = (Organisation)getSessionObject(SessionConstants.SIGNUP_ORG);
      if (selectedOrg != null)
        user.setOrganisationKey(selectedOrg.getKey());
     
      Unit selectedUnit = (Unit)getSessionObject(SessionConstants.SIGNUP_UNIT);
      if (selectedUnit != null)
        user.setUnitKey(selectedUnit.getKey());
     
View Full Code Here

    assertDetached(bookings);
  }
 
  @Test
  public void testBookingsForLargeOrg() {
    Organisation org = CannedQueries.orgByName("Woodcraft Folk");   
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);
   
    List<Unit> testUnits = new ArrayList<Unit>(50);
    List<Booking> testBookings = new ArrayList<Booking>(50);
    List<String> testNames = new ArrayList<String>(52);
View Full Code Here

  }
 
  @SkipValidation
  public String signupOrg() {
    if (organisationKey == null) return INPUT;
    Organisation org = CannedQueries.orgByKey(organisationKey);
    if (org == null) return INPUT;
    setSessionObject(SessionConstants.SIGNUP_ORG, org);
    return SUCCESS;
  }
View Full Code Here

    users = CannedQueries.allUnapprovedUsers();
    TestUtils.assertNames(users, "Unassigned 1");
    assertDetached(users);
   
   
    Organisation org = CannedQueries.orgByName("Woodcraft Folk");   
    users = CannedQueries.allUsersForOrg(org);
    TestUtils.assertNames(users, "Global Admin 1", "Org Admin 1", "Unit Admin 1", "Unassigned 1");
    assertDetached(users);
 
    Unit unit = CannedQueries.unitByName("Unit 1", org);   
View Full Code Here

  }
 
  @Test
  public void testTransactionsForUnit() {
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME)
    Organisation org = CannedQueries.orgByName("Woodcraft Folk")
    Unit unit = CannedQueries.unitByName("Unit 1", org);
   
    Collection<Transaction> transactions = CannedQueries.transactionsForUnit(unit, event1);
    TestUtils.assertNames(transactions, "Payment 1", "Payment 2", "Payment 3", "Refund 1", "Payment after earlybird","Discount for early payment");
  }
View Full Code Here

    TestUtils.assertNames(transactions, "Payment 1", "Payment 2", "Payment 3","Refund 1", "Payment after earlybird","Discount for early payment", "Unit 2 payment");
  }
 
  @Test
  public void testTransactionsForLargeOrg() {
    Organisation org = CannedQueries.orgByName("Woodcraft Folk");   
    Event event1 = CannedQueries.eventByName(TestConstants.EVENT1_NAME);
   
    List<Unit> testUnits = new ArrayList<Unit>(50);
    List<Transaction> testTransactions = new ArrayList<Transaction>(100);
    List<String> testTransNames = new ArrayList<String>(103);
View Full Code Here

  public void testGetByKey() {
    User user1 = CannedQueries.getByKey(User.class, "globaladmin@example.com");
    assertEquals("Global Admin 1", user1.getName());
    assertDetached(user1);
   
    Organisation org = CannedQueries.orgByName("Woodcraft Folk");   
    Organisation org2 = CannedQueries.getByKey(Organisation.class, org.getKey());
    assertEquals(org, org2);
    assertDetached(org2);
   
  }
View Full Code Here

   
    // Org queries
    CannedQueries.allOrgs(false, false);
    CannedQueries.allOrgs(true, false);
    CannedQueries.allUnapprovedOrgs();
    Organisation org1 = CannedQueries.orgByName(TestConstants.ORG1_NAME);
    @SuppressWarnings("unused")
    Organisation duplicateOrg = CannedQueries.orgByName(TestConstants.ORG1_NAME, org1.getKeyCheckNotNull());
    CannedQueries.orgByKey(org1.getKeyCheckNotNull());
   
    // Unit queries
    CannedQueries.allUnits(false, false);
View Full Code Here

TOP

Related Classes of uk.org.woodcraft.bookings.datamodel.Organisation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.