-
Notifications
You must be signed in to change notification settings - Fork 1
PDJB-990: Skip licensing details during property registration #1607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bnjn-mt
wants to merge
19
commits into
main
Choose a base branch
from
feat/PDJB-990-skip-licensing-details
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9ea39af
Property registration skip licensing details
bnjn-mt fb5aef4
Added ’
bnjn-mt ac4f841
Fixed failing tests
bnjn-mt 7ad95c8
Merge branch 'main' into feat/PDJB-990-skip-licensing-details
bnjn-mt 11e0596
Merge branch 'main' into feat/PDJB-990-skip-licensing-details
bnjn-mt 5381a80
Merge branch 'main' into feat/PDJB-990-skip-licensing-details
bnjn-mt 41d3700
PDJB-990: Add licensing provide-later integration coverage
bnjn-mt f74b0bb
PDJB-990: Clean up licensing provide-later integration coverage
bnjn-mt cb45d0c
Fixed compile errors
bnjn-mt 5ed4a3e
Fix tests
bnjn-mt 99029da
Merge branch 'main' into feat/PDJB-990-skip-licensing-details
bnjn-mt d7fa8df
Merge branch 'main' into feat/PDJB-990-skip-licensing-details
bnjn-mt 63694c7
Merge branch 'main' into feat/PDJB-990-skip-licensing-details
bnjn-mt 025fc1e
Merge branch 'main' into feat/PDJB-990-skip-licensing-details
bnjn-mt fddb0d8
LicenseService.licenceShouldBeStored method and tests
bnjn-mt 64c55c4
Changed hardcoded provide this later string to a constant in Licensin…
bnjn-mt 27efe1c
Merge branch 'main' into feat/PDJB-990-skip-licensing-details
bnjn-mt e6a92fd
Merge branch 'main' into feat/PDJB-990-skip-licensing-details
bnjn-mt b0d8b30
Addressed PR comments
bnjn-mt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
34 changes: 34 additions & 0 deletions
34
...ities/prsdb/webapp/journeys/propertyRegistration/steps/ProvideLicensingLaterStepConfig.kt
This file contains hidden or 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,34 @@ | ||
| package uk.gov.communities.prsdb.webapp.journeys.propertyRegistration.steps | ||
|
|
||
| import uk.gov.communities.prsdb.webapp.annotations.webAnnotations.JourneyFrameworkComponent | ||
| import uk.gov.communities.prsdb.webapp.journeys.AbstractRequestableStepConfig | ||
| import uk.gov.communities.prsdb.webapp.journeys.JourneyStep.RequestableStep | ||
| import uk.gov.communities.prsdb.webapp.journeys.propertyRegistration.states.LicensingState | ||
| import uk.gov.communities.prsdb.webapp.journeys.shared.Complete | ||
| import uk.gov.communities.prsdb.webapp.models.requestModels.formModels.NoInputFormModel | ||
|
|
||
| @JourneyFrameworkComponent | ||
| class ProvideLicensingLaterStepConfig : AbstractRequestableStepConfig<Complete, NoInputFormModel, LicensingState>() { | ||
| override val formModelClass = NoInputFormModel::class | ||
|
|
||
| override fun getStepSpecificContent(state: LicensingState) = | ||
| mapOf( | ||
| "submitButtonText" to if (state.isOccupied == true) "forms.buttons.continue" else "forms.buttons.saveAndContinue", | ||
| ) | ||
|
|
||
| override fun chooseTemplate(state: LicensingState): String = | ||
| state.isOccupied?.let { isOccupied -> | ||
| if (isOccupied) "forms/provideLicensingLaterOccupiedForm" else "forms/provideLicensingLaterUnoccupiedForm" | ||
| } ?: throw IllegalStateException("ProvideLicensingLaterStep should not be reachable before isOccupied is set") | ||
|
|
||
| override fun mode(state: LicensingState) = getFormModelFromStateOrNull(state)?.let { Complete.COMPLETE } | ||
| } | ||
|
|
||
| @JourneyFrameworkComponent | ||
| final class ProvideLicensingLaterStep( | ||
| stepConfig: ProvideLicensingLaterStepConfig, | ||
| ) : RequestableStep<Complete, NoInputFormModel, LicensingState>(stepConfig) { | ||
| companion object { | ||
| const val ROUTE_SEGMENT = "provide-licensing-later" | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| package uk.gov.communities.prsdb.webapp.journeys.propertyRegistration.tasks | ||
|
|
||
| import uk.gov.communities.prsdb.webapp.annotations.webAnnotations.JourneyFrameworkComponent | ||
| import uk.gov.communities.prsdb.webapp.config.managers.FeatureFlagManager | ||
| import uk.gov.communities.prsdb.webapp.journeys.OrParents | ||
| import uk.gov.communities.prsdb.webapp.journeys.Task | ||
| import uk.gov.communities.prsdb.webapp.journeys.hasOutcome | ||
|
|
@@ -11,15 +10,13 @@ import uk.gov.communities.prsdb.webapp.journeys.propertyRegistration.steps.HmoAd | |
| import uk.gov.communities.prsdb.webapp.journeys.propertyRegistration.steps.HmoMandatoryLicenceStep | ||
| import uk.gov.communities.prsdb.webapp.journeys.propertyRegistration.steps.LicensingTypeMode | ||
| import uk.gov.communities.prsdb.webapp.journeys.propertyRegistration.steps.LicensingTypeStep | ||
| import uk.gov.communities.prsdb.webapp.journeys.propertyRegistration.steps.ProvideLicensingLaterStep | ||
| import uk.gov.communities.prsdb.webapp.journeys.propertyRegistration.steps.SelectiveLicenceStep | ||
|
|
||
| @JourneyFrameworkComponent | ||
| class LicensingTask( | ||
| private val featureFlagManager: FeatureFlagManager, | ||
| ) : Task<LicensingState>() { | ||
| class LicensingTask : Task<LicensingState>() { | ||
| override fun makeSubJourney(state: LicensingState) = | ||
| subJourney(state) { | ||
| // TODO(PDJB-990): route to the 'provide details about licensing later' page when 'Provide this later' is selected behind the FF: pdjb-939-property-registration-restructure-and-skipping/PROPERTY_REGISTRATION_RESTRUCTURE_AND_SKIPPING | ||
| step(journey.licensingTypeStep) { | ||
| routeSegment(LicensingTypeStep.ROUTE_SEGMENT) | ||
| nextStep { mode -> | ||
|
|
@@ -28,6 +25,7 @@ class LicensingTask( | |
| LicensingTypeMode.HMO_MANDATORY_LICENCE -> journey.hmoMandatoryLicenceStep | ||
| LicensingTypeMode.HMO_ADDITIONAL_LICENCE -> journey.hmoAdditionalLicenceStep | ||
| LicensingTypeMode.NO_LICENSING -> exitStep | ||
| LicensingTypeMode.PROVIDE_LATER -> journey.provideLicensingLaterStep | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -46,13 +44,20 @@ class LicensingTask( | |
| parents { journey.licensingTypeStep.hasOutcome(LicensingTypeMode.HMO_ADDITIONAL_LICENCE) } | ||
| nextStep { exitStep } | ||
| } | ||
| step(journey.provideLicensingLaterStep) { | ||
| routeSegment(ProvideLicensingLaterStep.ROUTE_SEGMENT) | ||
| parents { journey.licensingTypeStep.hasOutcome(LicensingTypeMode.PROVIDE_LATER) } | ||
| nextStep { exitStep } | ||
| savable() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the reason for this step being savable but the others aren't? |
||
| } | ||
| exitStep { | ||
| parents { | ||
| OrParents( | ||
| journey.licensingTypeStep.hasOutcome(LicensingTypeMode.NO_LICENSING), | ||
| journey.selectiveLicenceStep.isComplete(), | ||
| journey.hmoMandatoryLicenceStep.isComplete(), | ||
| journey.hmoAdditionalLicenceStep.isComplete(), | ||
| journey.provideLicensingLaterStep.isComplete(), | ||
| ) | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we're not using the feature flag manager in this class - should we be? Or should it be removed?