Add applicant name handling for SEAFARER_REGISTRATION and update translations

This commit is contained in:
estifanos
2026-08-10 11:09:29 +00:00
parent 6b7c40cd3f
commit 1997434028
3 changed files with 22 additions and 2 deletions

View File

@@ -89,6 +89,18 @@ 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.
*/
function applicantOrCompanyName(app: LicenseApplication): string | undefined {
if (app.licenseType?.key !== "SEAFARER_REGISTRATION") return app.companyName ?? undefined;
const applicantName = (app.formData?.account as Record<string, unknown> | undefined)
?.applicantName;
return typeof applicantName === "string" && applicantName ? applicantName : undefined;
}
/**
* The officer work pool.
*
@@ -383,10 +395,15 @@ export function LicenseQueuePage() {
),
},
{
header: sortableHeader(t("queue.company", "Company"), "companyName"),
header: sortableHeader(
typeCode === "SEAFARER_REGISTRATION"
? t("queue.applicant", "Applicant")
: t("queue.company", "Company"),
"companyName",
),
label: t("queue.company", "Company"),
cell: ({ row }) => (
<Text size="sm">{row.original.companyName ?? "—"}</Text>
<Text size="sm">{applicantOrCompanyName(row.original) ?? "—"}</Text>
),
},
{
@@ -477,6 +494,7 @@ export function LicenseQueuePage() {
allSelected,
items,
claiming,
typeCode,
],
);

View File

@@ -790,6 +790,7 @@ export const am: Translations = {
compact: 'ጥብቅ',
number: 'ማመልከቻ ቁ.',
company: 'ኩባንያ',
applicant: 'አመልካች',
tin: 'ቲን',
submitted: 'የቀረበበት',
sla: 'ዕድሜ / የጊዜ ገደብ',

View File

@@ -791,6 +791,7 @@ export const en = {
compact: 'Compact',
number: 'App #',
company: 'Company',
applicant: 'Applicant',
tin: 'TIN',
submitted: 'Submitted',
sla: 'Age / SLA',