generated from hmcts/expressjs-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into CIV-14774_accessibility
- Loading branch information
Showing
14 changed files
with
196 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/common/models/generalApplication/response/urgencyRequirement.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {YesNoUpperCamelCase} from 'form/models/yesNo'; | ||
|
||
export interface GeneralAppUrgencyRequirement { | ||
generalAppUrgency: YesNoUpperCamelCase, | ||
reasonsForUrgency?: string, | ||
urgentAppConsiderationDate: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/services/features/generalApplication/response/viewApplicationService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {ApplicationResponse} from 'models/generalApplication/applicationResponse'; | ||
import {ApplicationState} from 'models/generalApplication/applicationSummary'; | ||
import {YesNoUpperCamelCase} from 'form/models/yesNo'; | ||
import {isPastDeadline} from 'common/utils/dateUtils'; | ||
|
||
export const isRespondentAllowedToRespond = (applicationResponse: ApplicationResponse): boolean => { | ||
const applicationResponseData = applicationResponse.case_data; | ||
const isStateAwaitingResponse = applicationResponse.state === ApplicationState.AWAITING_RESPONDENT_RESPONSE; | ||
const isUrgencyResponse = applicationResponseData.generalAppUrgencyRequirement.generalAppUrgency === YesNoUpperCamelCase.YES && (applicationResponseData.generalAppRespondentAgreement.hasAgreed === YesNoUpperCamelCase.YES || applicationResponse.case_data.generalAppInformOtherParty.isWithNotice === YesNoUpperCamelCase.YES); | ||
const isAllowedToRespondForUrgent = isUrgencyResponse && !isPastDeadline(applicationResponseData.generalAppNotificationDeadlineDate) && !applicationResponseData.respondentsResponses && !applicationResponseData.judicialDecision && applicationResponse.state === ApplicationState.APPLICATION_SUBMITTED_AWAITING_JUDICIAL_DECISION; | ||
return isStateAwaitingResponse || isAllowedToRespondForUrgent; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.