use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class SavingsScheduleIntegrationTest method createClientSavingsAccount.
public void createClientSavingsAccount() throws Exception {
meeting = new MeetingBuilder().customerMeeting().weekly().every(1).withStartDate(expectedFirstDepositDate).build();
IntegrationTestObjectMother.saveMeeting(meeting);
center = new CenterBuilder().with(meeting).withName("Center").with(sampleBranchOffice()).withLoanOfficer(testUser()).build();
IntegrationTestObjectMother.createCenter(center, meeting);
group = new GroupBuilder().withMeeting(meeting).withName("Group").withOffice(sampleBranchOffice()).withLoanOfficer(testUser()).withParentCustomer(center).build();
IntegrationTestObjectMother.createGroup(group, meeting);
client = new ClientBuilder().withMeeting(meeting).withName("Client 1").withOffice(sampleBranchOffice()).withLoanOfficer(testUser()).withParentCustomer(group).buildForIntegrationTests();
IntegrationTestObjectMother.createClient(client, meeting);
savingsProduct = new SavingsProductBuilder().mandatory().appliesToClientsOnly().buildForIntegrationTests();
HolidayDao holidayDao = ApplicationContextProvider.getBean(HolidayDao.class);
List<Holiday> holidays = holidayDao.findAllHolidaysThisYearAndNext(client.getOfficeId());
savingsAccount = new SavingsAccountBuilder().withSavingsProduct(savingsProduct).withCustomer(client).with(holidays).build();
IntegrationTestObjectMother.saveSavingsProductAndAssociatedSavingsAccounts(savingsProduct, savingsAccount);
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class SavingsBOMoreIntegrationTest method cleanDatabaseTables.
@Before
public void cleanDatabaseTables() throws Exception {
databaseCleaner.clean();
MeetingBO weeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
IntegrationTestObjectMother.saveMeeting(weeklyMeeting);
center = new CenterBuilder().with(weeklyMeeting).withName("Savings Center").with(sampleBranchOffice()).withLoanOfficer(testUser()).build();
IntegrationTestObjectMother.createCenter(center, weeklyMeeting);
group = new GroupBuilder().withMeeting(weeklyMeeting).withName("Savings Group").withOffice(sampleBranchOffice()).withLoanOfficer(testUser()).withParentCustomer(center).build();
IntegrationTestObjectMother.createGroup(group, weeklyMeeting);
client = new ClientBuilder().withMeeting(weeklyMeeting).withName("Savings Client").withOffice(sampleBranchOffice()).withLoanOfficer(testUser()).withParentCustomer(group).buildForIntegrationTests();
IntegrationTestObjectMother.createClient(client, weeklyMeeting);
String recommendedAmountString = "3.0";
recommendedAmount = new Money(Money.getDefaultCurrency(), recommendedAmountString);
savings = new TestCollectionSheetRetrieveSavingsAccountsUtils().createSavingsAccount(client, "clm", recommendedAmountString, false, false);
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithWeeklyMeetingNoFeesThirdDateInNextMeetingHoliday.
@Ignore
@Test
public void createCenterScheduleWithWeeklyMeetingNoFeesThirdDateInNextMeetingHoliday() throws Exception {
DateTime startDate = date(2010, 4, 5);
//Monday
DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
// setup
saveHoliday(date(2010, 4, 19), date(2010, 4, 23), RepaymentRuleTypes.NEXT_MEETING_OR_REPAYMENT);
StaticHibernateUtil.flushSession();
MeetingBO weeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
CenterBO center = new CenterBuilder().with(weeklyMeeting).withName("Center-IntegrationTest").with(sampleBranchOffice()).withLoanOfficer(testUser()).withUserContext().build();
List<AccountFeesEntity> noAccountFees = new ArrayList<AccountFeesEntity>();
// exercise test
customerService.createCenter(center, weeklyMeeting, noAccountFees);
StaticHibernateUtil.flushSession();
validateDates(center.getGlobalCustNum(), startDate, startDate.plusWeeks(1), startDate.plusWeeks(3), startDate.plusWeeks(3), startDate.plusWeeks(4), startDate.plusWeeks(5), startDate.plusWeeks(6), startDate.plusWeeks(7), startDate.plusWeeks(8), startDate.plusWeeks(9));
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithBiWeeklyMeetingNoFeesThirdAndFifthDatesInMoratorium.
@Ignore
@Test
public void createCenterScheduleWithBiWeeklyMeetingNoFeesThirdAndFifthDatesInMoratorium() throws Exception {
DateTime startDate = date(2010, 4, 5);
//Monday
DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
// setup
saveHoliday(startDate.plusWeeks(4), startDate.plusWeeks(4).plusDays(3), RepaymentRuleTypes.REPAYMENT_MORATORIUM);
saveHoliday(startDate.plusWeeks(8), startDate.plusWeeks(8).plusDays(3), RepaymentRuleTypes.REPAYMENT_MORATORIUM);
StaticHibernateUtil.flushSession();
MeetingBO biWeeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(2).startingToday().build();
CenterBO center = new CenterBuilder().with(biWeeklyMeeting).withName("Center-IntegrationTest").with(sampleBranchOffice()).withLoanOfficer(testUser()).withUserContext().build();
// exercise test
customerService.createCenter(center, biWeeklyMeeting, new ArrayList<AccountFeesEntity>());
// verification
validateDates(center.getGlobalCustNum(), startDate, startDate.plusWeeks(2), startDate.plusWeeks(6), startDate.plusWeeks(10), startDate.plusWeeks(12), startDate.plusWeeks(14), startDate.plusWeeks(16), startDate.plusWeeks(18), startDate.plusWeeks(20), startDate.plusWeeks(22));
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithWeeklyMeetingWithOnePeriodicFeeAndOneTimeFeeNoHoliday.
@Test
public void createCenterScheduleWithWeeklyMeetingWithOnePeriodicFeeAndOneTimeFeeNoHoliday() throws Exception {
DateTime startDate = date(2010, 4, 5);
//Monday
DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
// setup
MeetingBO weeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingToday().build();
MeetingBuilder weeklyMeetingForFees = new MeetingBuilder().periodicFeeMeeting().weekly().every(1).startingToday();
AmountFeeBO weeklyPeriodicFeeForCenterOnly = new FeeBuilder().appliesToCenterOnly().withFeeAmount("100.0").withName("Center Weekly Periodic Fee").with(weeklyMeetingForFees).with(sampleBranchOffice()).build();
IntegrationTestObjectMother.saveFee(weeklyPeriodicFeeForCenterOnly);
AmountFeeBO oneTimeFeeForCenterOnly = new FeeBuilder().appliesToCenterOnly().withFeeAmount("25.0").withName("Center UpfrontFee").oneTime().build();
IntegrationTestObjectMother.saveFee(oneTimeFeeForCenterOnly);
CenterBO center = new CenterBuilder().with(weeklyMeeting).withName("Center-IntegrationTest").with(sampleBranchOffice()).withLoanOfficer(testUser()).withUserContext().build();
// exercise test
IntegrationTestObjectMother.createCenter(center, weeklyMeeting, weeklyPeriodicFeeForCenterOnly, oneTimeFeeForCenterOnly);
// verification
StaticHibernateUtil.flushAndClearSession();
validateDates(center.getGlobalCustNum(), startDate, startDate.plusWeeks(1), startDate.plusWeeks(2), startDate.plusWeeks(3), startDate.plusWeeks(4), startDate.plusWeeks(5), startDate.plusWeeks(6), startDate.plusWeeks(7), startDate.plusWeeks(8), startDate.plusWeeks(9));
validateOnePeriodicFeeAndOneOneTimeFee(center.getGlobalCustNum(), "Center Weekly Periodic Fee", "Center UpfrontFee", 25.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0);
}
Aggregations