Skip to content

Commit 8d6c8a7

Browse files
authored
ExpiresAt Missing In Action (#305)
Core shouldn't set housingReference.ExpiresAt to null. ExpiresAt will be handled in Leasing
1 parent 7519d71 commit 8d6c8a7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/services/lease-service/helpers/application-profile.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ export function makeAdminApplicationProfileRequestParams(
5959
expiresAt: existingProfile.expiresAt,
6060
housingReference: {
6161
...body.housingReference,
62-
expiresAt,
62+
expiresAt:
63+
body.housingReference.reviewStatus === 'REJECTED'
64+
? body.housingReference.expiresAt
65+
: expiresAt,
6366
reviewedAt: now,
6467
},
6568
}
@@ -90,7 +93,9 @@ function getDiffType(
9093

9194
const reviewed =
9295
incomingHousingReference.reviewStatus !==
93-
existingHousingReference.reviewStatus
96+
existingHousingReference.reviewStatus ||
97+
(incomingHousingReference.reviewStatus == 'REJECTED' &&
98+
incomingHousingReference.expiresAt !== existingHousingReference.expiresAt)
9499

95100
const profileUpdate =
96101
JSON.stringify(incomingProfile) !== JSON.stringify(existingProfile)

src/services/lease-service/schemas/admin/application-profile/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const UpdateApplicationProfileRequestParams =
1717
comment: true,
1818
reviewedBy: true,
1919
reasonRejected: true,
20+
expiresAt: true,
2021
}
2122
),
2223
})

src/services/lease-service/tests/index.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ describe('lease-service', () => {
717717
housingReference: {
718718
...existingProfile.housingReference,
719719
reviewStatus: 'REJECTED',
720+
expiresAt: new Date('2022-01-01'),
720721
},
721722
})
722723

0 commit comments

Comments
 (0)