feat: add inventory statistics section, adapt to latest prototype
- Add GET /api/vehicles/inventory-stats endpoint that groups inventory vehicles by macro-region, city, brand, type, model, and batch - Add RegionalInventoryStats type and fetchInventoryStats API function - Add full inventory statistics section with region/model tabs, filters, desktop table, and mobile views - Add modal filters (plate number, model, brand, location search) to vehicle detail modal - Update modal header to support title field for contextual naming Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
DeptGroup,
|
||||
RegionGroup,
|
||||
CustomerStats,
|
||||
RegionalInventoryStats,
|
||||
} from './types';
|
||||
|
||||
const BASE = '/api/vehicles';
|
||||
@@ -69,6 +70,10 @@ export async function fetchCustomerStats(): Promise<CustomerStats[]> {
|
||||
return fetchJson<CustomerStats[]>(`${BASE}/customer-stats`);
|
||||
}
|
||||
|
||||
export async function fetchInventoryStats(): Promise<RegionalInventoryStats[]> {
|
||||
return fetchJson<RegionalInventoryStats[]>(`${BASE}/inventory-stats`);
|
||||
}
|
||||
|
||||
export async function fetchWeeklyDetail(type: string): Promise<WeeklyDetailItem[]> {
|
||||
return fetchJson<WeeklyDetailItem[]>(`${BASE}/weekly-detail?type=${type}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user