-
Notifications
You must be signed in to change notification settings - Fork 3
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
Aps 1757 raise error if characteristics are different #2739
Aps 1757 raise error if characteristics are different #2739
Conversation
19cc622
to
5dc6481
Compare
e374b51
to
a016fe8
Compare
a016fe8
to
0697a9f
Compare
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.
A really great set of improvements. LGTM 👍
...ov/justice/digital/hmpps/approvedpremisesapi/seed/cas1/Cas1SeedRoomsFromSiteSurveyXlsxJob.kt
Outdated
Show resolved
Hide resolved
...ov/justice/digital/hmpps/approvedpremisesapi/seed/cas1/Cas1SeedRoomsFromSiteSurveyXlsxJob.kt
Show resolved
Hide resolved
...gital/hmpps/approvedpremisesapi/integration/cas1/seed/SeedCas1RoomsFromSiteSurveyXlsxTest.kt
Show resolved
Hide resolved
...otlin/uk/gov/justice/digital/hmpps/approvedpremisesapi/seed/cas1/Cas1SiteSurveyBedFactory.kt
Show resolved
Hide resolved
...ov/justice/digital/hmpps/approvedpremisesapi/seed/cas1/Cas1SeedRoomsFromSiteSurveyXlsxJob.kt
Outdated
Show resolved
Hide resolved
To make them top level functions which can be used for the room characteristic import. Also add optional column id parameter to resolveAnswer.
0697a9f
to
eb1da94
Compare
eb1da94
to
a81b96f
Compare
Thanks @davidatkinsuk and appreciate your help with this. I know this refactoring wasn't entirely necessary but having your equivalent seed premises job along with your comments/feedback has been a really useful exercise for me. The refactoring work done in the penultimate commit really meant I was able to address the ticket requirements in a much more straightforward manner. Appreciate the opportunity to have done this. @Rosie-Brigham revisiting previous work and learning from it was something we raised during my last 121 and I wanted to do. This is a good example. |
Ref: APS-1757
Raise error if characteristics aren't consistent between beds when beds are in the same room.
Other issues resolved such as:
construct questionCriteriaMapping when the seed job is executed e.g. in processDataFrame, and then 'pass it around' to functions that need it (ref)
questionCriteriaMapping shouldn’t be a class instance variable to avoid concurrency issues (ref)
introduce a fun buildRoomCode(qCode,roomNumber) = "$qCode - $roomNumber" to reduce duplication (ref)
consider using something like this to aid readability: rows.addCharacteristics("Is this room located on the ground floor?", listOf("N","Y","Y")) (ref)
copy all questions into a List in this class as an instance variable, and then refer to that here instead of questionCriteriaMapping.questionToCharacterEntityMapping.keys (ref)
consider building bespoke data classes rather than using existing entity classes - this should help simplify seed job logic (see approach in seed premises job)