diff --git a/strr-examiner-web/app/pages/dashboard.vue b/strr-examiner-web/app/pages/dashboard.vue index 9989f0862..1d4160fa0 100644 --- a/strr-examiner-web/app/pages/dashboard.vue +++ b/strr-examiner-web/app/pages/dashboard.vue @@ -276,6 +276,25 @@ const getRequirementsColumn = (app: HousApplicationResponse) => { return result } +/** Application statuses that mean a renewal was completed (registration was renewed) */ +const RENEWAL_APPROVED_STATUSES = new Set([ + ApplicationStatus.FULL_REVIEW_APPROVED, + ApplicationStatus.PROVISIONALLY_APPROVED, + ApplicationStatus.PROVISIONAL_REVIEW, + ApplicationStatus.AUTO_APPROVED +]) + +/** Check if a registration has been renewed. Draft renewals are ignored (Renewals in progress). */ +const hasBeenRenewed = (reg: HousRegistrationResponse): boolean => { + const applications = reg.header?.applications ?? [] + return applications.some( + app => + app.applicationType === 'renewal' && + app.applicationStatus && + RENEWAL_APPROVED_STATUSES.has(app.applicationStatus as ApplicationStatus) + ) +} + const getConditionsColumnForRegistration = (reg: HousRegistrationResponse) => { let result = '' let listingSize = '' @@ -385,7 +404,8 @@ const { data: registrationListResp, status: regStatus } = await useAsyncData( applicantName: getApplicantNameColumnForRegistration(reg), propertyAddress: getPropertyAddressColumnForRegistration(reg), localGov: '', // TODO: implement this once API has made the changes - adjudicator: getAdjudicatorColumn(reg.header) + adjudicator: getAdjudicatorColumn(reg.header), + hasRenewed: hasBeenRenewed(reg) })) return { registrations, total: res.total } @@ -428,6 +448,7 @@ const { data: applicationListResp, status } = await useAsyncData( applicationNumber: app.header.applicationNumber, registrationNumber: app.header.registrationNumber, registrationId: app.header.registrationId, + applicationType: app.header?.applicationType, registrationType: t(`registrationType.${app.registration.registrationType}`), requirements: getRequirementsColumn(app), applicantName: getApplicantNameColumn(app), @@ -915,8 +936,16 @@ const tabLinks = computed(() => [
{{ row.applicationNumber }}
-
- {{ row.registrationNumber }} +
+ {{ row.registrationNumber }} +
[ {{ row.registrationNumber }}
-
- {{ row.applicationNumber }} +
+ {{ row.applicationNumber }} [ > {{ row.registrationNumber }} +
diff --git a/strr-examiner-web/package.json b/strr-examiner-web/package.json index 3d7245e26..eb3fe2681 100644 --- a/strr-examiner-web/package.json +++ b/strr-examiner-web/package.json @@ -2,7 +2,7 @@ "name": "strr-examiner-web", "private": true, "type": "module", - "version": "0.2.16", + "version": "0.2.17", "scripts": { "build-check": "nuxt build", "build": "nuxt generate",