Skip to content

Commit

Permalink
APS-1617 Updated job to use the correct json path.
Browse files Browse the repository at this point in the history
  • Loading branch information
vbala-moj committed Jan 22, 2025
1 parent 8f14fd5 commit fe944b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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,7 +47,8 @@ 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

0 comments on commit fe944b9

Please sign in to comment.