diff --git a/app/src/controllers/submission.ts b/app/src/controllers/submission.ts index 01178597..7fc587fa 100644 --- a/app/src/controllers/submission.ts +++ b/app/src/controllers/submission.ts @@ -298,10 +298,10 @@ const controller = { trackingId: x.trackingId, status: x.status ?? PermitStatus.APPLIED, needed: x.needed ?? PermitNeeded.YES, - statusLastVerified: x.statusLastVerified, + statusLastVerified: null, issuedPermitId: null, authStatus: x.authStatus ?? PermitAuthorizationStatus.IN_REVIEW, - submittedDate: null, + submittedDate: x.submittedDate, adjudicationDate: null })); } @@ -314,7 +314,7 @@ const controller = { trackingId: null, status: x.status ?? PermitStatus.NEW, needed: x.needed ?? PermitNeeded.UNDER_INVESTIGATION, - statusLastVerified: x.statusLastVerified, + statusLastVerified: null, issuedPermitId: null, authStatus: x.authStatus ?? PermitAuthorizationStatus.NONE, submittedDate: null, diff --git a/app/src/validators/appliedPermit.ts b/app/src/validators/appliedPermit.ts index c11378fa..43e7ff5d 100644 --- a/app/src/validators/appliedPermit.ts +++ b/app/src/validators/appliedPermit.ts @@ -7,6 +7,6 @@ export const appliedPermit = Joi.object({ status: Joi.string() .valid(...PERMIT_STATUS_LIST) .allow(null), - statusLastVerified: Joi.date().max('now').allow(null), + submittedDate: Joi.date().max('now').allow(null), trackingId: Joi.string().allow(null) }); diff --git a/app/tests/unit/controllers/submission.spec.ts b/app/tests/unit/controllers/submission.spec.ts index 4f82f30f..061826df 100644 --- a/app/tests/unit/controllers/submission.spec.ts +++ b/app/tests/unit/controllers/submission.spec.ts @@ -467,20 +467,19 @@ describe('createSubmission', () => { permitTypeId: 1, trackingId: '123', status: PermitStatus.APPLIED, - statusLastVerified: now + submittedDate: now }, { permitTypeId: 3, trackingId: '456', status: PermitStatus.APPLIED, - statusLastVerified: now + submittedDate: now } ], investigatePermits: [ { permitTypeId: 12, - needed: PermitNeeded.UNDER_INVESTIGATION, - statusLastVerified: now + needed: PermitNeeded.UNDER_INVESTIGATION } ] }, @@ -506,7 +505,7 @@ describe('createSubmission', () => { activityId: '00000000', trackingId: '123', status: PermitStatus.APPLIED, - statusLastVerified: now + submittedDate: now }) ); expect(createPermitSpy).toHaveBeenNthCalledWith( @@ -516,7 +515,7 @@ describe('createSubmission', () => { activityId: '00000000', trackingId: '456', status: PermitStatus.APPLIED, - statusLastVerified: now + submittedDate: now }) ); expect(createPermitSpy).toHaveBeenNthCalledWith( @@ -524,8 +523,7 @@ describe('createSubmission', () => { expect.objectContaining({ permitTypeId: 12, activityId: '00000000', - needed: PermitNeeded.UNDER_INVESTIGATION, - statusLastVerified: now + needed: PermitNeeded.UNDER_INVESTIGATION }) ); }); @@ -809,20 +807,19 @@ describe('submitDraft', () => { permitTypeId: 1, trackingId: '123', status: PermitStatus.APPLIED, - statusLastVerified: now + submittedDate: now }, { permitTypeId: 3, trackingId: '456', status: PermitStatus.APPLIED, - statusLastVerified: now + submittedDate: now } ], investigatePermits: [ { permitTypeId: 12, - needed: PermitNeeded.UNDER_INVESTIGATION, - statusLastVerified: now + needed: PermitNeeded.UNDER_INVESTIGATION } ] }, @@ -849,7 +846,7 @@ describe('submitDraft', () => { activityId: '00000000', trackingId: '123', status: PermitStatus.APPLIED, - statusLastVerified: now + submittedDate: now }) ); expect(createPermitSpy).toHaveBeenNthCalledWith( @@ -859,7 +856,7 @@ describe('submitDraft', () => { activityId: '00000000', trackingId: '456', status: PermitStatus.APPLIED, - statusLastVerified: now + submittedDate: now }) ); expect(createPermitSpy).toHaveBeenNthCalledWith( @@ -867,8 +864,7 @@ describe('submitDraft', () => { expect.objectContaining({ permitTypeId: 12, activityId: '00000000', - needed: PermitNeeded.UNDER_INVESTIGATION, - statusLastVerified: now + needed: PermitNeeded.UNDER_INVESTIGATION }) ); }); diff --git a/app/tests/unit/validators/appliedPermits.spec.ts b/app/tests/unit/validators/appliedPermits.spec.ts index ffed50d3..7862f328 100644 --- a/app/tests/unit/validators/appliedPermits.spec.ts +++ b/app/tests/unit/validators/appliedPermits.spec.ts @@ -6,7 +6,7 @@ describe('appliedPermitsSchema', () => { const appliedPermits = { permitTypeId: '123AC!', status: PermitStatus.NEW, - statusLastVerified: '2021-01-01', + submittedDate: '2021-01-01', trackingId: 'test' }; const result = appliedPermit.validate(appliedPermits); @@ -16,7 +16,7 @@ describe('appliedPermitsSchema', () => { it('should not accept null for permitTypeId', () => { const appliedPermits = { status: PermitStatus.APPLIED, - statusLastVerified: '2021-01-01', + submittedDate: '2021-01-01', trackingId: 'test tracking id' }; const result = appliedPermit.validate(appliedPermits); @@ -27,7 +27,7 @@ describe('appliedPermitsSchema', () => { const appliedPermits = { permitTypeId: 123, status: PermitStatus.COMPLETED, - statusLastVerified: '2021-01-01', + submittedDate: '2021-01-01', trackingId: 'test' }; const result = appliedPermit.validate(appliedPermits); @@ -38,18 +38,18 @@ describe('appliedPermitsSchema', () => { const appliedPermits = { permitTypeId: 123, status: 'Test', - statusLastVerified: '2021-01-01', + submittedDate: '2021-01-01', trackingId: 'test' }; const result = appliedPermit.validate(appliedPermits); expect(result.error).toBeDefined(); }); - it('should only accept a valid date for statusLastVerified', () => { + it('should only accept a valid date for submitted date', () => { const appliedPermits = { permitTypeId: 123, status: PermitStatus.APPLIED, - statusLastVerified: 'not-a-date', + submittedDate: 'not-a-date', trackingId: 'test' }; const result = appliedPermit.validate(appliedPermits); @@ -60,7 +60,7 @@ describe('appliedPermitsSchema', () => { const appliedPermits = { permitTypeId: 123, status: PermitStatus.APPLIED, - statusLastVerified: new Date(Date.now() + 1000).toISOString(), + submittedDate: new Date(Date.now() + 1000).toISOString(), trackingId: 'test' }; const result = appliedPermit.validate(appliedPermits); diff --git a/frontend/src/assets/main.scss b/frontend/src/assets/main.scss index 7d1ad9a2..9584ec87 100644 --- a/frontend/src/assets/main.scss +++ b/frontend/src/assets/main.scss @@ -103,6 +103,14 @@ label { color: $app-primary !important; } +.app-error-background { + background-color: $app-error !important; +} + +.app-error-border { + border-color: $app-error !important; +} + .app-error-color { color: $app-error !important; } diff --git a/frontend/src/components/form/StepperHeader.vue b/frontend/src/components/form/StepperHeader.vue index 7f26045d..7665bfcd 100644 --- a/frontend/src/components/form/StepperHeader.vue +++ b/frontend/src/components/form/StepperHeader.vue @@ -7,30 +7,61 @@ const { activeStep, clickCallback = () => {}, title, - icon + icon, + errors = false } = defineProps<{ index: number; activeStep: number; clickCallback?: Function; title: string; icon: string; + errors?: boolean; }>(); + + diff --git a/frontend/src/components/housing/enquiry/EnquiryForm.vue b/frontend/src/components/housing/enquiry/EnquiryForm.vue index b1888bb5..e454977f 100644 --- a/frontend/src/components/housing/enquiry/EnquiryForm.vue +++ b/frontend/src/components/housing/enquiry/EnquiryForm.vue @@ -1,7 +1,7 @@