PDJB-1305: Add property record provide-later notification banners - #1601
Draft
JasminConterioSW wants to merge 69 commits into
Draft
PDJB-1305: Add property record provide-later notification banners#1601JasminConterioSW wants to merge 69 commits into
JasminConterioSW wants to merge 69 commits into
Conversation
… support Introduces the new read-only 'Property and tenancy details' property record layout behind the ALLOW_SKIPPING_PROPERTY_REGISTRATION_FIELDS feature flag, grouping the record into property details, ownership, occupation, licensing and tenancy sections. Licensing and tenancy support a provide-later state showing a deadline (last occupied date + 28 days) for occupied properties, matching the compliance tab behaviour. Adds UPRN and multiline address to the property details section, seed data for the four occupancy/licensing scenarios, and unit and integration test coverage.
…ty-record-provide-later
Adds notification banners on the property record (behind PROPERTY_REGISTRATION_RESTRUCTURE_AND_SKIPPING) for occupied properties where licensing and/or tenancy details are provided later, and a combined banner when there is also an outstanding compliance issue. The combined banner suppresses the separate provide-later and compliance-cert banners.
# Conflicts: # src/main/resources/data-local.sql
…andlord invitation test data
…tion and test seed data
…DJB-1305-property-record-notification-banners
…e and flag-off path is isolated under beforePdjb939
…d seed inserts) - Move flag-off heading to propertyDetails.beforePdjb939.propertyRecord.heading and inline the h2 into each layout block - Rename newAddressRow/legacyAddressRow to addressRow/beforePdjb939AddressRow; drop hideNullUprn in favour of !isLandlordView - Combine property_ownership seed inserts into a single CTE-based insert in data-test.sql and data-integration.sql - Rename view-model tests to standard/beforePdjb939 wording; merge the two provideLaterEnabled controller tests into one parameterised test
…n tests; isolate flag-off coverage under BeforePdjb939Layout
…ed tenancy-section hiding
# Conflicts: # .secrets.baseline # src/main/kotlin/uk/gov/communities/prsdb/webapp/database/entity/PropertyOwnership.kt # src/test/kotlin/uk/gov/communities/prsdb/webapp/controllers/PropertyDetailsControllerTests.kt # src/test/kotlin/uk/gov/communities/prsdb/webapp/integration/PropertyDetailsTests.kt # src/test/kotlin/uk/gov/communities/prsdb/webapp/integration/PropertyDetailsUpdateJourneyTests.kt
# Conflicts: # .secrets.baseline # src/main/resources/data-local.sql
…DJB-1305-property-record-notification-banners # Conflicts: # src/main/kotlin/uk/gov/communities/prsdb/webapp/models/viewModels/summaryModels/propertyComplianceViewModels/PropertyComplianceViewModelFactory.kt # src/main/resources/data-local.sql # src/test/kotlin/uk/gov/communities/prsdb/webapp/integration/PropertyDetailsTests.kt # src/test/kotlin/uk/gov/communities/prsdb/webapp/models/viewModels/summaryModels/propertyComplianceViewModels/PropertyComplianceViewModelFactoryTests.kt
…. Previously there were two separate banner mechanisms — a provide-later banner (Variant enum LICENSING/TENANCY/BOTH/COMBINED with copy hardcoded in the template) and a data-driven compliance banner — coordinated by a suppressComplianceBanner flag. Now there's a single PropertyDetailsNotificationBannerViewModel.messages: List<NotificationMessage>, where each NotificationMessage is an optional mainText + orderedNotificationBannerLink s (each with optional before/after text). The combined case stays a single merged sentence with two links
Split the property-details page into two parallel view model + template stacks selected once in the controller, so the flag is parsed a single time and the pre-PDJB-939 path can be deleted cleanly. - Add PropertyDetailsViewModelBase with the shared row/section logic - Make PropertyDetailsViewModel the flag-on subclass and add PropertyDetailsBeforePdjb939ViewModel as the flag-off subclass - Select the view model and template in PropertyDetailsController via a single feature-flag check - Split the templates into propertyDetailsView.html (flag-on) and propertyDetailsViewBeforePdjb939.html (flag-off) with shared landlordDetails.html and compliance.html tab fragments - Split the view model tests to match the new class structure
Split the property-details page into two parallel view model + template stacks selected once in the controller, so the flag is parsed a single time and the pre-PDJB-939 path can be deleted cleanly. - Add PropertyDetailsViewModelBase with the shared row/section logic - Make PropertyDetailsViewModel the flag-on subclass and add PropertyDetailsBeforePdjb939ViewModel as the flag-off subclass - Select the view model and template in PropertyDetailsController via a single feature-flag check - Split the templates into propertyDetailsView.html (flag-on) and propertyDetailsViewBeforePdjb939.html (flag-off) with shared landlordDetails.html and compliance.html tab fragments - Split the view model tests to match the new class structure
JasminConterioSW
force-pushed
the
feat/PDJB-1048-property-record-provide-later
branch
from
July 27, 2026 09:55
5d89f1e to
12bcf56
Compare
…r flag parsing Merge the PDJB-1048 controller-level provide-later flag split into the notification-banner branch and lift all provide-later flag parsing up to the controller so the flag is read exactly once per request. - PropertyDetailsController parses PROPERTY_REGISTRATION_RESTRUCTURE_AND_SKIPPING once per handler and threads it into view-model/template selection, the compliance view-model factory, and the flag-on unified banner. - PropertyComplianceViewModelFactory no longer reads the flag itself; it takes a provideLaterEnabled parameter. - Flag-off reproduces the main-branch compliance banner exactly as a self-contained, deletable path (legacy notification message types, service method, message key and template markup), rendered via propertyDetailsViewBeforePdjb939.html. - Flag-on keeps the unified provide-later + compliance banner.
…DJB-1305-property-record-notification-banners # Conflicts: # src/main/kotlin/uk/gov/communities/prsdb/webapp/controllers/PropertyDetailsController.kt # src/main/kotlin/uk/gov/communities/prsdb/webapp/models/viewModels/summaryModels/PropertyDetailsBeforePdjb939ViewModel.kt # src/main/kotlin/uk/gov/communities/prsdb/webapp/models/viewModels/summaryModels/PropertyDetailsViewModelBase.kt # src/main/resources/templates/propertyDetailsViewBeforePdjb939.html # src/test/kotlin/uk/gov/communities/prsdb/webapp/models/viewModels/summaryModels/PropertyDetailsBeforePdjb939ViewModelTests.kt
… not added or is in provide this later
Resolves conflicts from main's parallel restructure work (PDJB-1353 bedrooms, PDJB-1054 joint-landlord invitations for local councils) against the 1048 controller-level flag split. Ports PDJB-1054 into the landlordDetails fragment and keeps main's new invitation/integration tests alongside the split-VM tests.
…DJB-1305-property-record-notification-banners
Add PropertyDetailsBeforePdjb939NotificationBannerViewModel so the flag-off path sets the same notificationBanner attribute as the flag-on path, letting both templates render the banner identically. Combine the two notification message-key builders into one (beforePdjb939 flag + missingMainTextKey selector), rename the compliance view model message fields to make clear they are compliance-only, and drop the legacy PropertyComplianceNotificationMessage structures and the flag-off template's bespoke banner blocks.
…omState The flag-off case now has its own PropertyDetailsBeforePdjb939NotificationBannerViewModel, so PropertyDetailsNotificationBannerViewModel.fromState is only ever called on the flag-on path (provideLaterEnabled was always true). Remove the redundant parameter, simplify the provide-later check, and delete the now-unreachable flag-disabled test.
Base automatically changed from
feat/PDJB-1048-property-record-provide-later
to
main
July 29, 2026 08:36
…ty-record-notification-banners # Conflicts: # src/main/kotlin/uk/gov/communities/prsdb/webapp/controllers/PropertyDetailsController.kt # src/main/kotlin/uk/gov/communities/prsdb/webapp/models/viewModels/summaryModels/PropertyDetailsViewModel.kt # src/main/resources/data-integration.sql # src/main/resources/data-local.sql # src/main/resources/data-test.sql # src/main/resources/messages/propertyDetails.yml # src/main/resources/templates/propertyDetailsView.html # src/main/resources/templates/propertyDetailsViewBeforePdjb939.html # src/test/kotlin/uk/gov/communities/prsdb/webapp/integration/PropertyDetailsTests.kt
…iewModelService Build the full property-record banner in NotificationBannerViewModelService instead of couriering compliance banner inputs on PropertyComplianceViewModel. The controller now calls a single buildNotificationBanner method, and the compliance view model only keeps compliance-tab concerns (isAllValid). Also removes orphaned root template copies of the compliance and landlordDetails fragments left by an earlier merge.
Rename combined -> propertyAndCompliance and both -> licensingAndTenancy across message keys, YAML, and tests to match the view model method names.
JasminConterioSW
force-pushed
the
feat/PDJB-1305-property-record-notification-banners
branch
from
July 30, 2026 10:45
48a8fea to
9168a25
Compare
Enforce the invariant that every registered property has a PropertyCompliance record. PropertyDetailsController now throws PrsdbWebException when compliance is null (regardless of feature flag), and the notification banner service takes a non-null PropertyCompliance. Adds a seed compliance record for property_ownership 40 in data-local.sql and updates tests.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ticket number
PDJB-1305
Goal of change
Add "provide this later" notification banners to the property and tenancy details record, shown when a landlord has skipped licensing and/or tenancy details, combined with compliance-certificate warnings where relevant.
Description of main change(s)
PropertyDetailsNotificationBannerViewModelfor the property record banner. It exposesmessages: List<NotificationMessage>, where each message is an optional lead-in text followed by ordered links (each with its own before/after text). This replaces the previous two-mechanism approach (a hardcoded provide-later variant banner plus a separate compliance banner coordinated by a suppress flag).linkTextfor gas, electrical and EPC).NotificationBannerViewModelServiceand lifts the feature-flag decision up to the controller / compliance factory, so the flag is parsed once per request.PropertyDetailsControllerfor both the landlord and local-council views.Flag-off (legacy) behaviour is preserved: a parallel
PropertyDetailsBeforePdjb939NotificationBannerViewModelproduces the same banner shape from compliance messages only (using the legacy copy), so the flag-off template renders identically to before. All flag-off banner code is grouped behind thebeforePdjb939naming so it can be deleted in one pass when the provide-later flag is permanently enabled.This work was split out of PDJB-1048 (property/tenancy record layout) and is stacked on that branch.
Anything you'd like to highlight to the reviewer?
feat/PDJB-1048-property-record-provide-later— review/merge that first.PropertyDetailsNotificationBannerViewModeland flag-offPropertyDetailsBeforePdjb939NotificationBannerViewModel) that both produce the samemessagesshape, so both templates share the same rendering markup and the flag-off variant is trivially removable later.Checklist
PropertyDetailsNotificationBannerViewModelTests,PropertyDetailsBeforePdjb939NotificationBannerViewModelTests, and expandedPropertyComplianceViewModelFactoryTestsPropertyDetailsTestsnow covers the licensing-only, tenancy-only, both-skipped, combined and compliance banner scenarios for both landlord and local-council viewsemailTemplates.json— N/A: no email changesPDJB-1305TODOs remain; the intentionalbeforePdjb939markers reference the future flag-removal ticket (PDJB-939), not this oneNftDataSeederhas been updated to reflect any changes to the database schema — N/A: no database schema changes in this PRbeforePdjb939) view models and template reproduce the previous banners exactlyPROPERTY_REGISTRATION_RESTRUCTURE_AND_SKIPPING