Skip to content

Commit

Permalink
fix:ORV2-2792 Rectify the expiry date validation for Staff Queue (#1623)
Browse files Browse the repository at this point in the history
  • Loading branch information
praju-aot authored Sep 26, 2024
1 parent 888f0d4 commit 5e14488
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ export class ApplicationService {
existingApplication?.permitData?.permitData,
) as PermitData;
const currentDate = dayjs(new Date().toISOString())?.format('YYYY-MM-DD');
if (differenceBetween(permitData?.startDate, currentDate, 'days') < 0) {
if (differenceBetween(permitData?.startDate, currentDate, 'days') > 0) {
throwUnprocessableEntityException('Start Date is in the past.');
}
}
Expand Down Expand Up @@ -1042,9 +1042,9 @@ export class ApplicationService {

if (
application.permitStatus === ApplicationStatus.IN_QUEUE &&
(differenceBetween(permitData?.startDate, currentDate, 'days') <
(differenceBetween(permitData?.startDate, currentDate, 'days') >
0 ||
differenceBetween(permitData?.expiryDate, currentDate, 'days') <
differenceBetween(permitData?.expiryDate, currentDate, 'days') >
0)
) {
throwUnprocessableEntityException(
Expand Down

0 comments on commit 5e14488

Please sign in to comment.