Skip to content
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-1617 Updated job to use the correct json path. #2843

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface UpdateLicenceExpiryDateRepository : JpaRepository<ApplicationEntity, U
FROM (
SELECT
application.id AS id,
application.data -> 'basic-information' -> 'relevant-dates' -> 'selectedDates' ->> 'licenceExpiryDate' AS licenceExpiryDate
application.data -> 'basic-information' -> 'relevant-dates' ->> 'licenceExpiryDate' AS licenceExpiryDate
FROM approved_premises_applications AS apa
LEFT JOIN applications AS application ON application.id = apa.id
) AS source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Cas1UpdateApplicationLicenceExpiryDateJobTest : IntegrationTestBase() {
"selectedDates" to mapOf(
"licenceExpiryDate" to LocalDate.now().randomDateAfter(10).toString(),
),
"licenceExpiryDate" to LocalDate.now().randomDateAfter(10).toString(),
),
),
),
Expand All @@ -68,7 +69,6 @@ class Cas1UpdateApplicationLicenceExpiryDateJobTest : IntegrationTestBase() {
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")

return (data["basic-information"] as? Map<*, *>)?.let { it["relevant-dates"] as? Map<*, *> }
?.let { it["selectedDates"] as? Map<*, *> }
?.let {
val dateStr = it["licenceExpiryDate"] as? String
dateStr?.let {
Expand Down
Loading