Use NCR business number in URLs (/ncrs/NCR-2026-0021)

Detail routes, queue navigation, and notification email links now use the
business identifier instead of the database id — friendlier for end users
quoting NCR numbers. The API resolves both forms (case-insensitive number,
or legacy numeric id) so existing bookmarks and email links keep working.
Adds regression tests incl. a guard that /ncrs/export.csv isn't shadowed
by the path parameter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
ang3l12
2026-07-28 11:15:16 -06:00
parent 12383b2225
commit 8d48f774bb
7 changed files with 102 additions and 44 deletions

View File

@@ -325,9 +325,10 @@ function DetailBody({ ncr }: { ncr: NcrDetail }) {
}
export function NcrDetailPage() {
// URL carries the NCR business number (e.g. /ncrs/NCR-2026-0021); numeric
// ids from older links still resolve server-side.
const { id } = useParams();
const ncrId = Number(id);
const ncrQuery = useNcr(Number.isFinite(ncrId) ? ncrId : undefined);
const ncrQuery = useNcr(id);
const me = useMe();
const { toast } = useToast();
const [tab, setTab] = useState(0);