当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Paths.taskListPage.evaluateUri方法代码示例

本文整理汇总了TypeScript中claimant-response/paths.Paths.taskListPage.evaluateUri方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Paths.taskListPage.evaluateUri方法的具体用法?TypeScript Paths.taskListPage.evaluateUri怎么用?TypeScript Paths.taskListPage.evaluateUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在claimant-response/paths.Paths.taskListPage的用法示例。


在下文中一共展示了Paths.taskListPage.evaluateUri方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: buildTaskListUri

  buildTaskListUri (req: express.Request, res: express.Response): string {
    const claim: Claim = res.locals.claim
    const draft: DraftClaimantResponse = res.locals.draft.document
    const claimResponse = claim.response as FullAdmissionResponse | PartialAdmissionResponse

    const externalId: string = req.params.externalId

    const courtDecision = PaymentOptionPage.getCourtDecision(draft, claim)
    switch (courtDecision) {
      case DecisionType.NOT_APPLICABLE_IS_BUSINESS:
        return Paths.taskListPage.evaluateUri({ externalId: externalId })
      case DecisionType.COURT:
        return Paths.courtOfferedInstalmentsPage.evaluateUri({ externalId: externalId })
      case DecisionType.DEFENDANT: {
        if (claimResponse.paymentIntention.paymentOption === PaymentOption.INSTALMENTS) {
          return Paths.courtOfferedInstalmentsPage.evaluateUri({ externalId: externalId })
        }

        if (claimResponse.paymentIntention.paymentOption === PaymentOption.BY_SPECIFIED_DATE) {
          return Paths.courtOfferedSetDatePage.evaluateUri({ externalId: externalId })
        }
        break
      }
      case DecisionType.CLAIMANT:
      case DecisionType.CLAIMANT_IN_FAVOUR_OF_DEFENDANT: {
        return Paths.payBySetDateAcceptedPage.evaluateUri({ externalId: externalId })
      }
    }
  }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:29,代码来源:payment-option.ts

示例2: renderView

    ErrorHandling.apply(async (req: express.Request, res: express.Response, next: express.NextFunction): Promise<void> => {
      const claim: Claim = res.locals.claim
      const form: Form<CanWeUseCompany> = req.body

      if (form.hasErrors()) {
        renderView(form, res)
      } else {
        const draft: Draft<MediationDraft> = res.locals.mediationDraft
        const user: User = res.locals.user
        draft.document.canWeUseCompany = form.model

        if (form.model.option === FreeMediationOption.YES) {
          draft.document.canWeUseCompany.mediationContactPerson = undefined
          draft.document.canWeUseCompany.mediationPhoneNumber = undefined
        } else {
          draft.document.canWeUseCompany.mediationPhoneNumberConfirmation = undefined
        }
        await new DraftService().save(draft, user.bearerToken)

        if (!claim.isResponseSubmitted()) {
          res.redirect(ResponsePaths.taskListPage.evaluateUri({ externalId: claim.externalId }))
        } else {
          res.redirect(ClaimantResponsePaths.taskListPage.evaluateUri({ externalId: claim.externalId }))
        }
      }
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:26,代码来源:can-we-use-company.ts

示例3: renderView

    ErrorHandling.apply(async (req: express.Request, res: express.Response, next: express.NextFunction) => {
      const form: Form<FreeMediation> = req.body
      if (form.hasErrors()) {
        renderView(form, res)
      } else {
        const draft: Draft<MediationDraft> = res.locals.mediationDraft
        const user: User = res.locals.user

        draft.document.willYouTryMediation = form.model

        if (form.model.option === FreeMediationOption.NO) {
          draft.document.youCanOnlyUseMediation = undefined
          draft.document.canWeUse = undefined
          draft.document.canWeUseCompany = undefined
        }

        await new DraftService().save(draft, user.bearerToken)

        const externalId: string = req.params.externalId
        if (form.model.option === FreeMediationOption.YES) {
          res.redirect(Paths.mediationAgreementPage.evaluateUri({ externalId: externalId }))
        } else {
          const claim: Claim = res.locals.claim
          if (!claim.isResponseSubmitted()) {
            res.redirect(ResponsePaths.taskListPage.evaluateUri({ externalId: externalId }))
          } else {
            res.redirect(ClaimantResponsePaths.taskListPage.evaluateUri({ externalId: externalId }))
          }
        }
      }
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:31,代码来源:will-you-try-mediation.ts

示例4: renderView

    ErrorHandling.apply(async (req: express.Request, res: express.Response, next: express.NextFunction): Promise<void> => {
      const form: Form<AcceptCourtOffer> = req.body
      if (form.hasErrors()) {
        renderView(form, res)
      } else {
        const draft: Draft<DraftClaimantResponse> = res.locals.claimantResponseDraft
        const user: User = res.locals.user
        const { externalId } = req.params

        draft.document.acceptCourtOffer = form.model

        if (draft.document.courtDetermination.rejectionReason || draft.document.formaliseRepaymentPlan) {
          delete draft.document.courtDetermination.rejectionReason
          delete draft.document.formaliseRepaymentPlan
          delete draft.document.settlementAgreement
        }
        await new DraftService().save(draft, user.bearerToken)

        if (form.model.accept.option === YesNoOption.YES.option) {
          res.redirect(Paths.taskListPage.evaluateUri({ externalId: externalId }))
        } else {
          res.redirect(Paths.rejectionReasonPage.evaluateUri({ externalId: externalId }))
        }
      }
    }))
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:25,代码来源:court-offered-set-date.ts

示例5: renderView

    ErrorHandling.apply(async (req: express.Request, res: express.Response, next: express.NextFunction) => {
      const form: Form<FormaliseRepaymentPlan> = req.body
      if (form.hasErrors()) {
        renderView(form, res)
      } else {
        const draft: Draft<DraftClaimantResponse> = res.locals.claimantResponseDraft
        const user: User = res.locals.user

        draft.document.formaliseRepaymentPlan = form.model

        switch (form.model.option) {
          case FormaliseRepaymentPlanOption.SIGN_SETTLEMENT_AGREEMENT:
            delete draft.document.paidAmount
            delete draft.document.settlementAgreement
            break
          case FormaliseRepaymentPlanOption.REQUEST_COUNTY_COURT_JUDGEMENT:
            delete draft.document.settlementAgreement
            break
        }
        await new DraftService().save(draft, user.bearerToken)

        const externalId: string = req.params.externalId
        res.redirect(Paths.taskListPage.evaluateUri({ externalId: externalId }))
      }
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:25,代码来源:choose-how-to-proceed.ts

示例6: FreeMediation

    ErrorHandling.apply(async (req: express.Request, res: express.Response) => {
      const claim: Claim = res.locals.claim
      const draft: Draft<MediationDraft> = res.locals.mediationDraft
      const user: User = res.locals.user

      if (req.body.accept) {
        draft.document.youCanOnlyUseMediation = new FreeMediation(FreeMediationOption.YES)

        await new DraftService().save(draft, user.bearerToken)
        if (claim.claimData.defendant.isBusiness()) {
          res.redirect(Paths.canWeUseCompanyPage.evaluateUri({ externalId: claim.externalId }))
        } else {
          res.redirect(Paths.canWeUsePage.evaluateUri({ externalId: claim.externalId }))
        }
      } else {
        draft.document.youCanOnlyUseMediation = new FreeMediation(FreeMediationOption.NO)
        draft.document.canWeUse = undefined
        draft.document.canWeUseCompany = undefined

        await new DraftService().save(draft, user.bearerToken)

        if (!claim.isResponseSubmitted()) {
          res.redirect(ResponsePaths.taskListPage.evaluateUri({ externalId: claim.externalId }))
        } else {
          res.redirect(ClaimantResponsePaths.taskListPage.evaluateUri({ externalId: claim.externalId }))
        }
      }
    }))
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:28,代码来源:mediation-agreement.ts

示例7:

    ErrorHandling.apply(async (req: express.Request, res: express.Response, next: express.NextFunction) => {
      const draft: Draft<DraftClaimantResponse> = res.locals.claimantResponseDraft
      const claim: Claim = res.locals.claim

      res.render(Paths.incompleteSubmissionPage.associatedView,
        {
          taskListUri: Paths.taskListPage.evaluateUri({ externalId: claim.externalId }),
          tasks: TaskListBuilder.buildRemainingTasks(draft.document, claim)
        }
      )
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:11,代码来源:incomplete-submission.ts

示例8: DraftService

    ErrorHandling.apply(async (req: express.Request, res: express.Response) => {
      const { externalId } = await req.params
      const draft: Draft<DraftClaimantResponse> = res.locals.draft
      const user: User = res.locals.user

      draft.document.settlementAgreement = undefined
      draft.document.formaliseRepaymentPlan = undefined
      draft.document.courtDetermination.rejectionReason = undefined

      await new DraftService().save(draft, user.bearerToken)

      res.redirect(Paths.taskListPage.evaluateUri({ externalId: externalId }))
    }))
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:13,代码来源:counter-offer-accepted.ts

示例9: async

    async (req: express.Request, res: express.Response): Promise<void> => {
      const { externalId } = await req.params

      const draft: Draft<DraftClaimantResponse> = res.locals.claimantResponseDraft
      const user: User = res.locals.user

      if (draft.document.formaliseRepaymentPlan) {
        delete draft.document.formaliseRepaymentPlan
      }

      await new DraftService().save(draft, user.bearerToken)

      res.redirect(Paths.taskListPage.evaluateUri({ externalId: externalId }))
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:14,代码来源:pay-by-set-date-accepted.ts

示例10: renderView

    ErrorHandling.apply(async (req: express.Request, res: express.Response, next: express.NextFunction) => {
      const form: Form<SettlementAgreement> = req.body
      if (form.hasErrors()) {
        renderView(form, res)
      } else {
        const draft: Draft<DraftClaimantResponse> = res.locals.claimantResponseDraft
        const user: User = res.locals.user

        draft.document.settlementAgreement = form.model

        await new DraftService().save(draft, user.bearerToken)

        const externalId: string = req.params.externalId
        res.redirect(Paths.taskListPage.evaluateUri({ externalId: externalId }))
      }
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:16,代码来源:sign-settlement-agreement.ts


注:本文中的claimant-response/paths.Paths.taskListPage.evaluateUri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。