import axiosInstance from '../../utils/axios';

export interface PropertyQuery {
  pageNo?: number;
  pageSize?: number;
  current?: number;
  size?: number;
  propertyName?: string;
  propertyCode?: string;
  status?: number;
  [key: string]: any;
}

export interface PropertyVO {
  propertyId?: number;
  id?: number;
  propertyName: string;
  propertyCode: string;
  propertyType?: string;
  propertyUnit?: string;
  status?: number;
  remark?: string;
  [key: string]: any;
}

export const materialStandardApi = {
  PropertyPage: (params: PropertyQuery) =>
    axiosInstance.get('/iscs/materials-property/getMaterialsPropertyPage', { params }),
  selectPropertyById: (id: number) =>
    axiosInstance.get('/iscs/materials-property/selectMaterialsPropertyById', { params: { id } }),
  addProperty: (data: PropertyVO) =>
    axiosInstance.post('/iscs/materials-property/insertMaterialsProperty', data),
  updateProperty: (data: PropertyVO) =>
    axiosInstance.put('/iscs/materials-property/updateMaterialsProperty', data),
  deleteProperty: (ids: number | string) =>
    axiosInstance.delete('/iscs/materials-property/deleteMaterialsPropertyList', { params: { ids } }),
};
