use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithWeeklyMeetingNoFeesThirdAndFourthDatesInMoratorium.
@Ignore
@Test
public void createCenterScheduleWithWeeklyMeetingNoFeesThirdAndFourthDatesInMoratorium() throws Exception {
DateTime startDate = date(2010, 4, 5);
//Monday
DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
// setup
saveHoliday(startDate.plusWeeks(2), startDate.plusWeeks(3).plusDays(4), RepaymentRuleTypes.REPAYMENT_MORATORIUM);
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);
validateDates(center.getGlobalCustNum(), startDate, startDate.plusWeeks(1), startDate.plusWeeks(4), startDate.plusWeeks(5), startDate.plusWeeks(6), startDate.plusWeeks(7), startDate.plusWeeks(8), startDate.plusWeeks(9), startDate.plusWeeks(10), startDate.plusWeeks(11));
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithWeeklyMeetingWithOnePeriodicFeeAndOneTimeFeeWithThirdAndFourthMeetingsInMoratorium.
@Ignore
@Test
public void createCenterScheduleWithWeeklyMeetingWithOnePeriodicFeeAndOneTimeFeeWithThirdAndFourthMeetingsInMoratorium() 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);
saveHoliday(startDate.plusWeeks(2), startDate.plusWeeks(3).plusDays(4), RepaymentRuleTypes.REPAYMENT_MORATORIUM);
StaticHibernateUtil.flushSession();
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(4), startDate.plusWeeks(5), startDate.plusWeeks(6), startDate.plusWeeks(7), startDate.plusWeeks(8), startDate.plusWeeks(9), startDate.plusWeeks(10), startDate.plusWeeks(11));
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);
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithBiWeeklyMeetingNoFeesNoHoliday.
/***********************************************
* Biweekly meeting, no fees
***********************************************/
@Ignore
@Test
public void createCenterScheduleWithBiWeeklyMeetingNoFeesNoHoliday() throws Exception {
DateTime startDate = date(2010, 4, 5);
//Monday
DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
// setup
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.plusWeeks(1), startDate.plusWeeks(3), startDate.plusWeeks(5), startDate.plusWeeks(7), startDate.plusWeeks(9), startDate.plusWeeks(11), startDate.plusWeeks(13), startDate.plusWeeks(15), startDate.plusWeeks(17), startDate.plusWeeks(19));
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithWeeklyMeetingWithOnePeriodicFeeAndOneTimeFeeWithFirstMeetingInMoratorium.
@Test
public void createCenterScheduleWithWeeklyMeetingWithOnePeriodicFeeAndOneTimeFeeWithFirstMeetingInMoratorium() throws Exception {
DateTime today = date(2010, 4, 5);
//Today is a Monday
DateTimeUtils.setCurrentMillisFixed(today.getMillis());
// Start tomorrow, Tuesday
DateTime tomorrow = today.plusDays(1);
// setup
MeetingBO weeklyMeeting = new MeetingBuilder().customerMeeting().weekly().every(1).startingFrom(tomorrow.toDate()).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);
// Declare a one-day moratorium on the first meeting day
saveHoliday(tomorrow, tomorrow, RepaymentRuleTypes.REPAYMENT_MORATORIUM);
CenterBO center = new CenterBuilder().with(weeklyMeeting).withName("Center-IntegrationTest").with(sampleBranchOffice()).withLoanOfficer(testUser()).withUserContext().active().withActivationDate(tomorrow).build();
// exercise test
IntegrationTestObjectMother.createCenter(center, weeklyMeeting, weeklyPeriodicFeeForCenterOnly, oneTimeFeeForCenterOnly);
// verification
StaticHibernateUtil.flushAndClearSession();
validateDates(center.getGlobalCustNum(), today.plusWeeks(1), today.plusWeeks(2), today.plusWeeks(3), today.plusWeeks(4), today.plusWeeks(5), today.plusWeeks(6), today.plusWeeks(7), today.plusWeeks(8), today.plusWeeks(9), today.plusWeeks(10));
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);
}
use of org.mifos.domain.builders.MeetingBuilder in project head by mifos.
the class CenterScheduleCreationUsingCustomerServiceIntegrationTest method createCenterScheduleWithWeeklyMeetingNoFeesThirdAndFourthDatesInSameDayHoliday.
@Test
public void createCenterScheduleWithWeeklyMeetingNoFeesThirdAndFourthDatesInSameDayHoliday() throws Exception {
DateTime startDate = date(2010, 4, 5);
//Monday
DateTimeUtils.setCurrentMillisFixed(startDate.getMillis());
// setup
saveHoliday(startDate.plusWeeks(2), startDate.plusWeeks(2).plusDays(3), RepaymentRuleTypes.SAME_DAY);
saveHoliday(startDate.plusWeeks(3), startDate.plusWeeks(3).plusDays(3), RepaymentRuleTypes.SAME_DAY);
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);
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));
}
Aggregations