What did I do yesterday?I worked on various parts of the program that weren't working right. And then I bumped into a part of the program that's new in MLP3, which requires a lot more thought and design to make it work…
In Moneylender 2, you have to enter two dates for each payment. The date applied tells Moneylender 2 when it's ok to advance to the next payment due. The Date Received tells Moneylender how to handle the payment for that due date.
Moneylender 3 will be much smarter. It will decide for you how to split up the payment and advance the loan. Sounds cool and convenient, right? The reality is that it's a very complex process.
I distilled the process into three patterns.
- Full Carryover - similar to MLP2's "Allow overpayments to carry over" setting. All payments pay the loan forward, so if they pay $10000 with only a $1000 monthly payment, the account would be paid for 10 months into the future. There are many lenders and loans that will use this setting. It's also great if the borrowers pay a little more sporadically and aren't really trying to get ahead. Moneylender 3 will keep everyone informed of when and how much the next payment needs to be on the loan.
- No Carryover - using this setting is like making the Payment Date in Moneylender 3 behave like the Date Applied in Moneylender 2. Lenders and servicers can shuffle the payment date around a little bit and have exact control over when the payment is credited to the loan and how that advances the loan to the next cycle. If a payment is recorded for the 28th of the month, MLP3 will still be looking for a full regular payment on the 1st a few days later. Moving that same payment to the 1st will tell MLP3 to apply the funds toward the amount due for that due date.
- Allow Early Payment - this is the tricky one, isn't it? All of these scenarios only matter when the payment amount is greater than the amount presently due on a loan. If the payment is due on the first and the borrower submits their payment three days early, we want the loan to show as paid for the 1st. Using a variety of checks and calculations, Moneylender 3 will determine if overpayments should be treated as extra principal in the current cycle, payment for the current cycle and the next cycle, or payment for the current and next cycle and some overpayment in the current cycle as well. If the borrower owes $100/month, and is paying the current month late - MLP3 will identify a $200 payment as payment for the current month plus the soon to be $100 for next month. If the payment is $150, Moneylender 3 will treat it as $100 for the current month with a $50 extra payment amount in that month. If it's $350, MLP3 will treat it as $250 in the current month, and $100 for the next month. If the borrower is paid current and submits a payment before the due date, MLP3 will allow that payment to count towards the upcoming due date.
So that's what consumed much of my time yesterday. The algorithm isn't fully coded yet but I think the architecture for it is sound.