本文整理汇总了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 })
}
}
}
示例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 }))
}
}
})
示例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 }))
}
}
}
})
示例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 }))
}
}
}))
示例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 }))
}
})
示例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 }))
}
}
}))
示例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)
}
)
})
示例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 }))
}))
示例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 }))
})
示例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 }))
}
})