From 6b946f01492f069cc84235b4154c9396a2fe76d8 Mon Sep 17 00:00:00 2001 From: estifanos Date: Tue, 11 Aug 2026 08:42:32 +0000 Subject: [PATCH] feat: update applicant name handling for license types without company name --- .../license-review/pages/LicenseQueuePage.tsx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx b/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx index 9e1266813..5b965d8a5 100644 --- a/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx +++ b/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx @@ -89,13 +89,20 @@ const ALL_STATUSES: LicenseStatus[] = [ "REJECTED", ]; -/** - * Seafarer registrations are person-centric — there is no `companyName`, so - * the queue's "company" column falls back to the applicant name captured in - * the registration form. - */ +/** Licence types with no `companyName` — the queue's "company" column falls + * back to the applicant name captured in the form instead. */ +const APPLICANT_NAME_TYPE_KEYS = [ + "SEAFARER_REGISTRATION", + "CERTIFICATE_OF_COMPETENCY", + "CERTIFICATE_OF_PROFICIENCY", + "VESSEL_REGISTRATION", + "VESSEL_OWNERSHIP_TRANSFER", +]; + function applicantOrCompanyName(app: LicenseApplication): string | undefined { - if (app.licenseType?.key !== "SEAFARER_REGISTRATION") return app.companyName ?? undefined; + if (!app.licenseType?.key || !APPLICANT_NAME_TYPE_KEYS.includes(app.licenseType.key)) { + return app.companyName ?? undefined; + } const applicantName = (app.formData?.account as Record | undefined) ?.applicantName; return typeof applicantName === "string" && applicantName ? applicantName : undefined; @@ -396,7 +403,7 @@ export function LicenseQueuePage() { }, { header: sortableHeader( - typeCode === "SEAFARER_REGISTRATION" + typeCode && APPLICANT_NAME_TYPE_KEYS.includes(typeCode) ? t("queue.applicant", "Applicant") : t("queue.company", "Company"), "companyName",