import { api } from '../../shared/api/client'
import { holdingsResponseSchema, mismatchesResponseSchema, type HoldingsResponse, type MismatchesResponse } from './schema'

export async function getReconciliationHoldings(): Promise<HoldingsResponse> {
  const response = await api.get('/reconciliation/holdings')
  return holdingsResponseSchema.parse(response.data)
}

export async function getReconciliationMismatches(params?: { dateFrom?: string; dateTo?: string }): Promise<MismatchesResponse> {
  const response = await api.get('/reconciliation/mismatches', { params })
  return mismatchesResponseSchema.parse(response.data)
}
