import request from '@/utils/http'

export interface ModelPrice {
  id: string; provider_code: string; model_pattern: string; input_microunits_per_million: number
  output_microunits_per_million: number; currency: string; effective_from: string; effective_to: string | null
  enabled: boolean; revision: number
}
export type ModelPriceInput = Omit<ModelPrice, 'id' | 'revision'>
export const fetchModelPrices = () => request.get<ModelPrice[]>({ url: '/api/v1/admin/model-prices' })
export const createModelPrice = (data: ModelPriceInput) => request.post<ModelPrice>({ url: '/api/v1/admin/model-prices', params: data })
export const updateModelPrice = (id: string, data: ModelPriceInput) => request.put<ModelPrice>({ url: `/api/v1/admin/model-prices/${id}`, params: data })
export const deleteModelPrice = (id: string) => request.del({ url: `/api/v1/admin/model-prices/${id}` })
