Skip to content

Commit 551eed4

Browse files
authored
fix: ORV2-4300 Editing application in queue with start date in past (#2026)
1 parent 50fcd41 commit 551eed4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

vehicles/src/common/middleware/version.middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class VersionMatchMiddleware implements NestMiddleware {
1111
use(request: Request, _response: Response, next: NextFunction): void {
1212
const { headers } = request;
1313
const origin = request.get('origin');
14-
const isProduction = process.env.NODE_ENV === 'production'
14+
const isProduction = process.env.NODE_ENV === 'production';
1515
/**
1616
* origin is available only when the request is coming from the browser.
1717
* Interaction between backend pods does not have origin header.

vehicles/src/modules/permit-application-payment/application/application.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,10 @@ export class ApplicationService {
623623
existingApplication?.permitData?.permitData,
624624
) as PermitData;
625625
const currentDate = dayjs(new Date().toISOString())?.format('YYYY-MM-DD');
626-
if (differenceBetween(permitData?.startDate, currentDate, 'days') > 0) {
626+
if (
627+
!doesUserHaveRole(currentUser.orbcUserRole, IDIR_USER_ROLE_LIST) &&
628+
differenceBetween(permitData?.startDate, currentDate, 'days') > 0
629+
) {
627630
throwUnprocessableEntityException('Start Date is in the past.');
628631
} else if (existingCase.assignedUser !== currentUser.userName) {
629632
throwUnprocessableEntityException(

0 commit comments

Comments
 (0)