本文整理汇总了TypeScript中claims/models/claim.Claim类的典型用法代码示例。如果您正苦于以下问题:TypeScript Claim类的具体用法?TypeScript Claim怎么用?TypeScript Claim使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Claim类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: 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
示例2: 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
示例3: 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
示例4: getPhoneNumber
function getPhoneNumber (res: express.Response) {
const claim: Claim = res.locals.claim
if (!claim.isResponseSubmitted()) {
const draftResponse: Draft<ResponseDraft> = res.locals.responseDraft
return draftResponse.document.defendantDetails.mobilePhone ? draftResponse.document.defendantDetails.mobilePhone.number : undefined
} else {
return claim.claimData.claimant.mobilePhone
}
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:9,代码来源:can-we-use-company.ts
示例5: getContactName
function getContactName (res: express.Response) {
const claim: Claim = res.locals.claim
if (!claim.isResponseSubmitted()) {
const draftResponse: Draft<ResponseDraft> = res.locals.responseDraft
return (draftResponse.document.defendantDetails.partyDetails as CompanyDetails).contactPerson ? (draftResponse.document.defendantDetails.partyDetails as CompanyDetails).contactPerson : undefined
} else {
return (claim.claimData.claimant as CompanyDetails).contactPerson
}
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:9,代码来源:can-we-use-company.ts
示例6: renderView
function renderView (res: express.Response): void {
const user: User = res.locals.user
const claim: Claim = res.locals.claim
res.render(Paths.mediationAgreementPage.associatedView, {
otherParty: claim.otherPartyName(user)
})
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:9,代码来源:mediation-agreement.ts
示例7: it
it('should not be eligible when ccj requested date is 20 days before', () => {
const claim = new Claim()
claim.countyCourtJudgment = {
paymentOption: PaymentOption.IMMEDIATELY,
ccjType: CountyCourtJudgmentType.DETERMINATION
} as CountyCourtJudgment
claim.countyCourtJudgmentRequestedAt = MomentFactory.currentDateTime().subtract(20, 'days')
expect(claim.isEligibleForReDetermination()).to.be.false
})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:10,代码来源:claim.ts
示例8: 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
示例9: retrievePaymentOptionsFromClaim
export function retrievePaymentOptionsFromClaim (claim: Claim): CCJPaymentOption {
if (!claim.response || !claim.isAdmissionsResponse()) {
return undefined
} else if (((claim.settlement && (claim.settlementReachedAt || claim.settlement.isOfferRejectedByDefendant()))
|| claim.hasDefendantNotSignedSettlementAgreementInTime())) {
const lastOffer: Offer = claim.settlement.getLastOffer()
if (lastOffer && lastOffer.paymentIntention) {
const paymentOptionFromOffer: PaymentOption = lastOffer.paymentIntention.paymentOption
return new CCJPaymentOption(PaymentType.valueOf(paymentOptionFromOffer))
}
} else {
return undefined
}
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:14,代码来源:ccjModelConverter.ts
注:本文中的claims/models/claim.Claim类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论