From 0983f154d2e36f8b32b8fe47fcaa623feaa5f50e Mon Sep 17 00:00:00 2001 From: rstubryan Date: Sat, 13 Dec 2025 10:57:56 +0700 Subject: [PATCH] refactor(FE-363): Rename SupplierWithItems type for clarity --- .../pages/report/logistic-stock/PurchasesPerSupplierTab.tsx | 6 +++--- src/types/api/report/logistic-stock.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx b/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx index 6b641358..9e3deb95 100644 --- a/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx +++ b/src/components/pages/report/logistic-stock/PurchasesPerSupplierTab.tsx @@ -15,7 +15,7 @@ import Table from '@/components/Table'; import { ColumnDef } from '@tanstack/react-table'; import { formatCurrency, formatDate } from '@/lib/helper'; import { - SupplierWithItems, + LogisticPurchasePerSupplier, LogisticPurchasePerSupplierItems, } from '@/types/api/report/logistic-stock'; import { isResponseSuccess } from '@/lib/api-helper'; @@ -149,8 +149,8 @@ const PurchasesPerSupplierTab = () => { LogisticService.getAllFetcher ); - const data: SupplierWithItems[] = isResponseSuccess(response) - ? (response?.data as unknown as SupplierWithItems[]) + const data: LogisticPurchasePerSupplier[] = isResponseSuccess(response) + ? (response?.data as unknown as LogisticPurchasePerSupplier[]) : []; const getTableColumns = ( diff --git a/src/types/api/report/logistic-stock.d.ts b/src/types/api/report/logistic-stock.d.ts index a275898e..2f771bfa 100644 --- a/src/types/api/report/logistic-stock.d.ts +++ b/src/types/api/report/logistic-stock.d.ts @@ -20,12 +20,12 @@ export type LogisticPurchasePerSupplierItems = { travel_number: string; }; -export type SupplierWithItems = { +export type LogisticPurchasePerSupplier = { id: number; supplier: Supplier; items: LogisticPurchasePerSupplierItems[]; }; export type LogisticPurchasePerSupplierReport = BaseMetadata & { - data: SupplierWithItems[]; + data: LogisticPurchasePerSupplier[]; };