import request from '@/config/axios'

export interface DigitalWell {
  id: number
  well?: string
  uwi?: string
  comp?: string
  fld?: string
  cnty?: string
  stat?: string
  start?: number
  stop?: number
  step?: number
  depth?: number | null
  elev?: number
  lat?: number
  lon?: number
  [key: string]: unknown
}

export interface WellListResult {
  list: DigitalWell[]
  total: number
}

export interface WellLogDataset {
  wellInfo?: DigitalWell
  depths: number[]
  sws?: number[]
  dts?: number[]
  porns?: number[]
  rhobs?: number[]
  rxos?: number[]
  r25s?: number[]
  cilds?: number[]
  calis?: number[]
  sps?: number[]
  grs?: number[]
  [key: string]: unknown
}

export const DigitalApi = {
  getWellLogDataset: (wellId: number): Promise<WellLogDataset> => {
    return request.get({ url: '/pms/las-well-data/wellLogDataset', params: { wellId } })
  },
  getWellList: (): Promise<WellListResult> => {
    return request.get({ url: '/pms/las-well/page', params: { pageNo: 1, pageSize: 100 } })
  }
}
