@@ -25,10 +24,9 @@ export function JoinGroupView() {
{inviteFailed || (!group && !invitePending) ?
: null}
- {registeredAttendee ?
: null}
- {waitlistMessage ?
: null}
+ {preRegistrationMessage ?
: null}
- {!registeredAttendee && !waitlistMessage && group ? (
+ {!preRegistrationMessage && group ? (
@@ -40,4 +38,4 @@ export function JoinGroupView() {
)
-}
\ No newline at end of file
+}
diff --git a/apps/web/src/features/join/JoinSuccessCard.tsx b/apps/web/src/features/join/JoinSuccessCard.tsx
deleted file mode 100644
index ccb451a..0000000
--- a/apps/web/src/features/join/JoinSuccessCard.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { CheckCircle2 } from 'lucide-react'
-import { Badge } from '../../components/ui'
-import { useJoinGroup } from './JoinGroupProvider'
-
-export function JoinSuccessCard() {
- const { group, registeredAttendee } = useJoinGroup()
- if (!group || !registeredAttendee) return null
-
- return (
-
-
-
-
-
-
-
- Registro Confirmado
-
-
¡Inscripción Exitosa!
-
- Tus datos han sido registrados con éxito en el grupo{' '}
- {group.name}.
-
-
-
-
-
- Profesor:
- {group.teacherName}
-
-
- Alumno:
- {registeredAttendee.fullName}
-
- {registeredAttendee.phone ? (
-
- Teléfono registrado:
- {registeredAttendee.phone}
-
- ) : null}
-
-
-
- El profesor se pondrá en contacto contigo a la brevedad por WhatsApp para darte la bienvenida y
- coordinar los detalles de la clase.
-
-
- )
-}
\ No newline at end of file
diff --git a/apps/web/src/features/join/WaitlistNoticeCard.tsx b/apps/web/src/features/join/PreRegistrationNoticeCard.tsx
similarity index 61%
rename from apps/web/src/features/join/WaitlistNoticeCard.tsx
rename to apps/web/src/features/join/PreRegistrationNoticeCard.tsx
index b84435a..686285c 100644
--- a/apps/web/src/features/join/WaitlistNoticeCard.tsx
+++ b/apps/web/src/features/join/PreRegistrationNoticeCard.tsx
@@ -2,9 +2,9 @@ import { Clock } from 'lucide-react'
import { Badge } from '../../components/ui'
import { useJoinGroup } from './JoinGroupProvider'
-export function WaitlistNoticeCard() {
- const { group, waitlistMessage } = useJoinGroup()
- if (!group || !waitlistMessage) return null
+export function PreRegistrationNoticeCard() {
+ const { group, preRegistrationMessage } = useJoinGroup()
+ if (!group || !preRegistrationMessage) return null
return (
@@ -14,16 +14,17 @@ export function WaitlistNoticeCard() {
- Lista de Espera
+ Pre-inscripción
-
Cupo completo
-
{waitlistMessage}
+
Solicitud enviada
+
{preRegistrationMessage}
- El profesor se pondrá en contacto contigo cuando haya un lugar disponible en{' '}
- {group.name}.
+ El profesor revisará tu solicitud para el grupo{' '}
+ {group.name} y se pondrá en contacto
+ contigo por WhatsApp para confirmarte el lugar.
)
-}
\ No newline at end of file
+}
diff --git a/apps/web/src/hooks/useLargeTitleCollapse.ts b/apps/web/src/hooks/useLargeTitleCollapse.ts
new file mode 100644
index 0000000..e0fc799
--- /dev/null
+++ b/apps/web/src/hooks/useLargeTitleCollapse.ts
@@ -0,0 +1,65 @@
+import { useEffect, useRef, useState } from 'react'
+
+/* Alto de la barra de navegación donde entra el título chico. Tiene que
+ coincidir con el `h-14` de `LargeTitle`: la barra es sticky contra el borde
+ superior de la ventana y el título grande se mide contra este valor. */
+const BAR_HEIGHT = 56
+
+function clamp01(value: number) {
+ if (value < 0) return 0
+ return value > 1 ? 1 : value
+}
+
+/**
+ * Progreso de colapso de un Large Title: 0 con el título grande desplegado,
+ * 1 cuando quedó por completo tapado detrás de la barra.
+ *
+ * El progreso sale de la posición del título, no del tiempo: se recalcula en
+ * cada frame mientras se scrollea. Por eso el gesto se siente pegado al dedo
+ * en vez de "animado", y por eso `requestAnimationFrame` sirve para agrupar
+ * eventos de scroll, no para interpolar la animación.
+ */
+export function useLargeTitleCollapse() {
+ const titleRef = useRef
(null)
+ const [progress, setProgress] = useState(0)
+
+ useEffect(() => {
+ const title = titleRef.current
+ if (!title) return
+
+ let frame = 0
+
+ const measure = () => {
+ frame = 0
+ const { top, height } = title.getBoundingClientRect()
+ // 0 cuando el borde superior del título llega a la base de la barra, 1
+ // cuando su borde inferior también llegó (quedó enteramente debajo).
+ const next = clamp01((BAR_HEIGHT - top) / (height || BAR_HEIGHT))
+ // Los títulos de grupo llegan asíncrono y pueden cambiar de alto entre
+ // renders: sin este umbral se re-renderiza en cada frame de scroll.
+ setProgress((current) => (Math.abs(current - next) < 0.002 ? current : next))
+ }
+
+ const schedule = () => {
+ if (frame === 0) frame = requestAnimationFrame(measure)
+ }
+
+ measure()
+ window.addEventListener('scroll', schedule, { passive: true })
+ window.addEventListener('resize', schedule)
+
+ // El nombre del grupo se carga después del primer render y la webfont puede
+ // cambiar el alto del título: el rango de colapso depende de esa medida.
+ const observer = new ResizeObserver(schedule)
+ observer.observe(title)
+
+ return () => {
+ if (frame !== 0) cancelAnimationFrame(frame)
+ window.removeEventListener('scroll', schedule)
+ window.removeEventListener('resize', schedule)
+ observer.disconnect()
+ }
+ }, [])
+
+ return { titleRef, progress }
+}
diff --git a/apps/web/src/lib/api.ts b/apps/web/src/lib/api.ts
index d7a979d..cacf885 100644
--- a/apps/web/src/lib/api.ts
+++ b/apps/web/src/lib/api.ts
@@ -1,5 +1,6 @@
import type {
AbsenceDetails,
+ ApproveGroupPreRegistrationResult,
AttendeeDto,
AttendeeHistory,
AttendeeList,
@@ -20,6 +21,7 @@ import type {
GroupDto,
GroupInviteInfoDto,
GroupList,
+ GroupPreRegistrationList,
GroupRiskSummary,
GroupsRiskOverview,
GroupWaitlistEntryDto,
@@ -36,6 +38,7 @@ import type {
ProblemDetails,
PromoteGroupWaitlistEntryResult,
PublicNotifyAbsence,
+ RejectGroupPreRegistrationResult,
RemoveAttendeeResult,
RemoveGroupWaitlistEntryResult,
SessionStudents,
@@ -180,6 +183,23 @@ export const removeGroupWaitlistEntry = (groupId: string, entryId: string) =>
method: 'DELETE',
})
+export const getGroupPreRegistrations = (groupId: string, page = 1, pageSize = 100) =>
+ apiFetch(
+ `/api/v1/groups/${groupId}/preregistrations?page=${page}&pageSize=${pageSize}`,
+ )
+
+export const approveGroupPreRegistration = (groupId: string, entryId: string) =>
+ apiFetch(
+ `/api/v1/groups/${groupId}/preregistrations/${entryId}/approve`,
+ { method: 'POST' },
+ )
+
+export const rejectGroupPreRegistration = (groupId: string, entryId: string) =>
+ apiFetch(
+ `/api/v1/groups/${groupId}/preregistrations/${entryId}/reject`,
+ { method: 'POST' },
+ )
+
export const removeGroupAttendee = (
groupId: string,
attendeeId: string,
diff --git a/apps/web/src/lib/format.ts b/apps/web/src/lib/format.ts
index 286bb04..62c6664 100644
--- a/apps/web/src/lib/format.ts
+++ b/apps/web/src/lib/format.ts
@@ -1,5 +1,7 @@
import type { BillingType, PaymentDto, WeekDay } from '@gruperly/shared'
+import { countryOf, currencyForRegion, localeForRegion } from './region'
+
export const WEEK_DAY_FULL_LABELS: Record = {
MONDAY: 'Lunes',
TUESDAY: 'Martes',
@@ -49,7 +51,210 @@ export function formatSchedule(days: readonly WeekDay[], time: string | null): s
return time ? `${dayNames.join(', ')} · ${time}` : dayNames.join(', ')
}
-export function formatPrice(price: number | null): string {
+/* Un importe se escribe con el país de la persona: su moneda y su regional
+ (separadores, posición del símbolo), sin conversión — el importe lo fija
+ quien creó el grupo y no se toca. El país sale de la zona horaria del
+ sistema y, si no se conoce, del idioma del browser (ver countryOf). Sin
+ país conocido se pinta con el símbolo $ genérico, nunca con un código
+ inventado. La firma acepta moneda y locale para forzarlas (tests, print)
+ sin tocar los call sites. */
+
+/* La configuración regional del browser manda en cómo se pintan los datos.
+ Se lee en cada llamada (es un accessor barato) para que un cambio de idioma
+ del sistema se refleje sin recargar; lo caro es construir el formatter, así
+ que esos se memorizan por locale/moneda. */
+type BrowserNavigator = { language?: string; languages?: readonly string[] }
+
+function browserLocale(): string | undefined {
+ const nav = (globalThis as { navigator?: BrowserNavigator }).navigator
+ return nav?.language || nav?.languages?.[0] || undefined
+}
+
+const priceFormatters = new Map()
+
+export function formatPrice(
+ price: number | null,
+ currency?: string,
+ locale?: string,
+): string {
if (price == null) return '—'
- return price.toLocaleString('es-MX', { style: 'currency', currency: 'MXN' })
-}
\ No newline at end of file
+ // Importes enteros sin decimales ($50.000); con centavos se respetan.
+ const hasCents = !Number.isInteger(price)
+ const browser = locale ?? browserLocale()
+ const country = countryOf(browser)
+ const resolvedCurrency = currency ?? currencyForRegion(country)
+ // Los separadores y la posición del símbolo siguen al país: un browser en
+ // inglés en Argentina tiene que ver $50.000, no ARS 50,000. Con la locale
+ // pasada explícita no se toca nada (tests, print).
+ const resolved = locale === undefined ? (localeForRegion(country) ?? browser) : browser
+ const key = `${resolved ?? ''}|${resolvedCurrency ?? '$'}|${hasCents ? 'c' : 'i'}`
+
+ let formatter = priceFormatters.get(key)
+ if (!formatter) {
+ formatter = new Intl.NumberFormat(resolved, {
+ style: 'currency',
+ currency: resolvedCurrency ?? 'USD',
+ currencyDisplay: resolvedCurrency ? 'symbol' : 'narrowSymbol',
+ minimumFractionDigits: hasCents ? 2 : 0,
+ maximumFractionDigits: 2,
+ })
+ priceFormatters.set(key, formatter)
+ }
+ return tidyCurrencySpacing(formatter.format(price))
+}
+
+/* Intl separa el símbolo de la moneda con un espacio duro: "$ 50.000" se lee
+ como dos tokens sueltos. Lo quitamos solo cuando separa símbolo de número;
+ entre dígitos y código ("50.000 ARS") el no-break space evita el corte. */
+const SYMBOL_GAP = /([^\p{L}\p{N}])\u00A0/gu
+
+function tidyCurrencySpacing(value: string): string {
+ return value.replace(SYMBOL_GAP, '$1')
+}
+
+/* ── Teléfonos ──────────────────────────────────────────────────────────────
+
+ Presentación, nunca persistencia: los links wa.me siguen usando los dígitos
+ crudos. El formato sale de la región del propio número cuando su prefijo de
+ país es reconocible; si el número es nacional, manda la región del browser
+ (y si esa región no la conocemos, la de la app: AR). Si nada encaja se cae
+ a E.164 (+331234567890) o al valor original, siempre preferible a un número
+ inventado. */
+
+type PhoneRegion = 'AR' | 'US' | 'ES' | 'MX'
+
+/** Prefijos de país que sabemos agrupar. */
+const COUNTRY_CALLING_CODES: { region: PhoneRegion; code: string }[] = [
+ { region: 'AR', code: '54' },
+ { region: 'ES', code: '34' },
+ { region: 'MX', code: '52' },
+ { region: 'US', code: '1' },
+]
+
+export function formatPhoneDisplay(
+ value: string | null | undefined,
+ locale?: string,
+): string | null {
+ if (value == null) return null
+ const raw = value.trim()
+ if (!raw) return null
+
+ const hasPlus = raw.startsWith('+')
+ let digits = raw.replace(/\D/g, '')
+ // "0054…" es el mismo indicio internacional que "+54…".
+ const hasDoubleZero = !hasPlus && raw.startsWith('00')
+ if (hasDoubleZero) digits = digits.slice(2)
+ if (digits.length < 6) return raw
+
+ const withCallingCode = formatWithCallingCode(digits)
+ if (withCallingCode) return withCallingCode
+ if (hasPlus || hasDoubleZero) return `+${digits}`
+
+ return formatNational(digits, appRegion(countryOf(locale ?? browserLocale())), false) ?? raw
+}
+
+/** Prueba el prefijo de país solo si lo que sigue encaja en sus reglas. */
+function formatWithCallingCode(digits: string): string | null {
+ for (const { region, code } of COUNTRY_CALLING_CODES) {
+ if (!digits.startsWith(code)) continue
+ const formatted = formatNational(digits.slice(code.length), region, true)
+ if (formatted) return formatted
+ }
+ return null
+}
+
+/** Región ISO → región con reglas propias. CA comparte NANP con US. */
+function appRegion(region: string | undefined): PhoneRegion {
+ if (region === 'US' || region === 'CA') return 'US'
+ if (region === 'ES') return 'ES'
+ if (region === 'MX') return 'MX'
+ // Sin región reconocible seguimos siendo una app de Argentina.
+ return 'AR'
+}
+
+function formatNational(
+ digits: string,
+ region: PhoneRegion,
+ hasCallingCode: boolean,
+): string | null {
+ switch (region) {
+ case 'AR':
+ return formatArNational(digits, hasCallingCode)
+ case 'US':
+ return formatUsNational(digits)
+ case 'ES':
+ return formatEsNational(digits, hasCallingCode)
+ case 'MX':
+ return formatMxNational(digits, hasCallingCode)
+ }
+}
+
+function formatArNational(digits: string, withCountry: boolean): string | null {
+ let national = digits
+ let isMobile = false
+
+ // Móvil argentino: 9 + 10 dígitos nacionales.
+ if (national.length === 11 && national.startsWith('9')) {
+ national = national.slice(1)
+ isMobile = true
+ }
+ // 0 de trunk nacional: además implica que el número es argentino.
+ if (national.startsWith('0') && national.length >= 9) {
+ national = national.slice(1)
+ withCountry = true
+ }
+ if (national.length < 6 || national.length > 10) return null
+
+ const local = groupArNational(national)
+ const body = isMobile ? `9 ${local}` : local
+ return withCountry ? `+54 ${body}` : body
+}
+
+function groupArNational(digits: string): string {
+ if (digits.length === 10) {
+ // 11 es el único área de 2 dígitos (Gran Buenos Aires); el resto se
+ // agrupa 4-2-4, que es el patrón de las áreas de 4 dígitos.
+ return digits.startsWith('11')
+ ? `${digits.slice(0, 2)} ${digits.slice(2, 6)}-${digits.slice(6)}`
+ : `${digits.slice(0, 4)} ${digits.slice(4, 6)}-${digits.slice(6)}`
+ }
+ if (digits.length === 9) return `${digits.slice(0, 3)} ${digits.slice(3, 5)}-${digits.slice(5)}`
+ if (digits.length <= 8) return `${digits.slice(0, 4)} ${digits.slice(4)}`
+ return digits
+}
+
+/** NANP (US/CA): 10 dígitos con área e intercambio que arrancan en 2–9. */
+function formatUsNational(digits: string): string | null {
+ if (digits.length === 11 && digits.startsWith('1')) digits = digits.slice(1)
+ if (digits.length !== 10) return null
+ if (digits[0] === '0' || digits[0] === '1' || digits[3] === '0' || digits[3] === '1') return null
+ // Convención doméstica: el "1" del país no se escribe.
+ return `(${digits.slice(0, 3)}) ${digits.slice(3, 6)}-${digits.slice(6)}`
+}
+
+/** España: 9 dígitos (móvil 6/7, fijo 8/9) agrupados 3-2-2-2. */
+function formatEsNational(digits: string, withCountry: boolean): string | null {
+ if (digits.length !== 9 || !'6789'.includes(digits[0])) return null
+ const local = `${digits.slice(0, 3)} ${digits.slice(3, 5)} ${digits.slice(5, 7)} ${digits.slice(7)}`
+ return withCountry ? `+34 ${local}` : local
+}
+
+/** México: 10 dígitos agrupados 2-4-4. */
+function formatMxNational(digits: string, withCountry: boolean): string | null {
+ if (digits.length !== 10 || digits[0] === '0' || digits[0] === '1') return null
+ const local = `${digits.slice(0, 2)} ${digits.slice(2, 6)} ${digits.slice(6)}`
+ return withCountry ? `+52 ${local}` : local
+}
+
+// El vencimiento se cuenta como frase ("Vence el día 10 de cada mes") en vez
+// de "Vence día 10": se lee como una promesa, no como un dato suelto.
+export function formatBillingMeta(
+ billingType: BillingType | null,
+ dueDay: number | null,
+): string | null {
+ if (billingType === 'PER_CLASS') return BILLING_LABELS.PER_CLASS
+ if (billingType === 'MONTHLY') {
+ return dueDay ? `Vence el día ${dueDay} de cada mes` : BILLING_LABELS.MONTHLY
+ }
+ return null
+}
diff --git a/apps/web/src/lib/immersive-routes.ts b/apps/web/src/lib/immersive-routes.ts
new file mode 100644
index 0000000..b2efc6b
--- /dev/null
+++ b/apps/web/src/lib/immersive-routes.ts
@@ -0,0 +1,33 @@
+/* Rutas "immersive": las que arman su propia barra de navegación con
+ `LargeTitle` (título grande que colapsa) y por eso no muestran el header
+ global con logo + toggle de tema + avatar.
+
+ El patrón se resuelve a mano y no con `matchRoute` porque las dos rutas
+ llevan parámetros (`matchRoute` los exige) y porque las rutas hijas NO son
+ immersive aunque compartan prefijo: `/groups/:id/attendees/new` sigue usando
+ el header global. */
+
+const IMMERSIVE_SEGMENTS: ReadonlyArray = [
+ ['groups', ':id'],
+ ['groups', ':id', 'analytics'],
+ ['class', ':id', 'attendance'],
+]
+
+/* Rutas estáticas que ocupan el lugar de un parámetro. Sin esta lista
+ `/groups/new` (crear grupo) se tomaría por una ficha de grupo y perdería el
+ header global. */
+const STATIC_SEGMENTS: ReadonlySet = new Set(['new'])
+
+export function isImmersiveRoute(pathname: string) {
+ const segments = pathname.split('/').filter(Boolean)
+
+ return IMMERSIVE_SEGMENTS.some(
+ (pattern) =>
+ pattern.length === segments.length &&
+ pattern.every((part, index) => {
+ const segment = segments[index]
+ if (part.startsWith(':')) return !STATIC_SEGMENTS.has(segment)
+ return part === segment
+ }),
+ )
+}
diff --git a/apps/web/src/lib/region.ts b/apps/web/src/lib/region.ts
new file mode 100644
index 0000000..47e5b43
--- /dev/null
+++ b/apps/web/src/lib/region.ts
@@ -0,0 +1,271 @@
+/* De dónde es la persona y cómo se le escriben los números.
+
+ El idioma del browser dice en qué idioma se está, no en qué país se está:
+ con "en-US" a alguien en Argentina lo trata como estadounidense, y con
+ "es-419" no dice ningún país. La zona horaria —que sí expone el sistema—
+ es la señal del país real; el idioma solo define cuando la zona no se
+ conoce. Con el país resuelto salen la moneda (REGION_CURRENCY) y la
+ regional con la que se formatea (REGION_LOCALE), para que un browser en
+ inglés en Argentina vea $50.000 y no ARS 50,000.
+
+ Estos mapas son dato a mano (Intl no expone región → moneda ni región →
+ locale). Solo definen cómo se PINTA un importe: el valor persistido no
+ cambia ni se convierte. Si el país no está en ninguno, formatPrice cae al
+ símbolo $ genérico. */
+
+export const REGION_CURRENCY: Record = {
+ // Norteamérica
+ CA: 'CAD',
+ US: 'USD',
+
+ // Latinoamérica y Caribe
+ AR: 'ARS',
+ BO: 'BOB',
+ BR: 'BRL',
+ CL: 'CLP',
+ CO: 'COP',
+ CR: 'CRC',
+ CU: 'CUP',
+ DO: 'DOP',
+ EC: 'USD',
+ GT: 'GTQ',
+ HN: 'HNL',
+ MX: 'MXN',
+ NI: 'NIO',
+ PA: 'USD',
+ PE: 'PEN',
+ PR: 'USD',
+ PY: 'PYG',
+ SV: 'USD',
+ UY: 'UYU',
+ VE: 'VES',
+
+ // Zona euro
+ AT: 'EUR',
+ BE: 'EUR',
+ HR: 'EUR',
+ CY: 'EUR',
+ EE: 'EUR',
+ FI: 'EUR',
+ FR: 'EUR',
+ DE: 'EUR',
+ GR: 'EUR',
+ IE: 'EUR',
+ IT: 'EUR',
+ LV: 'EUR',
+ LT: 'EUR',
+ LU: 'EUR',
+ MT: 'EUR',
+ NL: 'EUR',
+ PT: 'EUR',
+ SK: 'EUR',
+ SI: 'EUR',
+ ES: 'EUR',
+
+ // Fuera de la zona euro
+ CH: 'CHF',
+ GB: 'GBP',
+ CZ: 'CZK',
+ DK: 'DKK',
+ NO: 'NOK',
+ PL: 'PLN',
+ RU: 'RUB',
+ SE: 'SEK',
+ TR: 'TRY',
+ UA: 'UAH',
+}
+
+/** Regional con la que se formatea para cada país. México y Argentina usan
+ separadores distintos (1,234.56 vs 1.234,56), así que el locale va con el
+ país y no solo con el idioma. */
+export const REGION_LOCALE: Record = {
+ // Norteamérica
+ CA: 'en-CA',
+ US: 'en-US',
+
+ // Latinoamérica y Caribe
+ AR: 'es-AR',
+ BO: 'es-BO',
+ BR: 'pt-BR',
+ CL: 'es-CL',
+ CO: 'es-CO',
+ CR: 'es-CR',
+ CU: 'es-CU',
+ DO: 'es-DO',
+ EC: 'es-EC',
+ GT: 'es-GT',
+ HN: 'es-HN',
+ MX: 'es-MX',
+ NI: 'es-NI',
+ PA: 'es-PA',
+ PE: 'es-PE',
+ PR: 'es-PR',
+ PY: 'es-PY',
+ SV: 'es-SV',
+ UY: 'es-UY',
+ VE: 'es-VE',
+
+ // Zona euro
+ AT: 'de-AT',
+ BE: 'nl-BE',
+ HR: 'hr-HR',
+ CY: 'el-CY',
+ EE: 'et-EE',
+ FI: 'fi-FI',
+ FR: 'fr-FR',
+ DE: 'de-DE',
+ GR: 'el-GR',
+ IE: 'en-IE',
+ IT: 'it-IT',
+ LV: 'lv-LV',
+ LT: 'lt-LT',
+ LU: 'fr-LU',
+ MT: 'mt-MT',
+ NL: 'nl-NL',
+ PT: 'pt-PT',
+ SK: 'sk-SK',
+ SI: 'sl-SI',
+ ES: 'es-ES',
+
+ // Fuera de la zona euro
+ CH: 'de-CH',
+ GB: 'en-GB',
+ CZ: 'cs-CZ',
+ DK: 'da-DK',
+ NO: 'nb-NO',
+ PL: 'pl-PL',
+ RU: 'ru-RU',
+ SE: 'sv-SE',
+ TR: 'tr-TR',
+ UA: 'uk-UA',
+}
+
+/* Zona horaria IANA → región ISO 3166-1 alpha-2.
+
+ Cobertura: las zonas de los países de arriba, agrupadas por prefijo
+ (America/Argentina/*) o por la ciudad en la zona (Sao_Paulo). Cubre las
+ zonas principales; una zona desconocida cae al país del idioma. */
+export const TIMEZONE_REGION: Record = {
+ // ── Latinoamérica ─────────────────────────────────────────────────────────
+ 'America/Argentina/': 'AR',
+ // Chromium/ICU reporta en la forma legacy (sin el prefijo "Argentina/") las
+ // zonas argentinas más comunes: America/Argentina/Buenos_Aires → America/Buenos_Aires.
+ 'America/Buenos_Aires': 'AR',
+ 'America/Catamarca': 'AR',
+ 'America/Cordoba': 'AR',
+ 'America/Jujuy': 'AR',
+ 'America/Mendoza': 'AR',
+ 'America/La_Paz': 'BO',
+ 'America/Sao_Paulo': 'BR',
+ 'America/Fortaleza': 'BR',
+ 'America/Recife': 'BR',
+ 'America/Bahia': 'BR',
+ 'America/Manaus': 'BR',
+ 'America/Cuiaba': 'BR',
+ 'America/Porto_Velho': 'BR',
+ 'America/Noronha': 'BR',
+ 'America/Campo_Grande': 'BR',
+ 'America/Santiago': 'CL',
+ 'America/Bogota': 'CO',
+ 'America/Lima': 'PE',
+ 'America/Asuncion': 'PY',
+ 'America/Montevideo': 'UY',
+ 'America/Caracas': 'VE',
+ 'America/Guayaquil': 'EC',
+ 'America/Panama': 'PA',
+ 'America/Managua': 'NI',
+ 'America/Tegucigalpa': 'HN',
+ 'America/El_Salvador': 'SV',
+ 'America/Guatemala': 'GT',
+ 'America/Costa_Rica': 'CR',
+ 'America/Havana': 'CU',
+ 'America/Santo_Domingo': 'DO',
+ 'America/Puerto_Rico': 'PR',
+
+ // ── Norteamérica ─────────────────────────────────────────────────────────
+ 'America/New_York': 'US',
+ 'America/Detroit': 'US',
+ 'America/Chicago': 'US',
+ 'America/Denver': 'US',
+ 'America/Phoenix': 'US',
+ 'America/Los_Angeles': 'US',
+ 'America/Anchorage': 'US',
+ 'Pacific/Honolulu': 'US',
+ 'America/Toronto': 'CA',
+ 'America/Vancouver': 'CA',
+ 'America/Winnipeg': 'CA',
+ 'America/Edmonton': 'CA',
+ 'America/Halifax': 'CA',
+ 'America/Regina': 'CA',
+ 'America/St_Johns': 'CA',
+
+ // ── Europa ───────────────────────────────────────────────────────────────
+ 'Europe/Madrid': 'ES',
+ 'Atlantic/Canary': 'ES',
+ 'Atlantic/Faeroe': 'ES',
+ 'Europe/Lisbon': 'PT',
+ 'Europe/Rome': 'IT',
+ 'Europe/Paris': 'FR',
+ 'Europe/Berlin': 'DE',
+ 'Europe/Vienna': 'AT',
+ 'Europe/Brussels': 'BE',
+ 'Europe/Amsterdam': 'NL',
+ 'Europe/Dublin': 'IE',
+ 'Europe/Zurich': 'CH',
+ 'Europe/London': 'GB',
+ 'Europe/Copenhagen': 'DK',
+ 'Europe/Oslo': 'NO',
+ 'Europe/Stockholm': 'SE',
+ 'Europe/Warsaw': 'PL',
+ 'Europe/Prague': 'CZ',
+ 'Europe/Helsinki': 'FI',
+ 'Europe/Athens': 'GR',
+ 'Europe/Kyiv': 'UA',
+ 'Europe/Kiev': 'UA',
+ 'Europe/Moscow': 'RU',
+ 'Europe/Istanbul': 'TR',
+}
+
+const ZONE_PREFIXES = Object.keys(TIMEZONE_REGION).filter((zone) => zone.endsWith('/'))
+
+export function browserTimezone(): string | undefined {
+ try {
+ return Intl.DateTimeFormat().resolvedOptions().timeZone || undefined
+ } catch {
+ return undefined
+ }
+}
+
+export function regionForTimezone(timezone: string | undefined): string | undefined {
+ if (!timezone) return undefined
+ const exact = TIMEZONE_REGION[timezone]
+ if (exact) return exact
+ const prefix = ZONE_PREFIXES.find((zone) => timezone.startsWith(zone))
+ return prefix ? TIMEZONE_REGION[prefix] : undefined
+}
+
+/** Región del locale (es-MX → MX). Un locale sin país se maximiza, pero solo
+ como último recurso: countryOf prefiere la zona horaria. */
+export function regionOf(locale: string | undefined): string | undefined {
+ if (!locale || typeof Intl.Locale === 'undefined') return undefined
+ try {
+ return new Intl.Locale(locale).maximize().region
+ } catch {
+ return undefined
+ }
+}
+
+/** País de la persona: el de la zona horaria, y si no se conoce, el del
+ idioma. `en` sin país no se maximiza a US a propósito: un usuario en
+ México con el browser en inglés caería en dólares. */
+export function countryOf(locale: string | undefined): string | undefined {
+ return regionForTimezone(browserTimezone()) ?? regionOf(locale)
+}
+
+export function currencyForRegion(region: string | undefined): string | undefined {
+ return region ? REGION_CURRENCY[region] : undefined
+}
+
+export function localeForRegion(region: string | undefined): string | undefined {
+ return region ? REGION_LOCALE[region] : undefined
+}
diff --git a/apps/web/test/format.test.ts b/apps/web/test/format.test.ts
new file mode 100644
index 0000000..9a2db83
--- /dev/null
+++ b/apps/web/test/format.test.ts
@@ -0,0 +1,299 @@
+import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
+import { formatPhoneDisplay, formatPrice } from '../src/lib/format'
+import {
+ browserTimezone,
+ countryOf,
+ currencyForRegion,
+ localeForRegion,
+ REGION_CURRENCY,
+ REGION_LOCALE,
+ regionForTimezone,
+ regionOf,
+ TIMEZONE_REGION,
+} from '../src/lib/region'
+
+/* Un importe se pinta con el país de la persona: su moneda y su regional
+ (separadores, posición del símbolo). El país sale de la zona horaria del
+ sistema y, si no se conoce, del idioma del browser. El valor persistido no
+ cambia: no hay conversión. */
+
+const nav = globalThis as { navigator?: { language?: string; languages?: string[] } }
+
+function stubLanguage(language: string) {
+ Object.defineProperty(globalThis, 'navigator', {
+ value: { language, languages: [language] },
+ configurable: true,
+ writable: true,
+ })
+}
+
+function restoreNavigator() {
+ delete (nav as { navigator?: unknown }).navigator
+}
+
+/** Simula el navegador: idioma y zona horaria del sistema. */
+function stubLocation(language: string, timezone: string) {
+ stubLanguage(language)
+ const original = Intl.DateTimeFormat
+ // Callable sin new, como Intl.DateTimeFormat().
+ const fake = () => ({ resolvedOptions: () => ({ timeZone: timezone }) })
+ ;(Intl as { DateTimeFormat: unknown }).DateTimeFormat = fake as never
+ return () => {
+ ;(Intl as { DateTimeFormat: unknown }).DateTimeFormat = original
+ }
+}
+
+/** Ejecuta fn con un navegador simulado y deja todo como estaba. */
+function withLocation(language: string, timezone: string, fn: () => void) {
+ const restore = stubLocation(language, timezone)
+ try {
+ fn()
+ } finally {
+ restore()
+ }
+}
+
+/** Pinta el importe como lo vería un browser con esa locale. */
+function priceFor(amount: number, language: string): string {
+ stubLanguage(language)
+ return formatPrice(amount)
+}
+
+describe('formatPrice — país del browser', () => {
+ beforeEach(() => stubLanguage('es-AR'))
+ afterEach(() => restoreNavigator())
+
+ test('el idioma del browser define moneda y regional', () => {
+ expect(priceFor(50_000, 'es-AR')).toBe('$50.000')
+ expect(priceFor(50_000, 'es-MX')).toBe('$50,000')
+ expect(priceFor(50_000, 'es-PE')).toBe('S/50,000')
+ expect(priceFor(50_000, 'pt-BR')).toBe('R$50.000')
+ expect(priceFor(50_000, 'es-ES')).toBe('50.000\u00A0€')
+ expect(priceFor(50_000, 'en-US')).toBe('$50,000')
+ expect(priceFor(50_000, 'en-CA')).toBe('$50,000')
+ })
+
+ test('la zona horaria define el país si el idioma no lo dice', () => {
+ // Browser en inglés, usuario en Argentina: pesos y separador de miles argentino.
+ withLocation('en-US', 'America/Argentina/Buenos_Aires', () => {
+ expect(formatPrice(50_000)).toBe('$50.000')
+ })
+ })
+
+ test('la zona horaria gana sobre el idioma del browser', () => {
+ withLocation('es-MX', 'America/Argentina/Buenos_Aires', () => {
+ expect(formatPrice(50_000)).toBe('$50.000')
+ })
+ })
+
+ test('la zona horaria cubre otros países', () => {
+ withLocation('es-419', 'America/Lima', () => {
+ expect(formatPrice(50_000)).toBe('S/50,000')
+ })
+ withLocation('es-419', 'America/Mexico_City', () => {
+ expect(formatPrice(50_000)).toBe('$50,000')
+ })
+ withLocation('es-419', 'Europe/Madrid', () => {
+ expect(formatPrice(50_000)).toBe('50.000\u00A0€')
+ })
+ })
+
+ test('los centavos se conservan', () => {
+ expect(priceFor(50_000.5, 'es-AR')).toBe('$50.000,50')
+ expect(priceFor(50_000.5, 'es-MX')).toBe('$50,000.50')
+ })
+
+ test('sin país ni zona conocida se ve el símbolo $', () => {
+ withLocation('es-419', 'Africa/Algiers', () => {
+ expect(formatPrice(50_000)).toBe('$50,000')
+ })
+ })
+
+ test('sin browser se ve el símbolo $ con la regional del runtime', () => {
+ restoreNavigator()
+ const value = formatPrice(50_000)
+ expect(value).toContain('$')
+ expect(value).toContain('50')
+ expect(value).not.toContain('ARS')
+ })
+
+ test('por defecto usa la locale del browser', () => {
+ stubLanguage('en-US')
+ expect(formatPrice(50_000)).toBe('$50,000')
+ })
+
+ test('importes nulos y cero', () => {
+ expect(formatPrice(null)).toBe('—')
+ expect(priceFor(0, 'es-AR')).toBe('$0')
+ })
+})
+
+describe('formatPrice — moneda y locale explícitos', () => {
+ beforeEach(() => stubLanguage('es-AR'))
+ afterEach(() => restoreNavigator())
+
+ test('separa y posiciona según la locale pedida', () => {
+ expect(formatPrice(50_000, 'ARS', 'es-AR')).toBe('$50.000')
+ expect(formatPrice(50_000, 'ARS', 'en-US')).toBe('ARS\u00A050,000')
+ expect(formatPrice(50_000, 'ARS', 'es-ES')).toBe('50.000\u00A0ARS')
+ })
+
+ test('muestra centavos solo cuando el importe los tiene', () => {
+ expect(formatPrice(50_000.5, 'ARS', 'en-US')).toBe('ARS\u00A050,000.50')
+ expect(formatPrice(50_000.5, 'ARS', 'es-AR')).toBe('$50.000,50')
+ expect(formatPrice(50_000, 'ARS', 'en-US')).toBe('ARS\u00A050,000')
+ })
+
+ test('ganan sobre el país del browser', () => {
+ withLocation('en-US', 'America/Lima', () => {
+ expect(formatPrice(50_000, 'ARS', 'es-AR')).toBe('$50.000')
+ expect(formatPrice(50_000, 'ARS', 'en-US')).toBe('ARS\u00A050,000')
+ })
+ })
+})
+
+describe('region', () => {
+ test('el mapa de monedas usa códigos ISO válidos', () => {
+ const known = Intl.supportedValuesOf('currency')
+ for (const [region, currency] of Object.entries(REGION_CURRENCY)) {
+ expect(region).toMatch(/^[A-Z]{2}$/)
+ expect(currency).toMatch(/^[A-Z]{3}$/)
+ expect(known).toContain(currency)
+ }
+ })
+
+ test('el mapa de zonas usa códigos ISO y zonas reales', () => {
+ for (const [zone, region] of Object.entries(TIMEZONE_REGION)) {
+ expect(region).toMatch(/^[A-Z]{2}$/)
+ if (zone.endsWith('/')) continue
+ expect(() => new Intl.DateTimeFormat('en-US', { timeZone: zone })).not.toThrow()
+ }
+ })
+
+ test('las locales por país son tags válidos y cubren a los países', () => {
+ for (const [region, locale] of Object.entries(REGION_LOCALE)) {
+ expect(region).toMatch(/^[A-Z]{2}$/)
+ expect(locale).toMatch(/^[a-z]{2}-[A-Z]{2}$/)
+ expect(() => new Intl.NumberFormat(locale)).not.toThrow()
+ }
+ for (const region of Object.keys(REGION_CURRENCY)) {
+ expect(localeForRegion(region)).toBeDefined()
+ }
+ })
+
+ test('el mapa de zonas cubre países que tienen moneda', () => {
+ for (const zone of Object.keys(TIMEZONE_REGION)) {
+ const resolvable = zone.endsWith('/') ? `${zone}Test` : zone
+ expect(currencyForRegion(regionForTimezone(resolvable))).toBeDefined()
+ }
+ })
+
+ test('resuelve la zona por ciudad y por prefijo', () => {
+ expect(regionForTimezone('America/Argentina/Buenos_Aires')).toBe('AR')
+ expect(regionForTimezone('America/Argentina/Catamarca')).toBe('AR')
+ expect(regionForTimezone('America/Sao_Paulo')).toBe('BR')
+ expect(regionForTimezone('America/Lima')).toBe('PE')
+ expect(regionForTimezone('Europe/Madrid')).toBe('ES')
+ expect(regionForTimezone('Asia/Tokyo')).toBeUndefined()
+ expect(regionForTimezone('Africa/Algiers')).toBeUndefined()
+ expect(regionForTimezone('UTC')).toBeUndefined()
+ expect(regionForTimezone(undefined)).toBeUndefined()
+ })
+
+ test('las zonas legacy que reporta el browser también resuelven', () => {
+ // Chromium/ICU canonicaliza America/Argentina/X a America/X.
+ expect(regionForTimezone('America/Buenos_Aires')).toBe('AR')
+ expect(regionForTimezone('America/Catamarca')).toBe('AR')
+ expect(regionForTimezone('America/Mendoza')).toBe('AR')
+ })
+
+ test('resuelve el país: la zona horaria primero', () => {
+ withLocation('en-US', 'America/Argentina/Buenos_Aires', () => {
+ expect(countryOf('en-US')).toBe('AR')
+ })
+ withLocation('es-419', 'America/Lima', () => {
+ expect(countryOf('es-419')).toBe('PE')
+ })
+ // Sin zona conocida manda el idioma.
+ withLocation('es-MX', 'Africa/Algiers', () => {
+ expect(countryOf('es-MX')).toBe('MX')
+ })
+ })
+
+ test('regionOf usa el locale que le pasan', () => {
+ expect(regionOf('es-MX')).toBe('MX')
+ expect(regionOf('es-419')).toBe('419')
+ expect(regionOf('pt-BR')).toBe('BR')
+ expect(regionOf(undefined)).toBeUndefined()
+ })
+
+ test('lookup de moneda y regional por región', () => {
+ expect(currencyForRegion('PE')).toBe('PEN')
+ expect(currencyForRegion('MX')).toBe('MXN')
+ expect(currencyForRegion('ES')).toBe('EUR')
+ expect(currencyForRegion('US')).toBe('USD')
+ expect(currencyForRegion('419')).toBeUndefined()
+ expect(currencyForRegion('SE')).toBe('SEK')
+ expect(currencyForRegion(undefined)).toBeUndefined()
+ expect(localeForRegion('AR')).toBe('es-AR')
+ expect(localeForRegion('BR')).toBe('pt-BR')
+ expect(localeForRegion('419')).toBeUndefined()
+ expect(localeForRegion(undefined)).toBeUndefined()
+ })
+
+ test('el runtime expone una zona horaria', () => {
+ // bun test corre en UTC; en el browser es la zona del sistema.
+ expect(browserTimezone()).toBeTruthy()
+ })
+})
+
+describe('formatPhoneDisplay — región del número y país del browser', () => {
+ beforeEach(() => stubLanguage('es-AR'))
+ afterEach(() => restoreNavigator())
+
+ test('números argentinos conservan el formato actual', () => {
+ expect(formatPhoneDisplay('+5492954667788', 'es-AR')).toBe('+54 9 2954 66-7788')
+ expect(formatPhoneDisplay('5490989009988', 'es-AR')).toBe('+54 9 989 00-9988')
+ expect(formatPhoneDisplay('0989009988', 'es-AR')).toBe('+54 989 00-9988')
+ expect(formatPhoneDisplay('2983649550', 'es-AR')).toBe('2983 64-9550')
+ })
+
+ test('número irreconocible se devuelve tal cual', () => {
+ expect(formatPhoneDisplay('3209872223344', 'es-AR')).toBe('3209872223344')
+ expect(formatPhoneDisplay('12345', 'es-AR')).toBe('12345')
+ expect(formatPhoneDisplay(null)).toBeNull()
+ expect(formatPhoneDisplay('')).toBeNull()
+ })
+
+ test('números de otra región usan las reglas de esa región', () => {
+ expect(formatPhoneDisplay('+12125551234', 'es-AR')).toBe('(212) 555-1234')
+ expect(formatPhoneDisplay('+34612345678', 'es-AR')).toBe('+34 612 34 56 78')
+ expect(formatPhoneDisplay('+525512345678', 'es-AR')).toBe('+52 55 1234 5678')
+ })
+
+ test('nacional sin prefijo se agrupa según el país del browser', () => {
+ expect(formatPhoneDisplay('2125551234', 'en-US')).toBe('(212) 555-1234')
+ expect(formatPhoneDisplay('612345678', 'es-ES')).toBe('612 34 56 78')
+ expect(formatPhoneDisplay('5512345678', 'es-MX')).toBe('55 1234 5678')
+ })
+
+ test('la zona horaria define el país de los números nacionales', () => {
+ withLocation('en-US', 'America/Argentina/Buenos_Aires', () => {
+ expect(formatPhoneDisplay('3364609550')).toBe('3364 60-9550')
+ })
+ })
+
+ test('el prefijo del número manda sobre el país del browser', () => {
+ expect(formatPhoneDisplay('+5492954667788', 'en-US')).toBe('+54 9 2954 66-7788')
+ })
+
+ test('región sin reglas propias cae a E.164', () => {
+ expect(formatPhoneDisplay('+331234567890', 'es-AR')).toBe('+331234567890')
+ expect(formatPhoneDisplay('00331234567890', 'es-AR')).toBe('+331234567890')
+ })
+
+ test('por defecto usa el país del browser', () => {
+ stubLanguage('en-US')
+ expect(formatPhoneDisplay('2125551234')).toBe('(212) 555-1234')
+ })
+})
diff --git a/apps/web/test/immersive-routes.test.ts b/apps/web/test/immersive-routes.test.ts
new file mode 100644
index 0000000..d17927f
--- /dev/null
+++ b/apps/web/test/immersive-routes.test.ts
@@ -0,0 +1,35 @@
+import { describe, expect, test } from 'bun:test'
+import { isImmersiveRoute } from '../src/lib/immersive-routes'
+
+/* Solo las pantallas con Large Title arman su propia barra. Todo lo demás
+ —incluidas las rutas hijas de un grupo— sigue con el header global. */
+
+describe('isImmersiveRoute', () => {
+ test('la ficha de grupo, sus estadísticas y la asistencia son immersive', () => {
+ expect(isImmersiveRoute('/groups/cm1234')).toBe(true)
+ expect(isImmersiveRoute('/groups/cm1234/analytics')).toBe(true)
+ expect(isImmersiveRoute('/class/ses_987/attendance')).toBe(true)
+ })
+
+ test('las rutas hijas del grupo no lo son', () => {
+ expect(isImmersiveRoute('/groups')).toBe(false)
+ expect(isImmersiveRoute('/groups/')).toBe(false)
+ expect(isImmersiveRoute('/groups/new')).toBe(false)
+ expect(isImmersiveRoute('/groups/cm1234/attendees/new')).toBe(false)
+ expect(isImmersiveRoute('/groups/cm1234/attendees/at_55')).toBe(false)
+ })
+
+ test('el resto de la app mantiene el header global', () => {
+ expect(isImmersiveRoute('/')).toBe(false)
+ expect(isImmersiveRoute('/payments')).toBe(false)
+ expect(isImmersiveRoute('/settings')).toBe(false)
+ expect(isImmersiveRoute('/class/ses_987')).toBe(false)
+ })
+
+ test('el chequeo es por segmento exacto, no por prefijo', () => {
+ expect(isImmersiveRoute('/grupos/cm1234')).toBe(false)
+ expect(isImmersiveRoute('/clas/ses_987/attendance')).toBe(false)
+ expect(isImmersiveRoute('/grup')).toBe(false)
+ expect(isImmersiveRoute('/groups/cm1234/analytics/extra')).toBe(false)
+ })
+})
diff --git a/package.json b/package.json
index 9043451..b75742a 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,7 @@
"lint": "turbo lint",
"lint:fix": "turbo lint:fix",
"typecheck": "turbo typecheck",
- "test": "bun --filter @gruperly/backend test",
+ "test": "bun --filter @gruperly/backend test && bun --filter @gruperly/web test",
"db:generate": "bun --filter @gruperly/backend db:generate",
"db:migrate": "bun --filter @gruperly/backend db:migrate",
"db:push": "bun --filter @gruperly/backend db:push",
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts
index 5573f7a..a0f8125 100644
--- a/packages/shared/src/index.ts
+++ b/packages/shared/src/index.ts
@@ -10,5 +10,6 @@ export * from './schemas/home.js';
export * from './schemas/onboarding.js';
export * from './schemas/pagination.js';
export * from './schemas/payments.js';
+export * from './schemas/preregistrations.js';
export * from './schemas/problem-details.js';
export * from './schemas/waitlist.js';
\ No newline at end of file
diff --git a/packages/shared/src/schemas/attendees.ts b/packages/shared/src/schemas/attendees.ts
index be77c15..7833e50 100644
--- a/packages/shared/src/schemas/attendees.ts
+++ b/packages/shared/src/schemas/attendees.ts
@@ -77,7 +77,7 @@ export const JoinGroupViaInviteSchema = z.object({
export type JoinGroupViaInvite = z.output;
export const JoinGroupViaInviteResultSchema = z.object({
- status: z.enum(['registered', 'waitlisted']),
+ status: z.literal('pre_registered'),
message: z.string(),
attendee: AttendeeDtoSchema.nullable(),
});
diff --git a/packages/shared/src/schemas/preregistrations.ts b/packages/shared/src/schemas/preregistrations.ts
new file mode 100644
index 0000000..656aebf
--- /dev/null
+++ b/packages/shared/src/schemas/preregistrations.ts
@@ -0,0 +1,54 @@
+import { z } from 'zod';
+import { AttendeeDtoSchema } from './attendees.js';
+import { createPageSchema, createPageSizeSchema, createPaginationSchema } from './pagination.js';
+import { GroupWaitlistEntryDtoSchema } from './waitlist.js';
+
+const isoDateTimeSchema = z.string().datetime();
+const pageSchema = createPageSchema();
+const pageSizeSchema = createPageSizeSchema(10);
+const paginationSchema = createPaginationSchema();
+
+export const preRegistrationStatusSchema = z.enum(['PENDING', 'APPROVED', 'REJECTED']);
+export type PreRegistrationStatus = z.output;
+
+export const GroupPreRegistrationDtoSchema = z.object({
+ id: z.string(),
+ groupId: z.string(),
+ fullName: z.string(),
+ phone: z.string(),
+ email: z.string().nullable(),
+ status: preRegistrationStatusSchema,
+ reviewedAt: isoDateTimeSchema.nullable(),
+ createdAt: isoDateTimeSchema,
+ updatedAt: isoDateTimeSchema,
+});
+export type GroupPreRegistrationDto = z.output;
+
+export const GroupPreRegistrationQuerySchema = z.object({
+ page: pageSchema,
+ pageSize: pageSizeSchema,
+ status: preRegistrationStatusSchema.optional(),
+});
+export type GroupPreRegistrationQuery = z.output;
+
+export const GroupPreRegistrationListSchema = z.object({
+ data: z.array(GroupPreRegistrationDtoSchema),
+ pagination: paginationSchema,
+});
+export type GroupPreRegistrationList = z.output;
+
+export const ApproveGroupPreRegistrationResultSchema = z.object({
+ outcome: z.enum(['added', 'waitlisted']),
+ attendee: AttendeeDtoSchema.nullable(),
+ waitlistEntry: GroupWaitlistEntryDtoSchema.nullable(),
+});
+export type ApproveGroupPreRegistrationResult = z.output<
+ typeof ApproveGroupPreRegistrationResultSchema
+>;
+
+export const RejectGroupPreRegistrationResultSchema = z.object({
+ entry: GroupPreRegistrationDtoSchema,
+});
+export type RejectGroupPreRegistrationResult = z.output<
+ typeof RejectGroupPreRegistrationResultSchema
+>;