在 MortgageCalculationService.egl 文件中的 amortize() 函数后面添加以下代码。“记录”是一个部件,因此,您应在服务部件外部(即,在此文件中最后一个 end 语句后面)定义此部件。
record MortgageCalculationResult
// user input
loanAmount MONEY;
interestRate DECIMAL(10,8);
term INT;
// calculated fields
monthlyPayment MONEY;
interest MONEY;
end