• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript claimFeatureToggles.ClaimFeatureToggles类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中utils/claimFeatureToggles.ClaimFeatureToggles的典型用法代码示例。如果您正苦于以下问题:TypeScript ClaimFeatureToggles类的具体用法?TypeScript ClaimFeatureToggles怎么用?TypeScript ClaimFeatureToggles使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: renderView

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

      if (form.hasErrors()) {
        renderView(form, res)
      } else {
        const claim: Claim = res.locals.claim
        const draft: Draft<ResponseDraft> = res.locals.responseDraft
        const user: User = res.locals.user

        form.model.removeExcessRows()

        if (ClaimFeatureToggles.isFeatureEnabledOnClaim(claim) && draft.document.isResponsePartiallyAdmitted()) {
          draft.document.partialAdmission.evidence = form.model
          await new DraftService().save(draft, user.bearerToken)
          res.redirect(Paths.taskListPage.evaluateUri({ externalId: claim.externalId }))
        } else {
          draft.document.evidence = form.model
          await new DraftService().save(draft, user.bearerToken)

          if (draft.document.isResponseRejected()) {
            res.redirect(Paths.taskListPage.evaluateUri({ externalId: claim.externalId }))
          } else {
            res.redirect(Paths.impactOfDisputePage.evaluateUri({ externalId: claim.externalId }))
          }
        }
      }
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:28,代码来源:evidence.ts


示例2: buildBeforeYouStartSection

  static buildBeforeYouStartSection (draft: ResponseDraft, claim: Claim, now: moment.Moment): TaskList {
    const tasks: TaskListItem[] = []
    const externalId: string = claim.externalId

    if (!ClaimFeatureToggles.isFeatureEnabledOnClaim(claim)
      && (draft.isResponsePartiallyAdmitted() || draft.isResponseFullyAdmitted())) {
      delete draft.response.type
    }

    tasks.push(
      new TaskListItem(
        'Confirm your details',
        Paths.defendantYourDetailsPage.evaluateUri({ externalId: externalId }),
        YourDetails.isCompleted(draft)
      )
    )

    if (!isPastDeadline(now, claim.responseDeadline)) {
      tasks.push(
        new TaskListItem(
          'Decide if you need more time to respond',
          Paths.moreTimeRequestPage.evaluateUri({ externalId: externalId }),
          MoreTimeNeededTask.isCompleted(draft, claim.moreTimeRequested)
        )
      )
    }

    return new TaskList('Before you start', tasks)
  }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:29,代码来源:taskListBuilder.ts


示例3: requestHandler

 static requestHandler (req: express.Request, res: express.Response, next: express.NextFunction) {
   const claim: Claim = res.locals.claim
   if (!ClaimFeatureToggles.isFeatureEnabledOnClaim(claim, 'directionsQuestionnaire')) {
     logger.warn('State guard: direction questionnaire feature not found - redirecting to dashboard')
     res.redirect(DashboardPaths.dashboardPage.uri)
   } else {
     next()
   }
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:9,代码来源:directionsQuestionnaireGuard.ts


示例4: renderView

function renderView (res: express.Response): void {
  const user: User = res.locals.user
  const claim: Claim = res.locals.claim

  res.render(Paths.freeMediationPage.associatedView, {
    otherParty: claim.otherPartyName(user),
    defendant: user.id === claim.defendantId,
    mediationPilot: ClaimFeatureToggles.isFeatureEnabledOnClaim(res.locals.claim, 'mediationPilot')
  })
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:10,代码来源:free-mediation.ts


示例5: buildSubmitSection

  static buildSubmitSection (claim: Claim, draft: ResponseDraft, externalId: string, features: string[]): TaskList {
    const tasks: TaskListItem[] = []
    if (!draft.isResponsePopulated()
      || draft.isResponseRejectedFullyWithDispute()
      || TaskListBuilder.isRejectedFullyBecausePaidClaimAmount(claim, draft)
      || (ClaimFeatureToggles.isFeatureEnabledOnClaim(claim) && TaskListBuilder.isRejectedFullyBecausePaidMoreThenClaimAmount(claim, draft))
      || (ClaimFeatureToggles.isFeatureEnabledOnClaim(claim) && TaskListBuilder.isRejectedFullyBecausePaidLessThanClaimAmountAndExplanationGiven(claim, draft))
      || draft.isResponseFullyAdmitted()
      || draft.isResponsePartiallyAdmitted()) {
      tasks.push(
        new TaskListItem(
          'Check and submit your response',
          Paths.checkAndSendPage.evaluateUri({ externalId: externalId }),
          false
        )
      )
      return new TaskList('Submit', tasks)
    }

    return undefined
  }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:21,代码来源:taskListBuilder.ts


示例6: async

    async (req: express.Request, res: express.Response, next: express.NextFunction) => {
      const draft: Draft<ResponseDraft> = res.locals.responseDraft
      const claim: Claim = res.locals.claim
      let timeline

      if (ClaimFeatureToggles.isFeatureEnabledOnClaim(claim) && draft.document.isResponsePartiallyAdmitted()) {
        timeline = draft.document.partialAdmission.timeline
      } else {
        timeline = draft.document.timeline
      }

      renderView(new Form(timeline), res)
    })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:13,代码来源:timeline.ts


示例7: isApplicableFor

 static isApplicableFor (claim: Claim, draft: ResponseDraft): boolean {
   if (!ClaimFeatureToggles.isFeatureEnabledOnClaim(claim)) {
     return false
   }
   if (!draft) {
     throw new Error('Response draft is required')
   }
   const fullAdmissionHasStatementOfMeans = draft.isResponseFullyAdmittedWithPayBySetDate() || draft.isResponseFullyAdmittedWithInstalments()
   const parAdmissionHasStatementOfMeans = draft.isResponsePartiallyAdmittedWithPayBySetDate() || draft.isResponsePartiallyAdmittedWithInstalments()
   return (
       (draft.isResponseFullyAdmitted() && fullAdmissionHasStatementOfMeans)
       || (draft.isResponsePartiallyAdmitted() && parAdmissionHasStatementOfMeans)
     )
     && !draft.defendantDetails.partyDetails.isBusiness()
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:15,代码来源:statementOfMeansFeature.ts


示例8: renderView

function renderView (form: Form<StatementOfTruth>, res: express.Response): void {
  const claim: Claim = res.locals.claim
  const draft: Draft<ResponseDraft> = res.locals.responseDraft
  const mediationDraft: Draft<MediationDraft> = res.locals.mediationDraft

  res.render(Paths.checkAndSendPage.associatedView, {
    claim: claim,
    form: form,
    draft: draft.document,
    signatureType: signatureTypeFor(claim, draft),
    statementOfMeansIsApplicable: StatementOfMeansFeature.isApplicableFor(claim, draft.document),
    admissionsApplicable: ClaimFeatureToggles.isFeatureEnabledOnClaim(claim),
    mediationEnabled: FeatureToggles.isEnabled('mediation'),
    mediationDraft: mediationDraft.document
  })
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:16,代码来源:check-and-send.ts


示例9: FreeMediation

    ErrorHandling.apply(async (req: express.Request, res: express.Response) => {
      const user: User = res.locals.user
      const draft: Draft<MediationDraft> = res.locals.mediationDraft
      draft.document.willYouTryMediation = new FreeMediation(
        req.body.mediationYes ? FreeMediationOption.YES : FreeMediationOption.NO
      )

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

      const { externalId } = req.params

      if (ClaimFeatureToggles.isFeatureEnabledOnClaim(res.locals.claim, 'mediationPilot')) {
        res.redirect(Paths.mediationAgreementPage.evaluateUri({ externalId }))
      } else {
        res.redirect(Paths.willYouTryMediation.evaluateUri({ externalId }))
      }
    }))
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:17,代码来源:how-mediation-works.ts


示例10: renderView

    ErrorHandling.apply(async (req: express.Request, res: express.Response): Promise<void> => {
      const form: Form<HowMuchHaveYouPaid> = req.body

      if (form.hasErrors()) {
        renderView(form, res)
      } else {
        const claim: Claim = res.locals.claim
        const draft: Draft<ResponseDraft> = res.locals.responseDraft
        const user: User = res.locals.user

        draft.document.rejectAllOfClaim.howMuchHaveYouPaid = form.model

        const { externalId } = req.params

        const paidLessThanClaimed = form.model.amount < claim.totalAmountTillToday
        const admissionsEnabled = ClaimFeatureToggles.isFeatureEnabledOnClaim(claim)

        if (!paidLessThanClaimed) {
          delete draft.document.rejectAllOfClaim.whyDoYouDisagree
          delete draft.document.timeline
          delete draft.document.evidence
          delete draft.document.freeMediation
        }

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

        if (paidLessThanClaimed) {
          if (admissionsEnabled) {
            res.redirect(FullRejectionPaths.youHavePaidLessPage.evaluateUri({ externalId: externalId }))
          } else {
            res.redirect(Paths.sendYourResponseByEmailPage.evaluateUri({ externalId: externalId }))
          }
        } else if (admissionsEnabled) {
          res.redirect(Paths.taskListPage.evaluateUri({ externalId: externalId }))
        } else {
          res.redirect(Paths.sendYourResponseByEmailPage.evaluateUri({ externalId: externalId }))
        }
      }
    }))
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:39,代码来源:how-much-have-you-paid.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript claimValidator.ClaimValidator类代码示例发布时间:2022-05-25
下一篇:
TypeScript callbackBuilder.buildURL函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap