Open morkeltry opened 6 years ago
Please check out the schema here and comment if changes are needed. @morkeltry
Pretty tired when I made this. lastSyncAddress should be lastSyncTime. I'll change it in the branch. It's intended for the backend to check if it is up to date, to save consulting the blockchain.
early_repayment_days was intended to be a smallint, representing only how many days early the loan was finally repaid (which could be negative if overdue). In the smart contract, however, histories have an actualRepayments object which stores a mapping (consider it an array) containing each repayment, not just the final state. It could be useful to correlate this to a stringifed array early_repayment_days in the DB. I don't know if this was your plan (assuming you will be taking on #5), so I've left it as varchar.
and distribute secrets on gitter
We will discuss this, but at first guess:
repaymentSchedule should be an stringified object with numbered keys (cumulativeDays) having properties cumulativeAmount. So a loan of QI100 issued on the 4th with repayments due of QI25 on the 9th, 14th, 19th and 24th of the month would have
to reduce on-chain processing.