import { api } from '$lib/api';


export interface MaterialType {
    key: string;         
    type: string;         
    description: string;  
}


export interface MaterialTypeListResponse {
    items: MaterialType[];
    total: number;
    page: number;
    page_size: number;
}

export const materialTypesApi = {
    list: async (companyId: number, page = 1, pageSize = 100) => {
        return api.get<MaterialTypeListResponse>(`/v1/public/reference_data/material-types/?company_id=${companyId}&page=${page}&page_size=${pageSize}`);
    }
};