export const FREE_FORECASTS_DAILY = 10;
export const NEW_ACCOUNT_FORECASTS = 30;
export const BONUS_SURVEY_CREDITS = 30;
export const DAY_PASS_FORECASTS = 999;

export const DAY_PASS_NAME = 'Today Only Tourist Pass';
export const MONTHLY_PLAN_NAME = 'The Rain Man';
export const DAY_PASS_PRICE = '$4.99';
export const MONTHLY_PLAN_PRICE = '$19.99';

export const RESET_TIME_SHORT = '2:00 AM local time';

export type PaidProductType = 'daily_pass' | 'monthly_pass';

const PAID_PRODUCT_METADATA: Record<PaidProductType, {
  contentId: string;
  contentName: string;
  value: number;
}> = {
  daily_pass: {
    contentId: 'daily_pass',
    contentName: DAY_PASS_NAME,
    value: 4.99,
  },
  monthly_pass: {
    contentId: 'monthly_pass',
    contentName: MONTHLY_PLAN_NAME,
    value: 19.99,
  },
};

export function getPaidProductMetadata(productType?: string | null) {
  if (!productType || !(productType in PAID_PRODUCT_METADATA)) return null;
  return PAID_PRODUCT_METADATA[productType as PaidProductType];
}

export function formatFreeForecastsDailyLabel() {
  return `${FREE_FORECASTS_DAILY} Free AI Forecasts Daily`;
}
