/**
 * Share Price Index Standard Model.
 */

import { z } from 'zod'

export const SharePriceIndexQueryParamsSchema = z.object({
  country: z.string().default('united_states').describe('Country to get share price index for.'),
  frequency: z.enum(['annual', 'quarter', 'monthly']).default('monthly').describe('Data frequency.'),
  start_date: z.string().nullable().default(null).describe('Start date in YYYY-MM-DD.'),
  end_date: z.string().nullable().default(null).describe('End date in YYYY-MM-DD.'),
}).passthrough()

export type SharePriceIndexQueryParams = z.infer<typeof SharePriceIndexQueryParamsSchema>

export const SharePriceIndexDataSchema = z.object({
  date: z.string().describe('The date of the data.'),
  country: z.string().nullable().default(null).describe('Country name.'),
  value: z.number().nullable().default(null).describe('Share price index value.'),
}).passthrough()

export type SharePriceIndexData = z.infer<typeof SharePriceIndexDataSchema>
