refactor: expose ETC integration readiness

This commit is contained in:
kkfluous
2026-08-07 15:00:58 +08:00
parent cdf1fd27e7
commit 0fb62135f3
8 changed files with 363 additions and 76 deletions
+5
View File
@@ -4,6 +4,7 @@ import type {
HydrogenCustomerRow, HydrogenStationFull,
ElectricKpi, ElectricDailyRow, ElectricMonthGroup,
ElectricChargeOrderResponse,
EtcOverviewResponse,
CustomerType, DateQuickPick,
} from './types';
@@ -67,3 +68,7 @@ export function fetchElectricOrders(date: string, customer: CustomerType): Promi
const q = new URLSearchParams({ date, customer });
return fetchJson<ElectricChargeOrderResponse>(`${BASE}/electric/orders?${q.toString()}`);
}
export function fetchEtcOverview(force = false): Promise<EtcOverviewResponse> {
return fetchJson<EtcOverviewResponse>(`${BASE}/etc/overview${force ? '?force=1' : ''}`);
}