import { BaseApiService } from '@/services/api/base';
import {
  CreateUomPayload,
  Uom,
  UpdateUomPayload,
} from '@/types/api/master-data/uom';
import {
  Area,
  CreateAreaPayload,
  UpdateAreaPayload,
} from '@/types/api/master-data/area';
import {
  CreateLocationPayload,
  Location,
  UpdateLocationPayload,
} from '@/types/api/master-data/location';
import {
  CreateKandangPayload,
  Kandang,
  UpdateKandangPayload,
} from '@/types/api/master-data/kandang';
import {
  CreateWarehousePayload,
  UpdateWarehousePayload,
  Warehouse,
} from '@/types/api/master-data/warehouse';
import {
  CreateCustomerPayload,
  Customer,
  UpdateCustomerPayload,
} from '@/types/api/master-data/customer';
import {
  CreateProductCategoryPayload,
  ProductCategory,
  UpdateProductCategoryPayload,
} from '@/types/api/master-data/product-category';
import {
  CreateProductPayload,
  Product,
  UpdateProductPayload,
} from '@/types/api/master-data/product';
import {
  CreateSupplierPayload,
  Supplier,
  UpdateSupplierPayload,
} from '@/types/api/master-data/supplier';
import {
  CreateNonstockPayload,
  Nonstock,
  UpdateNonstockPayload,
} from '@/types/api/master-data/nonstock';
import {
  Bank,
  CreateBankPayload,
  UpdateBankPayload,
} from '@/types/api/master-data/bank';

import {
  CreateFlockPayload,
  Flock,
  UpdateFlockPayload,
} from '@/types/api/master-data/flock';
import { ProductionStandard } from '@/types/api/master-data/production-standard';

export const UomApi = new BaseApiService<
  Uom,
  CreateUomPayload,
  UpdateUomPayload
>('/master-data/uoms');

export const AreaApi = new BaseApiService<
  Area,
  CreateAreaPayload,
  UpdateAreaPayload
>('/master-data/areas');

export const LocationApi = new BaseApiService<
  Location,
  CreateLocationPayload,
  UpdateLocationPayload
>('/master-data/locations');

export const KandangApi = new BaseApiService<
  Kandang,
  CreateKandangPayload,
  UpdateKandangPayload
>('/master-data/kandangs');

export const WarehouseApi = new BaseApiService<
  Warehouse,
  CreateWarehousePayload,
  UpdateWarehousePayload
>('/master-data/warehouses');

export const CustomerApi = new BaseApiService<
  Customer,
  CreateCustomerPayload,
  UpdateCustomerPayload
>('/master-data/customers');
export const ProductCategoryApi = new BaseApiService<
  ProductCategory,
  CreateProductCategoryPayload,
  UpdateProductCategoryPayload
>('/master-data/product-categories');

export const ProductApi = new BaseApiService<
  Product,
  CreateProductPayload,
  UpdateProductPayload
>('/master-data/products');

export const SupplierApi = new BaseApiService<
  Supplier,
  CreateSupplierPayload,
  UpdateSupplierPayload
>('/master-data/suppliers');

export const NonstockApi = new BaseApiService<
  Nonstock,
  CreateNonstockPayload,
  UpdateNonstockPayload
>('/master-data/nonstocks');

export const BankApi = new BaseApiService<
  Bank,
  CreateBankPayload,
  UpdateBankPayload
>('/master-data/banks');

export const FlockApi = new BaseApiService<
  Flock,
  CreateFlockPayload,
  UpdateFlockPayload
>('/master-data/flocks');

export const ProductionStandardApi = new BaseApiService<
  ProductionStandard,
  unknown,
  unknown
>('/master-data/production-standards');
