Package uk.org.woodcraft.bookings.datamodel

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


    List<Booking> testBookings = new ArrayList<Booking>(50);
    List<String> testNames = new ArrayList<String>(52);
    TestClock clock = new TestClock(TestConstants.DATE_BEFORE_DEADLINE);
   
    for (int i = 0; i < 50; i++) {
      Unit testUnit = new Unit("Test Unit "+i, org, true);
      testUnits.add(testUnit);
    }
    CannedQueries.save(testUnits);
   
    int unitNumber = 0;
View Full Code Here


    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);   
    users = CannedQueries.allUsersForUnit(unit);
    TestUtils.assertNames(users, "Global Admin 1", "Org Admin 1", "Unit Admin 1");
    assertDetached(users);
  }
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

    List<Transaction> testTransactions = new ArrayList<Transaction>(100);
    List<String> testTransNames = new ArrayList<String>(103);
    TestClock clock = new TestClock(TestConstants.DATE_BEFORE_DEADLINE);
   
    for (int i = 0; i < 50; i++) {
      Unit testUnit = new Unit("Test Unit "+i, org, true);
      testUnits.add(testUnit);
    }
    CannedQueries.save(testUnits);
   
    int transNumber = 0;
View Full Code Here

   
    // Unit queries
    CannedQueries.allUnits(false, false);
    CannedQueries.allUnits(true, false);
    CannedQueries.allUnapprovedUnits();
    Unit unit1 = CannedQueries.unitByName(TestConstants.UNIT1_NAME, org1);
    @SuppressWarnings("unused")
    Unit duplicateUnit = CannedQueries.unitByName(TestConstants.UNIT1_NAME, org1.getKeyCheckNotNull(), unit1.getKey());
    CannedQueries.unitByKey(unit1.getKeyCheckNotNull());
    CannedQueries.unitsForOrg(org1.getKeyCheckNotNull(), false, false);
    CannedQueries.unitsForOrg(org1.getKeyCheckNotNull(), true, false);
    CannedQueries.unitsHomeless(event1);
View Full Code Here

  }
 
  @SkipValidation
  public String listForUnit() {
   
    Unit unit = SessionUtils.getCurrentUnit();
   
    SecurityModel.checkAllowed(Operation.READ, unit);
    setModelList(filterSystemUsers(CannedQueries.allUsersForUnit(unit)));
    return SUCCESS;
  }
View Full Code Here

      User user = new User();
      user.setIsNew(true);
   
      // Take the defaults from the current session
     
      Unit userAddedUnit = (Unit)getSessionObject(SessionConstants.CURRENT_UNIT);
      if (userAddedUnit != null) {
        // use the org of the unit if possible so we get consistency
        user.setOrganisationKey(userAddedUnit.getOrganisationKey());
        user.setUnitKey(userAddedUnit.getKey());
        return;
      }
    }
  }
View Full Code Here

  }

  public Collection<Unit> getAllUnits()
  {
    Collection<Unit> units = CannedQueries.allUnits(true, false);
    Unit userAddedUnit = (Unit)getSessionObject(SessionConstants.SIGNUP_ADDED_UNIT);
    if (userAddedUnit != null) {
      units.add(userAddedUnit);
    }
    return units;
  }
View Full Code Here

TOP

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

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.