From a02cee1a78befd28ecd55216debc2d7d6707f69d Mon Sep 17 00:00:00 2001 From: estifanos Date: Wed, 5 Aug 2026 12:44:22 +0000 Subject: [PATCH] feat(LicenseQueuePage): update sorting logic to prioritize claimedAt for "mine" view --- .../features/license-review/pages/LicenseQueuePage.tsx | 8 ++++++-- libs/api/src/lib/features/licensing/licensing.types.ts | 3 ++- 2 files changed, 8 insertions(+), 3 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 6fe342639..f32d9ac4d 100644 --- a/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx +++ b/apps/backoffice/src/app/features/license-review/pages/LicenseQueuePage.tsx @@ -138,8 +138,12 @@ export function LicenseQueuePage() { licenseTypeId: pinnedTypeId ?? urlFilter.licenseTypeId, // No explicit sort in the URL or view → newest submissions first, so // the queue opens showing what most needs attention rather than - // whatever order the backend happens to return. - sortBy: urlFilter.sortBy ?? "submittedAt", + // whatever order the backend happens to return. "Mine" sorts by + // claimedAt instead — officers care when they picked it up, not when + // it was originally submitted. + sortBy: + urlFilter.sortBy ?? + (activeView.id === "mine" ? "claimedAt" : "submittedAt"), sortDir: urlFilter.sortDir ?? "DESC", take: PAGE_SIZE, skip: (page - 1) * PAGE_SIZE, diff --git a/libs/api/src/lib/features/licensing/licensing.types.ts b/libs/api/src/lib/features/licensing/licensing.types.ts index c325fee17..651c52a09 100644 --- a/libs/api/src/lib/features/licensing/licensing.types.ts +++ b/libs/api/src/lib/features/licensing/licensing.types.ts @@ -306,7 +306,8 @@ export type QueueSortField = | 'applicationNumber' | 'companyName' | 'status' - | 'dueAt'; + | 'dueAt' + | 'claimedAt'; /** Row counts behind the queue's saved-view tabs. */ export interface QueueCounts {