fix the four typecheck errors that broke the build

`npm run build` runs `tsc --noEmit` first, so all four stopped the deploy
before vite ever ran. They came in with the redesign commit.

KpiCard: the note pill was removed from the tile but `note` was still
destructured, and `noUnusedLocals` rejects that. The prop stays declared —
87 call sites across 21 files pass it — and is now documented as accepted
and ignored, the same way `fill` already was. Those 87 strings are written
and never shown; the comment says so rather than leaving it a puzzle.

InventoryPage: dropped an unused SectionHeader import, and `colour` is not
a BadgeProps field. The intent was a brand-coloured "In transit", so that
is now `variant="purple"` — a real variant in BadgeVariantMap, and the
brand is purple.

StoreAccountPage: `current` is a BRANCH, and `gettenantlocations` sends no
tenantname on it (checked on the wire against tenant 1147). So the second
half of `shopQuery.data?.tenantname || current?.tenantname` could never
fire. Removed rather than added to the type — a field the backend does not
send is exactly the bug the previous commit fixed on the summary endpoints.

Verified: tsc clean, 625 tests pass, vite build clean, and the lock file
installs under `npm@10.9.8 ci` — the builder's npm, which the image pins.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JYEsb8PNZ19G9R8gUjTU7n
This commit is contained in:
2026-09-11 16:50:39 +05:30
parent 0a11f7543c
commit b2104d21b0
3 changed files with 21 additions and 8 deletions

View File

@@ -28,7 +28,6 @@ import { stockApi } from '@/api/stock';
import type { StockRequest } from '@/api/types';
import { KpiCard } from '@/components/KpiCard';
import { PageHeader } from '@/components/PageHeader';
import { SectionHeader } from '@/components/SectionHeader';
import { queryKeys } from '@/queries/keys';
import { useStockRequests, useStockStatement } from '@/queries/hooks';
import { useSelection } from '@/components/useSelection';
@@ -683,7 +682,7 @@ function RequestsPanel({
{request.status === 'Pending' ? (
<Badge variant="warning" label="Awaiting approval" />
) : request.status === 'Approved' ? (
<Badge variant="neutral" label="In transit" colour="var(--color-brand)" />
<Badge variant="purple" label="In transit" />
) : request.status === 'Received' ? (
<Badge variant="success" label="Stock added" />
) : (

View File

@@ -267,9 +267,13 @@ export function StoreAccountPage() {
icon={<Store size={15} />}
title="Shop & location"
>
{/* `current` is a BRANCH, and `gettenantlocations` sends no tenant
name on it — verified on the wire, tenant 1147. So the second
half of this fallback could never fire; `gettenantinfo` is the
only call that carries the business name. */}
<Row
label="Store / Business"
value={shopQuery.data?.tenantname || current?.tenantname || 'Your business'}
value={shopQuery.data?.tenantname || 'Your business'}
/>
<Row
label="Assigned shop"