import { z } from 'zod'; // Countries where Mercado Pago operates and Gruperly collects. The professor // picks one during onboarding; it drives the currency of the payment links. export const countryCodeSchema = z.enum(['AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY']); export type CountryCode = z.output; export const COUNTRY_CURRENCY: Record = { AR: 'ARS', BR: 'BRL', CL: 'CLP', CO: 'COP', MX: 'MXN', PE: 'PEN', UY: 'UYU', }; export const COUNTRY_LABELS: Record = { AR: 'Argentina', BR: 'Brasil', CL: 'Chile', CO: 'Colombia', MX: 'México', PE: 'Perú', UY: 'Uruguay', }; // The teacher's clock: when a class starts, and so until when a student can // give notice of an absence. export const COUNTRY_TIME_ZONES: Record = { AR: 'America/Argentina/Buenos_Aires', BR: 'America/Sao_Paulo', CL: 'America/Santiago', CO: 'America/Bogota', MX: 'America/Mexico_City', PE: 'America/Lima', UY: 'America/Montevideo', }; export const DEFAULT_COUNTRY: CountryCode = 'AR'; export const DEFAULT_CURRENCY = COUNTRY_CURRENCY[DEFAULT_COUNTRY]; export function currencyForCountry(country: CountryCode | null | undefined): string { return country ? COUNTRY_CURRENCY[country] : DEFAULT_CURRENCY; }