コード例 #1
0
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))
}
コード例 #2
0
ファイル: total.ts プロジェクト: hmcts/cmc-citizen-frontend
    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
        })
    }))