import type { PageParam, PageResult } from '@vben/request';

import { requestClient } from '#/api/request';

export namespace EnergyStationPriceApi {
  export interface Price {
    id?: number;
    stationId?: number;
    stationName?: string;
    customerId?: number;
    customerName?: string;
    costPrice?: number;
    customerPrice?: number;
    effectiveDate?: string;
    expiryDate?: string;
    status?: number;
    createTime?: string;
  }
}

export function getStationPricePage(params: PageParam) {
  return requestClient.get<PageResult<EnergyStationPriceApi.Price>>(
    '/energy/station-price/page',
    { params },
  );
}

export function createStationPrice(data: EnergyStationPriceApi.Price) {
  return requestClient.post('/energy/station-price/create', data);
}

export function updateStationPrice(data: EnergyStationPriceApi.Price) {
  return requestClient.put('/energy/station-price/update', data);
}

export function deleteStationPrice(id: number) {
  return requestClient.delete('/energy/station-price/delete', { params: { id } });
}
