I'm looking into issue 1512, the equals/hashCode issue identified from findbug.
To ensure I understand the business requirement / data model, could
someone clarify whether the following is true or not?
1. For each loan product, it may be associated with multiple fees. (I
guess fees the product could apply)
2. However, each loan product will be associated with the same fee at
most once. In other words, in mysql,
table prd_offering_fees should have a unique constraint on
(prd_offering_id, fee_id)
You can also see the attached patch on LoanOfferingBOTest that
reflects the above assumption. Or you can see the actual test right
below (rather than going through the patching).
- sam
A new test method in LoanOfferingBOTest.java (equivalent to the attached patch)
public void testBuildloanOfferingWithDuplicateFeeXXX() throws SystemException,
ApplicationException {
createIntitalObjects();
Date startDate = offSetCurrentDate(0);
LoanOfferingBO loanOffering = new LoanOfferingBO(TestObjectFactory
.getContext(), "Loan Offering", "LOAN", productCategory,
prdApplicableMaster, startDate, interestTypes,
new Money("1000"), new Money("3000"), 12.0, 2.0, 3.0,
(short) 20, (short) 1, (short) 12, false, true, false,
frequency, principalglCodeEntity, intglCodeEntity);
FeeBO fee = TestObjectFactory.createOneTimeAmountFee("Loan One time ",
FeeCategory.LOAN, "100", FeePayment.UPFRONT);
LoanOfferingFeesEntity loanOfferingFees1 =
new LoanOfferingFeesEntity(loanOffering, fee);
loanOffering.addPrdOfferingFee(loanOfferingFees1);
// another fee for the proudct: which refers to the same fee
// as the one above
LoanOfferingFeesEntity loanOfferingFees2 =
new LoanOfferingFeesEntity(loanOffering, fee);
loanOffering.addPrdOfferingFee(loanOfferingFees2);
assertEquals("sam: I believe the business requirement is that the
loan should not have fees that are essentially the same.",
1, loanOffering.getLoanOfferingFees().size());
assertEquals("sam: I belive these two offering fees are considered
identical from business requirement",
true, loanOfferingFees1.equals(loanOfferingFees2));
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
>> Here's my attempt at a business example (Aliya/Emily/Beth/Amy/... please step in to correct me if I'm wrong):
I think you’re correct, Tom, on the functionality. According to the FS “A particular fee instance can be applied multiple times to a customer account”. Checking out this functionality in the product also verifies this behavior. I can create a loan account with two of the same fee type applied to the account.
Just a reminder—Aliya is in the field (without any internet connectivity) and will not be able to respond for a few more days.
From: mifos-devel...@lists.sourceforge.net [mailto:mifos-devel...@lists.sourceforge.net] On Behalf Of Sam Lee
Sent: Tuesday, November 27, 2007 6:59 PM
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace