async function getClaimAmountTotal (draft: DraftClaim): Promise<TotalAmount> { const interest: number = await draftInterestAmount(draft) const totalAmount: number = draft.amount.totalAmount() return FeesClient.calculateIssueFee(totalAmount + interest) .then((feeAmount: number) => new TotalAmount(totalAmount, interest, feeAmount)) }
ErrorHandling.apply(async (req: express.Request, res: express.Response) => { const draft: Draft<DraftClaim> = res.locals.claimDraft const interest: number = await draftInterestAmount(draft.document) const totalAmount: number = draft.document.amount.totalAmount() const claimAmount: number = await draftClaimAmountWithInterest(draft.document) const issueFee = await FeesClient.calculateIssueFee(claimAmount) const hearingFee: number = await FeesClient.calculateHearingFee(claimAmount) const feeTableContent: FeeRangeMerge[] = await FeesTableViewHelper.feesTableContent() res.render(Paths.totalPage.associatedView, { interestTotal: new TotalAmount(totalAmount, interest, issueFee), interestClaimed: (draft.document.interest.option !== YesNoOption.NO), issueFee: issueFee, hearingFee: hearingFee, feeTableContent: feeTableContent }) }))