feat(FE-43): add Supplier API and data types for supplier management

This commit is contained in:
rstubryan
2025-10-08 09:12:49 +07:00
parent 250c42a04b
commit f5952f5a36
2 changed files with 45 additions and 0 deletions
+11
View File
@@ -34,6 +34,11 @@ import {
Product,
UpdateProductPayload,
} from '@/types/api/master-data/product';
import {
CreateSupplierPayload,
Supplier,
UpdateSupplierPayload,
} from '@/types/api/master-data/supplier';
export const UomApi = new BaseApiService<
Uom,
@@ -76,3 +81,9 @@ export const ProductApi = new BaseApiService<
CreateProductPayload,
UpdateProductPayload
>('/master-data/products');
export const SupplierApi = new BaseApiService<
Supplier,
CreateSupplierPayload,
UpdateSupplierPayload
>('/master-data/suppliers');
+34
View File
@@ -0,0 +1,34 @@
import { BaseMetadata } from '@/types/api/api-general';
export type BaseSupplier = {
id: number;
name: string;
alias: string;
category: string;
pic: string;
type: string;
phone: string;
email: string;
address: string;
account_number: string;
balance: number;
due_date: number;
};
export type Supplier = BaseMetadata & BaseSupplier;
export type CreateSupplierPayload = {
name: string;
alias: string;
category: string;
pic: string;
type: string;
phone: string;
email: string;
address: string;
account_number: string;
balance: number;
due_date: number;
};
export type UpdateSupplierPayload = CreateSupplierPayload;