feat(groups): kids groups with an adult in charge
- Add the `kidsGroups` plan feature (Pro) and `Group.audience` (ADULTS | KIDS); creating or switching a group to KIDS requires the feature, existing KIDS groups keep working after a downgrade. - Model the adult in charge as a Person linked through `person_guardians`; migrate the old guardian_name/guardian_phone columns and drop them. - Kids quick add: kid + guardian form, guardian lookup by phone to pick an existing kid or add a sibling; backend rejects KIDS adds without guardian. - Attendee page: "Adulto a cargo" section with siblings, editable via PATCH /groups/:gid/attendees/:aid/guardian. - Contact phone (WhatsApp jobs, attention, student access invite, students at risk, attendee actions) prefers the guardian's phone. - Edit group screen (PATCH /groups/:gid, owner only); switching back to ADULTS is blocked while kids have no phone of their own. - Hide bulk import in KIDS groups until it carries guardian data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -62,6 +62,11 @@ export function PlanLimitsCard({ plan, limits }: { plan: Plan; limits: PlanLimit
|
||||
checked={draft.whatsappAutomations}
|
||||
onChange={(whatsappAutomations) => setDraft({ ...draft, whatsappAutomations })}
|
||||
/>
|
||||
<FeatureSwitch
|
||||
label={t('plans.limits.kidsGroups')}
|
||||
checked={draft.kidsGroups}
|
||||
onChange={(kidsGroups) => setDraft({ ...draft, kidsGroups })}
|
||||
/>
|
||||
|
||||
<LimitsImpact plan={plan} draft={draft} current={limits} />
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useId, useState } from 'react'
|
||||
import { Check, Copy, MessageCircle } from 'lucide-react'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { useAttendeeDetail } from './AttendeeDetailProvider'
|
||||
import { reachPhone } from './detail'
|
||||
import { ACTION_BUTTON_CLASS, PRIMARY_ACTION_CLASS } from './actionButton'
|
||||
import { Section } from './Section'
|
||||
import { useCopyToClipboard } from './useCopyToClipboard'
|
||||
@@ -18,7 +19,7 @@ export function AbsenceLinkSection() {
|
||||
const url = token ? `${window.location.origin}/report-absence/${token}` : null
|
||||
if (!attendee || !url) return null
|
||||
|
||||
const phoneDigits = attendee.phone?.replace(/\D/g, '') ?? ''
|
||||
const phoneDigits = reachPhone(attendee)?.replace(/\D/g, '') ?? ''
|
||||
const shareUrl = phoneDigits
|
||||
? `https://wa.me/${phoneDigits}?text=${encodeURIComponent(
|
||||
t('absenceLink.message', { name: attendee.fullName.split(' ')[0], url }),
|
||||
|
||||
@@ -3,15 +3,16 @@ import { formatPhoneDisplay } from '../../lib/format'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { ACTION_BUTTON_CLASS, PRIMARY_ACTION_CLASS } from './actionButton'
|
||||
import { useAttendeeDetail } from './AttendeeDetailProvider'
|
||||
import { reachPhone } from './detail'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export function AttendeeContactActions() {
|
||||
const { attendee } = useAttendeeDetail()
|
||||
const { t } = useTranslation(['attendeeDetail', 'common'])
|
||||
|
||||
const phone = attendee?.phone
|
||||
const phone = attendee ? reachPhone(attendee) : null
|
||||
const digits = phone?.replace(/\D/g, '') ?? ''
|
||||
const label = formatPhoneDisplay(phone) ?? attendee?.fullName ?? t('actions.theMember')
|
||||
const label = attendee?.guardianName ?? formatPhoneDisplay(phone) ?? attendee?.fullName ?? t('actions.theMember')
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -123,7 +123,7 @@ type ContactRowProps = {
|
||||
placeholder: boolean
|
||||
}
|
||||
|
||||
function ContactRow({ icon: Icon, label, value, href, placeholder }: ContactRowProps) {
|
||||
export function ContactRow({ icon: Icon, label, value, href, placeholder }: ContactRowProps) {
|
||||
const content = (
|
||||
<>
|
||||
<Icon className="size-4 shrink-0 text-secondary" aria-hidden="true" />
|
||||
|
||||
@@ -8,6 +8,7 @@ import type {
|
||||
GroupListItem,
|
||||
GroupWaitlistEntryDto,
|
||||
UpdateAttendee,
|
||||
GuardianInput,
|
||||
} from '@gruperly/shared'
|
||||
import { errorMessage } from '../../i18n'
|
||||
import { i18n } from '../../i18n/instance'
|
||||
@@ -18,6 +19,7 @@ import {
|
||||
getAttendeeHistory,
|
||||
getGroup,
|
||||
getGroupAttendee,
|
||||
updateAttendeeGuardian,
|
||||
getGroups,
|
||||
getGroupWaitlist,
|
||||
moveGroupAttendee,
|
||||
@@ -42,6 +44,10 @@ type AttendeeDetailContextValue = {
|
||||
endContactEdit: () => void
|
||||
saveAttendee: (input: UpdateAttendee) => Promise<void>
|
||||
isUpdatingAttendee: boolean
|
||||
/** KIDS: el contacto del chico es su adulto a cargo. */
|
||||
isKidsGroup: boolean
|
||||
saveGuardian: (input: GuardianInput) => Promise<void>
|
||||
isUpdatingGuardian: boolean
|
||||
isRemoveDialogOpen: boolean
|
||||
openRemoveDialog: () => void
|
||||
closeRemoveDialog: () => void
|
||||
@@ -106,6 +112,19 @@ export function AttendeeDetailProvider({
|
||||
},
|
||||
})
|
||||
|
||||
const guardianMutation = useMutation({
|
||||
mutationFn: (input: GuardianInput) => updateAttendeeGuardian(groupId, attendeeId, input),
|
||||
onSuccess: (updated) => {
|
||||
queryClient.setQueryData<AttendeeDetailDto>(
|
||||
['group-attendee', groupId, attendeeId],
|
||||
(current) => (current ? { ...current, ...updated } : current),
|
||||
)
|
||||
// El adulto es de todos sus chicos: cambia también en las fichas de los hermanos.
|
||||
void queryClient.invalidateQueries({ queryKey: ['group-attendees'] })
|
||||
void queryClient.invalidateQueries({ queryKey: ['group-attendee'] })
|
||||
},
|
||||
})
|
||||
|
||||
// Same key the analytics screen uses: both read the same history and do not
|
||||
// clobber each other's cache.
|
||||
const historyQuery = useQuery({
|
||||
@@ -218,6 +237,11 @@ export function AttendeeDetailProvider({
|
||||
await updateMutation.mutateAsync(input)
|
||||
},
|
||||
isUpdatingAttendee: updateMutation.isPending,
|
||||
isKidsGroup: groupQuery.data?.audience === 'KIDS',
|
||||
saveGuardian: async (input) => {
|
||||
await guardianMutation.mutateAsync(input)
|
||||
},
|
||||
isUpdatingGuardian: guardianMutation.isPending,
|
||||
isRemoveDialogOpen,
|
||||
openRemoveDialog: () => setIsRemoveDialogOpen(true),
|
||||
closeRemoveDialog: () => setIsRemoveDialogOpen(false),
|
||||
|
||||
@@ -10,6 +10,7 @@ import { AttendeeContactActions } from './AttendeeContactActions'
|
||||
import { AttendeeContactSection } from './AttendeeContactSection'
|
||||
import { AttendeeNotesSection } from './AttendeeNotesSection'
|
||||
import { AttendeePaymentsSection } from './AttendeePaymentsSection'
|
||||
import { GuardianSection } from './GuardianSection'
|
||||
import { OtherGroupsSection } from './OtherGroupsSection'
|
||||
import { useAttendeeDetail } from './AttendeeDetailProvider'
|
||||
import { ChangeGroupDialog } from './ChangeGroupDialog'
|
||||
@@ -91,6 +92,7 @@ export function AttendeeDetailView() {
|
||||
|
||||
<div className="mt-6">
|
||||
<AttendeeContactSection />
|
||||
<GuardianSection />
|
||||
<OtherGroupsSection />
|
||||
<StudentAccessSection />
|
||||
<AttendeePaymentsSection />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Check } from 'lucide-react'
|
||||
import { formatPhoneDisplay } from '../../lib/format'
|
||||
import { useAttendeeDetail } from './AttendeeDetailProvider'
|
||||
import { reachPhone } from './detail'
|
||||
import { useCopyToClipboard } from './useCopyToClipboard'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@@ -15,7 +16,7 @@ export function AttendeePhoneLine() {
|
||||
const { copied, copy } = useCopyToClipboard()
|
||||
const { t } = useTranslation(['attendeeDetail', 'common'])
|
||||
|
||||
const phone = attendee?.phone
|
||||
const phone = attendee ? reachPhone(attendee) : null
|
||||
const label = formatPhoneDisplay(phone)
|
||||
if (!phone || !label) return null
|
||||
|
||||
|
||||
145
apps/web/src/features/attendee-detail/GuardianSection.tsx
Normal file
145
apps/web/src/features/attendee-detail/GuardianSection.tsx
Normal file
@@ -0,0 +1,145 @@
|
||||
import { useState } from 'react'
|
||||
import { Loader2, Mail, Phone, UserRound, Users } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button, Input } from '../../components/ui'
|
||||
import { ApiError } from '../../lib/api'
|
||||
import { formatPhoneDisplay } from '../../lib/format'
|
||||
import { ContactRow } from './AttendeeContactSection'
|
||||
import { useAttendeeDetail } from './AttendeeDetailProvider'
|
||||
import { contactEmailError } from './detail'
|
||||
import { Section } from './Section'
|
||||
|
||||
/* El adulto a cargo de un chico: es una persona propia (compartida entre
|
||||
hermanos), así que editarlo cambia en la ficha de todos sus chicos. Se
|
||||
muestra si el chico tiene adulto o si el grupo es de chicos (para cargarlo). */
|
||||
export function GuardianSection() {
|
||||
const { attendee, isKidsGroup, saveGuardian, isUpdatingGuardian } = useAttendeeDetail()
|
||||
const { t } = useTranslation(['attendeeDetail', 'common'])
|
||||
const [isEditing, setIsEditing] = useState(false)
|
||||
const [fullName, setFullName] = useState('')
|
||||
const [phone, setPhone] = useState('')
|
||||
const [email, setEmail] = useState('')
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
|
||||
if (!attendee || (!attendee.guardianPersonId && !isKidsGroup)) return null
|
||||
const hasGuardian = Boolean(attendee.guardianPersonId)
|
||||
|
||||
const beginEdit = () => {
|
||||
setFullName(attendee.guardianName ?? '')
|
||||
setPhone(attendee.guardianPhone ?? '')
|
||||
setEmail(attendee.guardianEmail ?? '')
|
||||
setError(null)
|
||||
setIsEditing(true)
|
||||
}
|
||||
|
||||
const save = async () => {
|
||||
if (!fullName.trim() || phone.replace(/\D/g, '').length < 6) {
|
||||
setError(t('guardian.required'))
|
||||
return
|
||||
}
|
||||
const emailError = contactEmailError(email)
|
||||
if (emailError) {
|
||||
setError(emailError)
|
||||
return
|
||||
}
|
||||
try {
|
||||
await saveGuardian({ fullName: fullName.trim(), phone: phone.trim(), email: email.trim() || undefined })
|
||||
setIsEditing(false)
|
||||
} catch (err) {
|
||||
setError(
|
||||
err instanceof ApiError && err.problem?.code === 'person_phone_taken'
|
||||
? t('contact.phoneTaken')
|
||||
: t('contact.saveError'),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const siblings = attendee.siblings.map((sibling) => sibling.fullName).join(', ')
|
||||
|
||||
return (
|
||||
<Section
|
||||
id="attendee-guardian"
|
||||
title={t('guardian.title')}
|
||||
trailing={
|
||||
!isEditing ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={beginEdit}
|
||||
className="min-h-11 rounded-lg px-2 text-sm font-medium text-accent-fg transition-colors hover:bg-primary-soft hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"
|
||||
>
|
||||
{hasGuardian ? t('contact.edit') : t('guardian.add')}
|
||||
</button>
|
||||
) : null
|
||||
}
|
||||
>
|
||||
{isEditing ? (
|
||||
<div className="space-y-3 px-3 pb-1">
|
||||
<Input
|
||||
value={fullName}
|
||||
onChange={(event) => setFullName(event.target.value)}
|
||||
autoFocus
|
||||
autoComplete="name"
|
||||
placeholder={t('guardian.namePlaceholder')}
|
||||
aria-label={t('guardian.name')}
|
||||
/>
|
||||
<Input
|
||||
type="tel"
|
||||
value={phone}
|
||||
onChange={(event) => setPhone(event.target.value)}
|
||||
autoComplete="tel"
|
||||
placeholder={t('contact.phone')}
|
||||
aria-label={t('contact.phone')}
|
||||
/>
|
||||
<Input
|
||||
type="email"
|
||||
value={email}
|
||||
onChange={(event) => setEmail(event.target.value)}
|
||||
autoComplete="email"
|
||||
placeholder={t('contact.email')}
|
||||
aria-label={t('contact.email')}
|
||||
/>
|
||||
{hasGuardian && attendee.siblings.length > 0 ? (
|
||||
<p className="text-xs text-secondary">{t('guardian.shared')}</p>
|
||||
) : null}
|
||||
{error ? (
|
||||
<p role="alert" className="text-sm text-danger-fg">
|
||||
{error}
|
||||
</p>
|
||||
) : null}
|
||||
<div className="flex justify-end gap-2 pt-1">
|
||||
<Button variant="ghost" onClick={() => setIsEditing(false)} disabled={isUpdatingGuardian}>
|
||||
{t('common:actions.cancel')}
|
||||
</Button>
|
||||
<Button variant="primary" onClick={() => void save()} disabled={isUpdatingGuardian}>
|
||||
{isUpdatingGuardian ? <Loader2 className="size-4 animate-spin" /> : null}
|
||||
{t('common:actions.save')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
) : hasGuardian ? (
|
||||
<div className="divide-y divide-border/60">
|
||||
<ContactRow icon={UserRound} label={t('guardian.name')} value={attendee.guardianName ?? ''} placeholder={false} />
|
||||
<ContactRow
|
||||
icon={Phone}
|
||||
label={t('contact.phone')}
|
||||
value={formatPhoneDisplay(attendee.guardianPhone) ?? t('contact.addPhone')}
|
||||
href={attendee.guardianPhone ? `tel:${attendee.guardianPhone.replace(/\D/g, '')}` : undefined}
|
||||
placeholder={!attendee.guardianPhone}
|
||||
/>
|
||||
<ContactRow
|
||||
icon={Mail}
|
||||
label={t('contact.email')}
|
||||
value={attendee.guardianEmail ?? t('contact.addEmail')}
|
||||
href={attendee.guardianEmail ? `mailto:${attendee.guardianEmail}` : undefined}
|
||||
placeholder={!attendee.guardianEmail}
|
||||
/>
|
||||
{siblings ? (
|
||||
<ContactRow icon={Users} label={t('guardian.siblings')} value={siblings} placeholder={false} />
|
||||
) : null}
|
||||
</div>
|
||||
) : (
|
||||
<p className="px-3 text-sm text-secondary">{t('guardian.missing')}</p>
|
||||
)}
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
@@ -3,6 +3,12 @@ import { UpdateAttendeeSchema } from '@gruperly/shared'
|
||||
import { validationMessage } from '../../i18n/validation'
|
||||
import { i18n } from '../../i18n/instance'
|
||||
|
||||
/* El número por el que se contacta al miembro: el del adulto a cargo si es un
|
||||
chico (es quien responde por él), si no el suyo. Misma regla que el backend. */
|
||||
export function reachPhone(attendee: { phone: string | null; guardianPhone: string | null }): string | null {
|
||||
return attendee.guardianPhone ?? attendee.phone
|
||||
}
|
||||
|
||||
export function contactEmailError(email: string): string | null {
|
||||
const result = UpdateAttendeeSchema.safeParse({ email })
|
||||
if (result.success) return null
|
||||
|
||||
@@ -50,6 +50,7 @@ export function planFeatureList(limits: PlanLimits): { label: string; included:
|
||||
},
|
||||
{ label: i18n.t('billing:features.mpCharges'), included: limits.mpCharges },
|
||||
{ label: i18n.t('billing:features.whatsapp'), included: limits.whatsappAutomations },
|
||||
{ label: i18n.t('billing:features.kidsGroups'), included: limits.kidsGroups },
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
78
apps/web/src/features/groups/EditGroupView.tsx
Normal file
78
apps/web/src/features/groups/EditGroupView.tsx
Normal file
@@ -0,0 +1,78 @@
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { Link, useNavigate } from '@tanstack/react-router'
|
||||
import type { CreateFirstGroup, GroupDto } from '@gruperly/shared'
|
||||
import { ChevronLeft, Loader2 } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { errorMessage } from '../../i18n'
|
||||
import { getGroup, updateGroup } from '../../lib/api'
|
||||
import { GroupForm } from './GroupForm'
|
||||
|
||||
/* "Editar grupo": el mismo formulario que el alta, con los datos del grupo. */
|
||||
export function EditGroupView({ groupId }: { groupId: string }) {
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation('groups')
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
const groupQuery = useQuery({
|
||||
queryKey: ['group', groupId],
|
||||
queryFn: () => getGroup(groupId),
|
||||
})
|
||||
|
||||
const update = useMutation({
|
||||
// El país vive en el usuario, no en el grupo: el formulario lo trae pero no se manda.
|
||||
mutationFn: ({ country: _country, ...values }: CreateFirstGroup) => updateGroup(groupId, values),
|
||||
onSuccess: (group) => {
|
||||
queryClient.setQueryData<GroupDto>(['group', groupId], (current) => (current ? { ...current, ...group } : group))
|
||||
void queryClient.invalidateQueries({ queryKey: ['groups'] })
|
||||
void navigate({ to: '/groups/$groupId', params: { groupId } })
|
||||
},
|
||||
})
|
||||
|
||||
const group = groupQuery.data
|
||||
|
||||
return (
|
||||
<section className="mx-auto w-full max-w-md">
|
||||
<Link
|
||||
to="/groups/$groupId"
|
||||
params={{ groupId }}
|
||||
className="mb-6 hidden items-center gap-1 text-sm font-medium text-foreground/70 transition-colors hover:text-primary lg:inline-flex"
|
||||
>
|
||||
<ChevronLeft className="size-4" />
|
||||
{group?.name ?? t('title')}
|
||||
</Link>
|
||||
|
||||
{group ? (
|
||||
<GroupForm
|
||||
heading={t('edit.heading')}
|
||||
description={t('edit.description')}
|
||||
submitLabel={t('edit.submit')}
|
||||
isSubmitting={update.isPending}
|
||||
errorMessage={update.isError ? errorMessage(update.error, t('edit.error')) : null}
|
||||
initialValues={toFormValues(group)}
|
||||
onSubmit={(values) => update.mutate(values)}
|
||||
/>
|
||||
) : groupQuery.isError ? (
|
||||
<p role="alert" className="text-sm text-danger-fg">
|
||||
{errorMessage(groupQuery.error, t('edit.loadError'))}
|
||||
</p>
|
||||
) : (
|
||||
<div className="flex justify-center py-20">
|
||||
<Loader2 className="size-8 animate-spin text-accent" />
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
function toFormValues(group: GroupDto): Partial<CreateFirstGroup> {
|
||||
return {
|
||||
name: group.name,
|
||||
days: group.days ?? [],
|
||||
time: group.time ?? '09:00',
|
||||
capacity: group.capacity ?? undefined,
|
||||
price: group.price ?? undefined,
|
||||
billingType: group.billingType ?? 'MONTHLY',
|
||||
dueDay: group.dueDay ?? 1,
|
||||
audience: group.audience,
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
import { type DefaultValues, useForm } from 'react-hook-form'
|
||||
import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import type { BillingType, CountryCode, CreateFirstGroup, WeekDay } from '@gruperly/shared'
|
||||
import type { BillingType, CountryCode, CreateFirstGroup, GroupAudience, WeekDay } from '@gruperly/shared'
|
||||
import { COUNTRY_CURRENCY, CreateFirstGroupSchema, DEFAULT_COUNTRY } from '@gruperly/shared'
|
||||
import { ArrowLeft, Check, Loader2 } from 'lucide-react'
|
||||
import type { ReactNode } from 'react'
|
||||
import { useId } from 'react'
|
||||
import { useId, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { currencySymbol, sortWeekDays } from '../../lib/format'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { Button, FieldError, Input, Label } from '../../components/ui'
|
||||
import { Badge, Button, FieldError, Input, Label } from '../../components/ui'
|
||||
import { hasPlanFeature, planFeatureRequiredMessage, useBillingStatus } from '../billing'
|
||||
import { BILLING_TYPES, WEEK_DAYS } from '../onboarding/constants'
|
||||
|
||||
const AUDIENCES: readonly GroupAudience[] = ['ADULTS', 'KIDS']
|
||||
|
||||
type GroupFormProps = {
|
||||
heading: string
|
||||
description: string
|
||||
@@ -23,6 +26,8 @@ type GroupFormProps = {
|
||||
country?: CountryCode
|
||||
onSubmit: (values: CreateFirstGroup) => void
|
||||
onBack?: () => void
|
||||
/** Editar grupo: arranca con los datos del grupo. */
|
||||
initialValues?: Partial<CreateFirstGroup>
|
||||
}
|
||||
|
||||
export function GroupForm({
|
||||
@@ -35,6 +40,7 @@ export function GroupForm({
|
||||
country,
|
||||
onSubmit,
|
||||
onBack,
|
||||
initialValues,
|
||||
}: GroupFormProps) {
|
||||
const { t } = useTranslation(['groups', 'common'])
|
||||
// The price starts empty on purpose: a pre-filled $0 got submitted as is and
|
||||
@@ -48,12 +54,20 @@ export function GroupForm({
|
||||
billingType: 'MONTHLY',
|
||||
dueDay: 1,
|
||||
country: country ?? DEFAULT_COUNTRY,
|
||||
audience: 'ADULTS',
|
||||
...initialValues,
|
||||
}
|
||||
// Con país (onboarding) el símbolo sale de su moneda; sin país, del navegador,
|
||||
// igual que el resto de los montos de la app.
|
||||
const symbol = currencySymbol(country ? COUNTRY_CURRENCY[country] : undefined)
|
||||
const daysLabelId = useId()
|
||||
const billingLabelId = useId()
|
||||
const audienceLabelId = useId()
|
||||
const billingQuery = useBillingStatus()
|
||||
// Un grupo que ya es de chicos sigue siéndolo aunque el plan ya no lo incluya.
|
||||
const kidsIncluded = initialValues?.audience === 'KIDS' || hasPlanFeature(billingQuery.data, 'kidsGroups')
|
||||
// Se avisa inline y no con el aviso global de Pro: el onboarding no lo monta.
|
||||
const [kidsLocked, setKidsLocked] = useState(false)
|
||||
|
||||
const {
|
||||
register,
|
||||
@@ -70,6 +84,7 @@ export function GroupForm({
|
||||
const days = watch('days')
|
||||
const billingType = watch('billingType')
|
||||
const dueDay = watch('dueDay')
|
||||
const audience = watch('audience')
|
||||
|
||||
const toggleDay = (day: WeekDay) => {
|
||||
const next = days.includes(day) ? days.filter((d) => d !== day) : sortWeekDays([...days, day])
|
||||
@@ -80,6 +95,15 @@ export function GroupForm({
|
||||
setValue('billingType', type, { shouldValidate: true })
|
||||
}
|
||||
|
||||
const selectAudience = (value: GroupAudience) => {
|
||||
if (value === 'KIDS' && !kidsIncluded) {
|
||||
setKidsLocked(true)
|
||||
return
|
||||
}
|
||||
setKidsLocked(false)
|
||||
setValue('audience', value, { shouldValidate: true })
|
||||
}
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit(onSubmit)} noValidate className="space-y-5">
|
||||
<header className="space-y-1">
|
||||
@@ -99,6 +123,42 @@ export function GroupForm({
|
||||
<FieldError message={errors.name?.message} />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label id={audienceLabelId}>{t('form.audience')}</Label>
|
||||
<div role="group" aria-labelledby={audienceLabelId} className="grid grid-cols-2 gap-2">
|
||||
{AUDIENCES.map((value) => {
|
||||
const isActive = audience === value
|
||||
return (
|
||||
<button
|
||||
key={value}
|
||||
type="button"
|
||||
aria-pressed={isActive}
|
||||
onClick={() => selectAudience(value)}
|
||||
className={cn(
|
||||
'rounded-xl border px-3 py-2.5 text-left transition-colors',
|
||||
isActive
|
||||
? 'border-accent bg-accent-soft'
|
||||
: 'border-border bg-surface hover:bg-primary-soft',
|
||||
)}
|
||||
>
|
||||
<span className="flex items-center gap-2">
|
||||
<span className={cn('text-sm font-semibold', isActive ? 'text-accent' : 'text-primary')}>
|
||||
{t(`form.audienceOption.${value}`)}
|
||||
</span>
|
||||
{value === 'KIDS' && !kidsIncluded ? <Badge variant="info">Pro</Badge> : null}
|
||||
</span>
|
||||
<span className="block text-xs text-foreground/50">{t(`form.audienceHint.${value}`)}</span>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
{kidsLocked ? (
|
||||
<p role="status" className="mt-2 text-xs text-foreground/60">
|
||||
{planFeatureRequiredMessage('kidsGroups')}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<fieldset className="space-y-4">
|
||||
<legend className="mb-3 text-base font-semibold text-primary">
|
||||
{t('form.whenLegend')}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { useAddAttendee } from './AddAttendeeProvider'
|
||||
import { BulkCapacityModal } from './BulkCapacityModal'
|
||||
import { BulkImportPanel } from './BulkImportPanel'
|
||||
import { CapacityModal } from './CapacityModal'
|
||||
import { KidQuickAddForm } from './KidQuickAddForm'
|
||||
import { QuickAddForm } from './QuickAddForm'
|
||||
|
||||
const TABS = [
|
||||
@@ -14,8 +15,10 @@ const TABS = [
|
||||
]
|
||||
|
||||
export function AddAttendeePage() {
|
||||
const { groupId, groupName, attendeesTotal, capacity, groupPending, activeTab, setActiveTab } =
|
||||
const { groupId, groupName, groupAudience, attendeesTotal, capacity, groupPending, activeTab, setActiveTab } =
|
||||
useAddAttendee()
|
||||
// La carga masiva todavía no lleva los datos del adulto a cargo.
|
||||
const isKidsGroup = groupAudience === 'KIDS'
|
||||
const { t } = useTranslation('groupAdd')
|
||||
|
||||
if (groupPending) {
|
||||
@@ -59,6 +62,7 @@ export function AddAttendeePage() {
|
||||
</header>
|
||||
|
||||
<div className="rounded-xl border border-border bg-surface p-4 sm:p-5">
|
||||
{isKidsGroup ? null : (
|
||||
<div className="mb-5 flex items-center rounded-xl bg-primary-soft p-1">
|
||||
{TABS.map((tab) => (
|
||||
<button
|
||||
@@ -76,8 +80,9 @@ export function AddAttendeePage() {
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{activeTab === 'quick' ? <QuickAddForm /> : <BulkImportPanel />}
|
||||
{isKidsGroup ? <KidQuickAddForm /> : activeTab === 'quick' ? <QuickAddForm /> : <BulkImportPanel />}
|
||||
</div>
|
||||
|
||||
<CapacityModal />
|
||||
|
||||
@@ -7,6 +7,7 @@ import type {
|
||||
CreateAttendee,
|
||||
CreateAttendeeResult,
|
||||
CreateGroupWaitlistEntry,
|
||||
GroupAudience,
|
||||
GroupWaitlistEntryDto,
|
||||
GroupWaitlistList,
|
||||
} from '@gruperly/shared'
|
||||
@@ -38,6 +39,8 @@ export type AddAttendeeTab = 'quick' | 'bulk'
|
||||
type AddAttendeeContextValue = {
|
||||
groupId: string
|
||||
groupName: string | undefined
|
||||
/** KIDS: cada alta es un chico con su adulto a cargo. */
|
||||
groupAudience: GroupAudience
|
||||
groupPending: boolean
|
||||
attendeesTotal: number
|
||||
capacity: number | null
|
||||
@@ -262,6 +265,7 @@ export function AddAttendeeProvider({ groupId, children }: { groupId: string; ch
|
||||
const value: AddAttendeeContextValue = {
|
||||
groupId,
|
||||
groupName: group?.name,
|
||||
groupAudience: group?.audience ?? 'ADULTS',
|
||||
groupPending: groupQuery.isPending,
|
||||
attendeesTotal,
|
||||
capacity,
|
||||
@@ -296,7 +300,14 @@ export function AddAttendeeProvider({ groupId, children }: { groupId: string; ch
|
||||
},
|
||||
submitWaitlistEntry: () => {
|
||||
if (pendingCapacityPayload) {
|
||||
addToWaitlistMutation.mutate({ ...pendingCapacityPayload })
|
||||
// Un chico entra a la lista de espera con el teléfono del adulto a cargo
|
||||
// (la lista de espera de grupos de chicos se completa en otra entrega).
|
||||
const { guardian, personId: _personId, ...entry } = pendingCapacityPayload
|
||||
addToWaitlistMutation.mutate({
|
||||
...entry,
|
||||
phone: entry.phone || guardian?.phone || '',
|
||||
email: entry.email || guardian?.email || undefined,
|
||||
})
|
||||
}
|
||||
},
|
||||
requestBulkImport,
|
||||
|
||||
75
apps/web/src/features/groups/add/ExistingGuardianNotice.tsx
Normal file
75
apps/web/src/features/groups/add/ExistingGuardianNotice.tsx
Normal file
@@ -0,0 +1,75 @@
|
||||
import { UserCheck } from 'lucide-react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import type { PersonSummary } from '@gruperly/shared'
|
||||
import { cn } from '../../../lib/utils'
|
||||
|
||||
type ExistingGuardianNoticeProps = {
|
||||
guardian: PersonSummary
|
||||
groupId: string
|
||||
/** El chico ya cargado que se eligió, o `null` si es un chico nuevo. */
|
||||
selectedKidId: string | null
|
||||
onSelectKid: (kidId: string | null) => void
|
||||
}
|
||||
|
||||
/* El teléfono del adulto ya es de alguien que el profe tiene: queda como adulto
|
||||
a cargo con sus datos, y si ya tiene chicos se ofrece elegir uno (para no
|
||||
duplicarlo) o seguir con un hermano nuevo. */
|
||||
export function ExistingGuardianNotice({ guardian, groupId, selectedKidId, onSelectKid }: ExistingGuardianNoticeProps) {
|
||||
const { t } = useTranslation('groupAdd')
|
||||
const kids = guardian.children
|
||||
|
||||
return (
|
||||
<div role="status" className="mt-2 rounded-xl border border-border bg-accent-soft/40 px-3 py-3 text-sm text-primary">
|
||||
<div className="flex items-start gap-2.5">
|
||||
<UserCheck className="mt-0.5 size-4 shrink-0 text-accent-fg" aria-hidden="true" />
|
||||
<p className="min-w-0">
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey={kids.length > 0 ? 'kid.existing.foundWithKids' : 'kid.existing.found'}
|
||||
values={{ name: guardian.fullName }}
|
||||
components={{ strong: <strong /> }}
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
{kids.length > 0 ? (
|
||||
<div className="mt-2.5 flex flex-wrap gap-2" role="group" aria-label={t('kid.existing.pickLabel')}>
|
||||
{kids.map((kid) => {
|
||||
const inGroup = kid.groups.some((group) => group.groupId === groupId && group.status !== 'DROPPED')
|
||||
const isSelected = selectedKidId === kid.id
|
||||
return (
|
||||
<button
|
||||
key={kid.id}
|
||||
type="button"
|
||||
disabled={inGroup}
|
||||
aria-pressed={isSelected}
|
||||
onClick={() => onSelectKid(isSelected ? null : kid.id)}
|
||||
className={cn(
|
||||
'rounded-full border px-3 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50',
|
||||
isSelected
|
||||
? 'border-accent bg-accent text-on-accent'
|
||||
: 'border-border bg-surface text-primary hover:bg-primary-soft',
|
||||
)}
|
||||
>
|
||||
{inGroup ? t('kid.existing.kidInGroup', { name: kid.fullName }) : kid.fullName}
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
<button
|
||||
type="button"
|
||||
aria-pressed={selectedKidId === null}
|
||||
onClick={() => onSelectKid(null)}
|
||||
className={cn(
|
||||
'rounded-full border px-3 py-1.5 text-xs font-medium transition-colors',
|
||||
selectedKidId === null
|
||||
? 'border-accent bg-accent text-on-accent'
|
||||
: 'border-border bg-surface text-primary hover:bg-primary-soft',
|
||||
)}
|
||||
>
|
||||
{t('kid.existing.newSibling')}
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
181
apps/web/src/features/groups/add/KidQuickAddForm.tsx
Normal file
181
apps/web/src/features/groups/add/KidQuickAddForm.tsx
Normal file
@@ -0,0 +1,181 @@
|
||||
import { useState } from 'react'
|
||||
import { Check, Loader2 } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button, Input, Label, useToast } from '../../../components/ui'
|
||||
import { useAddAttendee } from './AddAttendeeProvider'
|
||||
import { ExistingGuardianNotice } from './ExistingGuardianNotice'
|
||||
import { usePersonLookup } from './usePersonLookup'
|
||||
|
||||
/* Alta en un grupo de chicos: el chico y su adulto a cargo. El teléfono del
|
||||
adulto lo identifica, así que dos hermanos comparten el mismo adulto; si ese
|
||||
adulto ya tiene chicos cargados, se puede elegir uno en vez de duplicarlo. */
|
||||
export function KidQuickAddForm() {
|
||||
const { groupId, submitQuickAttendee, isSubmittingAttendee, cancelAddAttendee } = useAddAttendee()
|
||||
const toast = useToast()
|
||||
const { t } = useTranslation(['groupAdd', 'common'])
|
||||
const [firstName, setFirstName] = useState('')
|
||||
const [lastName, setLastName] = useState('')
|
||||
const [notes, setNotes] = useState('')
|
||||
const [guardianName, setGuardianName] = useState('')
|
||||
const [guardianPhone, setGuardianPhone] = useState('')
|
||||
const [guardianEmail, setGuardianEmail] = useState('')
|
||||
const [selectedKidId, setSelectedKidId] = useState<string | null>(null)
|
||||
|
||||
const { person: existingGuardian } = usePersonLookup(groupId, guardianPhone)
|
||||
const selectedKid = existingGuardian?.children.find((kid) => kid.id === selectedKidId) ?? null
|
||||
const kidLocked = Boolean(selectedKid)
|
||||
const guardianLocked = Boolean(existingGuardian)
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault()
|
||||
if (selectedKid) {
|
||||
submitQuickAttendee({ firstName: selectedKid.fullName, lastName: '', personId: selectedKid.id })
|
||||
return
|
||||
}
|
||||
const adultName = existingGuardian?.fullName ?? guardianName.trim()
|
||||
if (!firstName.trim() || !adultName || !guardianPhone.trim()) {
|
||||
toast.error(t('kid.required'))
|
||||
return
|
||||
}
|
||||
submitQuickAttendee({
|
||||
firstName: firstName.trim(),
|
||||
lastName: lastName.trim(),
|
||||
notes: notes.trim() || undefined,
|
||||
guardian: {
|
||||
fullName: adultName,
|
||||
phone: guardianPhone.trim(),
|
||||
email: (existingGuardian ? '' : guardianEmail.trim()) || undefined,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const resetForm = () => {
|
||||
setFirstName('')
|
||||
setLastName('')
|
||||
setNotes('')
|
||||
setGuardianName('')
|
||||
setGuardianPhone('')
|
||||
setGuardianEmail('')
|
||||
setSelectedKidId(null)
|
||||
}
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit} className="space-y-5">
|
||||
<fieldset className="space-y-3">
|
||||
<legend className="mb-2 text-sm font-semibold text-primary">{t('kid.kidSection')}</legend>
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
||||
<div>
|
||||
<Label htmlFor="kid-first-name" className="mb-1 block text-xs">
|
||||
{t('quick.firstName')} <span className="text-danger">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
id="kid-first-name"
|
||||
autoFocus
|
||||
placeholder={t('quick.firstNamePlaceholder')}
|
||||
value={selectedKid ? selectedKid.fullName : firstName}
|
||||
onChange={(e) => setFirstName(e.target.value)}
|
||||
disabled={kidLocked}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="kid-last-name" className="mb-1 block text-xs">
|
||||
{t('quick.lastName')}
|
||||
</Label>
|
||||
<Input
|
||||
id="kid-last-name"
|
||||
placeholder={t('quick.lastNamePlaceholder')}
|
||||
value={kidLocked ? '' : lastName}
|
||||
onChange={(e) => setLastName(e.target.value)}
|
||||
disabled={kidLocked}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="kid-notes" className="mb-1 block text-xs">
|
||||
{t('quick.notes')}
|
||||
</Label>
|
||||
<Input
|
||||
id="kid-notes"
|
||||
placeholder={t('kid.notesPlaceholder')}
|
||||
value={notes}
|
||||
onChange={(e) => setNotes(e.target.value)}
|
||||
disabled={kidLocked}
|
||||
/>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset className="space-y-3">
|
||||
<legend className="mb-2 text-sm font-semibold text-primary">{t('kid.guardianSection')}</legend>
|
||||
<div>
|
||||
<Label htmlFor="guardian-phone" className="mb-1 block text-xs">
|
||||
{t('quick.phone')} <span className="text-danger">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
id="guardian-phone"
|
||||
placeholder={t('quick.phonePlaceholder')}
|
||||
value={guardianPhone}
|
||||
onChange={(e) => {
|
||||
setGuardianPhone(e.target.value)
|
||||
setSelectedKidId(null)
|
||||
}}
|
||||
required
|
||||
/>
|
||||
{existingGuardian ? (
|
||||
<ExistingGuardianNotice
|
||||
guardian={existingGuardian}
|
||||
groupId={groupId}
|
||||
selectedKidId={selectedKidId}
|
||||
onSelectKid={setSelectedKidId}
|
||||
/>
|
||||
) : (
|
||||
<p className="mt-1 text-[11px] text-foreground/50">{t('kid.guardianPhoneHint')}</p>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="guardian-name" className="mb-1 block text-xs">
|
||||
{t('kid.guardianName')} <span className="text-danger">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
id="guardian-name"
|
||||
placeholder={t('kid.guardianNamePlaceholder')}
|
||||
value={existingGuardian ? existingGuardian.fullName : guardianName}
|
||||
onChange={(e) => setGuardianName(e.target.value)}
|
||||
disabled={guardianLocked}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="guardian-email" className="mb-1 block text-xs">
|
||||
{t('quick.email')}
|
||||
</Label>
|
||||
<Input
|
||||
id="guardian-email"
|
||||
type="email"
|
||||
placeholder={t('kid.guardianEmailPlaceholder')}
|
||||
value={existingGuardian ? (existingGuardian.email ?? '') : guardianEmail}
|
||||
onChange={(e) => setGuardianEmail(e.target.value)}
|
||||
disabled={guardianLocked}
|
||||
/>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div className="flex flex-col-reverse gap-2.5 border-t border-border pt-3 sm:flex-row sm:items-center sm:justify-end">
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => {
|
||||
resetForm()
|
||||
cancelAddAttendee()
|
||||
}}
|
||||
className="w-full sm:w-auto"
|
||||
>
|
||||
{t('common:actions.cancel')}
|
||||
</Button>
|
||||
<Button variant="primary" type="submit" disabled={isSubmittingAttendee} className="w-full sm:w-auto">
|
||||
{isSubmittingAttendee ? <Loader2 className="size-4 animate-spin" /> : <Check className="size-4" />}
|
||||
<span>{t('quick.submit')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Link, useNavigate } from '@tanstack/react-router'
|
||||
import { ArrowLeft, BarChart3, Share2, UserPlus, Wallet } from 'lucide-react'
|
||||
import { ArrowLeft, BarChart3, Pencil, Share2, UserPlus, Wallet } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Badge, Button, Tooltip } from '../../../components/ui'
|
||||
import { LargeTitle } from '../../../components/layout/LargeTitle'
|
||||
@@ -19,6 +19,7 @@ export function GroupHeader({ onCharge }: { onCharge?: () => void }) {
|
||||
preRegistrationsPending,
|
||||
waitlistTotal,
|
||||
waitlistPending,
|
||||
isGroupOwner,
|
||||
} = useGroupDetail()
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation(['groupDetail', 'groups'])
|
||||
@@ -78,6 +79,21 @@ export function GroupHeader({ onCharge }: { onCharge?: () => void }) {
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
) : null}
|
||||
{group?.audience === 'KIDS' ? (
|
||||
<Badge variant="info" className="text-[11px]">
|
||||
{t('groups:form.audienceOption.KIDS')}
|
||||
</Badge>
|
||||
) : null}
|
||||
{isGroupOwner ? (
|
||||
<Link
|
||||
to="/groups/$groupId/edit"
|
||||
params={{ groupId }}
|
||||
className="inline-flex min-h-8 items-center gap-1 rounded-lg px-1.5 text-xs font-medium text-accent-fg transition-colors hover:bg-primary-soft hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"
|
||||
>
|
||||
<Pencil className="size-3.5" aria-hidden="true" />
|
||||
{t('groups:edit.link')}
|
||||
</Link>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
"unlimitedFor": "{{label}} with no limit",
|
||||
"mpCharges": "Mercado Pago charges",
|
||||
"whatsappAutomations": "Automatic WhatsApp messages",
|
||||
"kidsGroups": "Kids groups with an adult in charge",
|
||||
"impact_one": "{{count}} account already exceeds these limits and will become read only when you save.",
|
||||
"impact_other": "{{count}} accounts already exceed these limits and will become read only when you save.",
|
||||
"saved": "Limits saved."
|
||||
|
||||
@@ -158,5 +158,15 @@
|
||||
"alreadyMember": "This person is already a member of that group.",
|
||||
"moveError": "We couldn't change the group.",
|
||||
"addError": "We couldn't add them to the group."
|
||||
},
|
||||
"guardian": {
|
||||
"title": "Adult in charge",
|
||||
"add": "Add",
|
||||
"name": "Name",
|
||||
"namePlaceholder": "Full name",
|
||||
"required": "Fill in the adult's name and a valid phone.",
|
||||
"shared": "The change shows on all their kids.",
|
||||
"siblings": "Siblings",
|
||||
"missing": "This kid has no adult in charge yet."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"unlimitedStudents": "Unlimited students",
|
||||
"students": "Up to {{count}} active students",
|
||||
"mpCharges": "Payments with Mercado Pago",
|
||||
"whatsapp": "Automatic WhatsApp messages"
|
||||
"whatsapp": "Automatic WhatsApp messages",
|
||||
"kidsGroups": "Kids groups with an adult in charge"
|
||||
},
|
||||
"subscriptionStatus": {
|
||||
"AUTHORIZED": "Active",
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"group_capacity_reached": "The group is full.",
|
||||
"group_capacity_reached_one": "The group is full ({{count}} member max).",
|
||||
"group_capacity_reached_other": "The group is full ({{count}} members max).",
|
||||
"group_owner_required": "Only the group's creator can change its automations.",
|
||||
"group_owner_required": "Only the group's creator can make this change.",
|
||||
"group_without_price": "Set the group's price before creating payments.",
|
||||
"mp_account_in_use": "That Mercado Pago account is already linked to another teacher.",
|
||||
"mp_not_configured": "Linking with Mercado Pago isn't available right now.",
|
||||
@@ -41,6 +41,7 @@
|
||||
"plan_feature_required": "This feature is available on the Pro plan.",
|
||||
"plan_feature_required_mpCharges": "Collecting with Mercado Pago is available on the Pro plan.",
|
||||
"plan_feature_required_whatsappAutomations": "Automatic WhatsApp messages are available on the Pro plan.",
|
||||
"plan_feature_required_kidsGroups": "Kids groups with an adult in charge are available on the Pro plan.",
|
||||
"plan_limit_reached": "You've reached the Free plan's limit. Upgrade to Pro to keep growing.",
|
||||
"plan_limit_reached_groups_one": "The Free plan allows up to {{count}} group. Upgrade to Pro to create more.",
|
||||
"plan_limit_reached_groups_other": "The Free plan allows up to {{count}} groups. Upgrade to Pro to create more.",
|
||||
@@ -62,7 +63,9 @@
|
||||
"whatsapp_number_in_use": "That WhatsApp number is already linked to another teacher.",
|
||||
"whatsapp_pairing_not_ready": "WhatsApp is still getting ready to link. Try again in a few seconds.",
|
||||
"whatsapp_pairing_unsupported": "This WhatsApp provider doesn't support linking by phone number.",
|
||||
"whatsapp_provider_error": "We couldn't reach WhatsApp. Try again in a few minutes."
|
||||
"whatsapp_provider_error": "We couldn't reach WhatsApp. Try again in a few minutes.",
|
||||
"guardian_required": "In a kids group you need to add the adult in charge.",
|
||||
"group_has_kids_without_phone": "Some kids have no phone of their own: add one before switching the group to adults."
|
||||
},
|
||||
"auth": {
|
||||
"INVALID_EMAIL_OR_PASSWORD": "The email or password is incorrect.",
|
||||
|
||||
@@ -93,5 +93,22 @@
|
||||
"importedLinked": "{{count}} were already in your other groups.",
|
||||
"importedDuplicates_one": "{{count}} duplicate skipped.",
|
||||
"importedDuplicates_other": "{{count}} duplicates skipped."
|
||||
},
|
||||
"kid": {
|
||||
"kidSection": "The kid",
|
||||
"guardianSection": "Adult in charge",
|
||||
"guardianName": "Full name",
|
||||
"guardianNamePlaceholder": "E.g. Anna Smith",
|
||||
"guardianEmailPlaceholder": "adult@example.com",
|
||||
"guardianPhoneHint": "They get the kid's notices and reminders. If you already have them, we recognize them by phone.",
|
||||
"notesPlaceholder": "E.g. Allergies, who picks them up",
|
||||
"required": "Fill in the kid's name and the adult's name and phone.",
|
||||
"existing": {
|
||||
"found": "<strong>{{name}}</strong> is already saved with that phone: they will be the adult in charge.",
|
||||
"foundWithKids": "<strong>{{name}}</strong> is already in charge of these kids. Is it one of them or a new sibling?",
|
||||
"pickLabel": "Pick the kid",
|
||||
"kidInGroup": "{{name}} (already in the group)",
|
||||
"newSibling": "Another kid"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,15 @@
|
||||
"form": {
|
||||
"name": "Group name",
|
||||
"namePlaceholder": "E.g. Vinyasa Yoga · Level 1",
|
||||
"audience": "Who is it for?",
|
||||
"audienceOption": {
|
||||
"ADULTS": "Adults",
|
||||
"KIDS": "Kids"
|
||||
},
|
||||
"audienceHint": {
|
||||
"ADULTS": "Each student is their own contact",
|
||||
"KIDS": "You talk to the adult in charge"
|
||||
},
|
||||
"days": "Class days",
|
||||
"time": "Time",
|
||||
"capacity": "Capacity",
|
||||
@@ -66,5 +75,13 @@
|
||||
"submitting": "Creating…",
|
||||
"whenLegend": "Classes",
|
||||
"priceLegend": "Billing"
|
||||
},
|
||||
"edit": {
|
||||
"link": "Edit",
|
||||
"heading": "Edit group",
|
||||
"description": "Changes apply from now on; charges already created stay as they are.",
|
||||
"submit": "Save changes",
|
||||
"error": "We couldn't save the changes. Check the details and try again.",
|
||||
"loadError": "We couldn't load the group."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,5 +63,8 @@
|
||||
},
|
||||
"billing": {
|
||||
"priceInvalid": "Enter a price greater than zero"
|
||||
},
|
||||
"guardian": {
|
||||
"nameRequired": "Enter the name of the adult in charge"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
"unlimitedFor": "{{label}} sin límite",
|
||||
"mpCharges": "Cobros con Mercado Pago",
|
||||
"whatsappAutomations": "Mensajes automáticos por WhatsApp",
|
||||
"kidsGroups": "Grupos de niños con adulto a cargo",
|
||||
"impact_one": "{{count}} cuenta ya supera estos límites y quedará en solo lectura al guardar.",
|
||||
"impact_other": "{{count}} cuentas ya superan estos límites y quedarán en solo lectura al guardar.",
|
||||
"saved": "Límites guardados."
|
||||
|
||||
@@ -158,5 +158,15 @@
|
||||
"alreadyMember": "Esta persona ya es miembro de ese grupo.",
|
||||
"moveError": "No se pudo cambiar de grupo.",
|
||||
"addError": "No se pudo agregar al grupo."
|
||||
},
|
||||
"guardian": {
|
||||
"title": "Adulto a cargo",
|
||||
"add": "Agregar",
|
||||
"name": "Nombre",
|
||||
"namePlaceholder": "Nombre y apellido",
|
||||
"required": "Completa el nombre y un teléfono válido del adulto.",
|
||||
"shared": "El cambio se ve en la ficha de todos sus niños.",
|
||||
"siblings": "Hermanos",
|
||||
"missing": "Este niño todavía no tiene un adulto a cargo registrado."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"unlimitedStudents": "Alumnos ilimitados",
|
||||
"students": "Hasta {{count}} alumnos activos",
|
||||
"mpCharges": "Cobros con Mercado Pago",
|
||||
"whatsapp": "Mensajes automáticos por WhatsApp"
|
||||
"whatsapp": "Mensajes automáticos por WhatsApp",
|
||||
"kidsGroups": "Grupos de niños con adulto a cargo"
|
||||
},
|
||||
"subscriptionStatus": {
|
||||
"AUTHORIZED": "Activa",
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"group_capacity_reached": "El grupo alcanzó su cupo máximo de miembros.",
|
||||
"group_capacity_reached_one": "El grupo alcanzó su cupo máximo de {{count}} miembro.",
|
||||
"group_capacity_reached_other": "El grupo alcanzó su cupo máximo de {{count}} miembros.",
|
||||
"group_owner_required": "Solo quien creó el grupo puede cambiar sus automatizaciones.",
|
||||
"group_owner_required": "Solo quien creó el grupo puede hacer este cambio.",
|
||||
"group_without_price": "Define el precio del grupo antes de generar los cobros.",
|
||||
"mp_account_in_use": "Esa cuenta de Mercado Pago ya está vinculada a otro profesor.",
|
||||
"mp_not_configured": "La vinculación con Mercado Pago no está disponible en este momento.",
|
||||
@@ -41,6 +41,7 @@
|
||||
"plan_feature_required": "Esta función está disponible en el plan Pro.",
|
||||
"plan_feature_required_mpCharges": "Cobrar con Mercado Pago está disponible en el plan Pro.",
|
||||
"plan_feature_required_whatsappAutomations": "Los mensajes automáticos de WhatsApp están disponibles en el plan Pro.",
|
||||
"plan_feature_required_kidsGroups": "Los grupos de niños con adulto a cargo están disponibles en el plan Pro.",
|
||||
"plan_limit_reached": "Llegaste al límite del plan Free. Cámbiate a Pro para seguir creciendo.",
|
||||
"plan_limit_reached_groups_one": "El plan Free permite hasta {{count}} grupo. Cámbiate a Pro para crear más.",
|
||||
"plan_limit_reached_groups_other": "El plan Free permite hasta {{count}} grupos. Cámbiate a Pro para crear más.",
|
||||
@@ -62,7 +63,9 @@
|
||||
"whatsapp_number_in_use": "Ese número de WhatsApp ya está vinculado a otro profesor.",
|
||||
"whatsapp_pairing_not_ready": "WhatsApp todavía está preparando la vinculación. Inténtalo de nuevo en unos segundos.",
|
||||
"whatsapp_pairing_unsupported": "Este proveedor de WhatsApp no permite vincular con el número de teléfono.",
|
||||
"whatsapp_provider_error": "No pudimos comunicarnos con WhatsApp. Inténtalo de nuevo en unos minutos."
|
||||
"whatsapp_provider_error": "No pudimos comunicarnos con WhatsApp. Inténtalo de nuevo en unos minutos.",
|
||||
"guardian_required": "En un grupo de niños tienes que registrar al adulto a cargo.",
|
||||
"group_has_kids_without_phone": "Hay niños sin teléfono propio: regístrales uno antes de pasar el grupo a adultos."
|
||||
},
|
||||
"auth": {
|
||||
"INVALID_EMAIL_OR_PASSWORD": "El email o la contraseña no son correctos.",
|
||||
|
||||
@@ -93,5 +93,22 @@
|
||||
"importedLinked": "{{count}} ya estaban en otros de tus grupos.",
|
||||
"importedDuplicates_one": "{{count}} duplicado omitido.",
|
||||
"importedDuplicates_other": "{{count}} duplicados omitidos."
|
||||
},
|
||||
"kid": {
|
||||
"kidSection": "El niño",
|
||||
"guardianSection": "Adulto a cargo",
|
||||
"guardianName": "Nombre y apellido",
|
||||
"guardianNamePlaceholder": "Ej.: Ana Pérez",
|
||||
"guardianEmailPlaceholder": "adulto@ejemplo.com",
|
||||
"guardianPhoneHint": "Recibe los avisos y recordatorios del niño. Si ya lo tienes registrado, lo reconocemos por el teléfono.",
|
||||
"notesPlaceholder": "Ej.: Alergias, quién lo recoge",
|
||||
"required": "Completa el nombre del niño y el nombre y teléfono del adulto.",
|
||||
"existing": {
|
||||
"found": "<strong>{{name}}</strong> ya está registrado con ese teléfono: queda como adulto a cargo.",
|
||||
"foundWithKids": "<strong>{{name}}</strong> ya es adulto a cargo de estos niños. ¿Es alguno de ellos o un hermano nuevo?",
|
||||
"pickLabel": "Elige al niño",
|
||||
"kidInGroup": "{{name}} (ya está en el grupo)",
|
||||
"newSibling": "Otro niño"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,15 @@
|
||||
"form": {
|
||||
"name": "Nombre del grupo",
|
||||
"namePlaceholder": "Ej.: Yoga Vinyasa · Nivel 1",
|
||||
"audience": "¿Para quién es?",
|
||||
"audienceOption": {
|
||||
"ADULTS": "Adultos",
|
||||
"KIDS": "Niños"
|
||||
},
|
||||
"audienceHint": {
|
||||
"ADULTS": "Cada alumno es su propio contacto",
|
||||
"KIDS": "Hablas con el adulto a cargo"
|
||||
},
|
||||
"days": "Días de clase",
|
||||
"time": "Horario",
|
||||
"capacity": "Cupo máximo",
|
||||
@@ -66,5 +75,13 @@
|
||||
"submitting": "Creando…",
|
||||
"whenLegend": "Las clases",
|
||||
"priceLegend": "El cobro"
|
||||
},
|
||||
"edit": {
|
||||
"link": "Editar",
|
||||
"heading": "Editar grupo",
|
||||
"description": "Los cambios se aplican desde ahora; las cuotas ya generadas no cambian.",
|
||||
"submit": "Guardar cambios",
|
||||
"error": "No pudimos guardar los cambios. Revisa los datos e inténtalo de nuevo.",
|
||||
"loadError": "No pudimos cargar el grupo."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,5 +63,8 @@
|
||||
},
|
||||
"billing": {
|
||||
"priceInvalid": "Ingresa un precio mayor a cero"
|
||||
},
|
||||
"guardian": {
|
||||
"nameRequired": "Ingresa el nombre del adulto a cargo"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
"unlimitedFor": "{{label}} sin límite",
|
||||
"mpCharges": "Cobros con Mercado Pago",
|
||||
"whatsappAutomations": "Mensajes automáticos por WhatsApp",
|
||||
"kidsGroups": "Grupos de chicos con adulto a cargo",
|
||||
"impact_one": "{{count}} cuenta ya supera estos límites y va a quedar en solo lectura al guardar.",
|
||||
"impact_other": "{{count}} cuentas ya superan estos límites y van a quedar en solo lectura al guardar.",
|
||||
"saved": "Límites guardados."
|
||||
|
||||
@@ -158,5 +158,15 @@
|
||||
"alreadyMember": "Esta persona ya es miembro de ese grupo.",
|
||||
"moveError": "No se pudo cambiar de grupo.",
|
||||
"addError": "No se pudo agregar al grupo."
|
||||
},
|
||||
"guardian": {
|
||||
"title": "Adulto a cargo",
|
||||
"add": "Agregar",
|
||||
"name": "Nombre",
|
||||
"namePlaceholder": "Nombre y apellido",
|
||||
"required": "Completá el nombre y un teléfono válido del adulto.",
|
||||
"shared": "El cambio se ve en la ficha de todos sus chicos.",
|
||||
"siblings": "Hermanos",
|
||||
"missing": "Este chico todavía no tiene un adulto a cargo cargado."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"unlimitedStudents": "Alumnos ilimitados",
|
||||
"students": "Hasta {{count}} alumnos activos",
|
||||
"mpCharges": "Cobros con Mercado Pago",
|
||||
"whatsapp": "Mensajes automáticos por WhatsApp"
|
||||
"whatsapp": "Mensajes automáticos por WhatsApp",
|
||||
"kidsGroups": "Grupos de chicos con adulto a cargo"
|
||||
},
|
||||
"subscriptionStatus": {
|
||||
"AUTHORIZED": "Activa",
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"group_capacity_reached": "El grupo alcanzó su cupo máximo de miembros.",
|
||||
"group_capacity_reached_one": "El grupo alcanzó su cupo máximo de {{count}} miembro.",
|
||||
"group_capacity_reached_other": "El grupo alcanzó su cupo máximo de {{count}} miembros.",
|
||||
"group_owner_required": "Solo quien creó el grupo puede cambiar sus automatizaciones.",
|
||||
"group_owner_required": "Solo quien creó el grupo puede hacer este cambio.",
|
||||
"group_without_price": "Definí el precio del grupo antes de generar los cobros.",
|
||||
"mp_account_in_use": "Esa cuenta de Mercado Pago ya está vinculada a otro profesor.",
|
||||
"mp_not_configured": "La vinculación con Mercado Pago no está disponible en este momento.",
|
||||
@@ -41,6 +41,7 @@
|
||||
"plan_feature_required": "Esta función está disponible en el plan Pro.",
|
||||
"plan_feature_required_mpCharges": "Cobrar con Mercado Pago está disponible en el plan Pro.",
|
||||
"plan_feature_required_whatsappAutomations": "Los mensajes automáticos de WhatsApp están disponibles en el plan Pro.",
|
||||
"plan_feature_required_kidsGroups": "Los grupos de chicos con adulto a cargo están disponibles en el plan Pro.",
|
||||
"plan_limit_reached": "Llegaste al límite del plan Free. Pasate a Pro para seguir creciendo.",
|
||||
"plan_limit_reached_groups_one": "El plan Free permite hasta {{count}} grupo. Pasate a Pro para crear más.",
|
||||
"plan_limit_reached_groups_other": "El plan Free permite hasta {{count}} grupos. Pasate a Pro para crear más.",
|
||||
@@ -62,7 +63,9 @@
|
||||
"whatsapp_number_in_use": "Ese número de WhatsApp ya está vinculado a otro profesor.",
|
||||
"whatsapp_pairing_not_ready": "WhatsApp todavía está preparando la vinculación. Intentá de nuevo en unos segundos.",
|
||||
"whatsapp_pairing_unsupported": "Este proveedor de WhatsApp no permite vincular con el número de teléfono.",
|
||||
"whatsapp_provider_error": "No pudimos comunicarnos con WhatsApp. Intentá de nuevo en unos minutos."
|
||||
"whatsapp_provider_error": "No pudimos comunicarnos con WhatsApp. Intentá de nuevo en unos minutos.",
|
||||
"guardian_required": "En un grupo de chicos tenés que cargar al adulto a cargo.",
|
||||
"group_has_kids_without_phone": "Hay chicos sin teléfono propio: cargales uno antes de pasar el grupo a adultos."
|
||||
},
|
||||
"auth": {
|
||||
"INVALID_EMAIL_OR_PASSWORD": "El email o la contraseña no son correctos.",
|
||||
|
||||
@@ -93,5 +93,22 @@
|
||||
"importedLinked": "{{count}} ya estaban en otros de tus grupos.",
|
||||
"importedDuplicates_one": "{{count}} duplicado omitido.",
|
||||
"importedDuplicates_other": "{{count}} duplicados omitidos."
|
||||
},
|
||||
"kid": {
|
||||
"kidSection": "El chico",
|
||||
"guardianSection": "Adulto a cargo",
|
||||
"guardianName": "Nombre y apellido",
|
||||
"guardianNamePlaceholder": "Ej.: Ana Pérez",
|
||||
"guardianEmailPlaceholder": "adulto@ejemplo.com",
|
||||
"guardianPhoneHint": "Le llegan los avisos y recordatorios del chico. Si ya lo tenés cargado, lo reconocemos por el teléfono.",
|
||||
"notesPlaceholder": "Ej.: Alergias, quién lo retira",
|
||||
"required": "Completá el nombre del chico y el nombre y teléfono del adulto.",
|
||||
"existing": {
|
||||
"found": "<strong>{{name}}</strong> ya está registrado con ese teléfono: queda como adulto a cargo.",
|
||||
"foundWithKids": "<strong>{{name}}</strong> ya es adulto a cargo de estos chicos. ¿Es alguno de ellos o un hermano nuevo?",
|
||||
"pickLabel": "Elegí el chico",
|
||||
"kidInGroup": "{{name}} (ya está en el grupo)",
|
||||
"newSibling": "Otro chico"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,15 @@
|
||||
"form": {
|
||||
"name": "Nombre del grupo",
|
||||
"namePlaceholder": "Ej: Yoga Vinyasa · Nivel 1",
|
||||
"audience": "¿Para quién es?",
|
||||
"audienceOption": {
|
||||
"ADULTS": "Adultos",
|
||||
"KIDS": "Chicos"
|
||||
},
|
||||
"audienceHint": {
|
||||
"ADULTS": "Cada alumno es su propio contacto",
|
||||
"KIDS": "Hablás con el adulto a cargo"
|
||||
},
|
||||
"days": "Días de clase",
|
||||
"time": "Horario",
|
||||
"capacity": "Cupo máximo",
|
||||
@@ -66,5 +75,13 @@
|
||||
"submitting": "Creando…",
|
||||
"whenLegend": "Las clases",
|
||||
"priceLegend": "El cobro"
|
||||
},
|
||||
"edit": {
|
||||
"link": "Editar",
|
||||
"heading": "Editar grupo",
|
||||
"description": "Los cambios se aplican desde ahora; las cuotas ya generadas no cambian.",
|
||||
"submit": "Guardar cambios",
|
||||
"error": "No pudimos guardar los cambios. Revisá los datos e intentá de nuevo.",
|
||||
"loadError": "No pudimos cargar el grupo."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,5 +63,8 @@
|
||||
},
|
||||
"billing": {
|
||||
"priceInvalid": "Ingresá un precio mayor a cero"
|
||||
},
|
||||
"guardian": {
|
||||
"nameRequired": "Ingresá el nombre del adulto a cargo"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
"unlimitedFor": "{{label}} sem limite",
|
||||
"mpCharges": "Cobranças com Mercado Pago",
|
||||
"whatsappAutomations": "Mensagens automáticas por WhatsApp",
|
||||
"kidsGroups": "Turmas de crianças com responsável",
|
||||
"impact_one": "{{count}} conta já passa desses limites e vai ficar em somente leitura ao salvar.",
|
||||
"impact_other": "{{count}} contas já passam desses limites e vão ficar em somente leitura ao salvar.",
|
||||
"saved": "Limites salvos."
|
||||
|
||||
@@ -158,5 +158,15 @@
|
||||
"alreadyMember": "Esta pessoa já é membro desse grupo.",
|
||||
"moveError": "Não foi possível mudar de grupo.",
|
||||
"addError": "Não foi possível adicionar ao grupo."
|
||||
},
|
||||
"guardian": {
|
||||
"title": "Responsável",
|
||||
"add": "Adicionar",
|
||||
"name": "Nome",
|
||||
"namePlaceholder": "Nome e sobrenome",
|
||||
"required": "Preencha o nome e um telefone válido do responsável.",
|
||||
"shared": "A alteração aparece na ficha de todas as crianças dele.",
|
||||
"siblings": "Irmãos",
|
||||
"missing": "Esta criança ainda não tem um responsável cadastrado."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"unlimitedStudents": "Alunos ilimitados",
|
||||
"students": "Até {{count}} alunos ativos",
|
||||
"mpCharges": "Cobranças com Mercado Pago",
|
||||
"whatsapp": "Mensagens automáticas pelo WhatsApp"
|
||||
"whatsapp": "Mensagens automáticas pelo WhatsApp",
|
||||
"kidsGroups": "Turmas de crianças com responsável"
|
||||
},
|
||||
"subscriptionStatus": {
|
||||
"AUTHORIZED": "Ativa",
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"group_capacity_reached": "O grupo atingiu o limite máximo de membros.",
|
||||
"group_capacity_reached_one": "O grupo atingiu o limite máximo de {{count}} membro.",
|
||||
"group_capacity_reached_other": "O grupo atingiu o limite máximo de {{count}} membros.",
|
||||
"group_owner_required": "Só quem criou o grupo pode mudar as automações.",
|
||||
"group_owner_required": "Só quem criou a turma pode fazer essa alteração.",
|
||||
"group_without_price": "Defina o preço do grupo antes de gerar as cobranças.",
|
||||
"mp_account_in_use": "Essa conta do Mercado Pago já está vinculada a outro professor.",
|
||||
"mp_not_configured": "A vinculação com o Mercado Pago não está disponível no momento.",
|
||||
@@ -41,6 +41,7 @@
|
||||
"plan_feature_required": "Este recurso está disponível no plano Pro.",
|
||||
"plan_feature_required_mpCharges": "Cobrar pelo Mercado Pago está disponível no plano Pro.",
|
||||
"plan_feature_required_whatsappAutomations": "As mensagens automáticas de WhatsApp estão disponíveis no plano Pro.",
|
||||
"plan_feature_required_kidsGroups": "Turmas de crianças com responsável estão disponíveis no plano Pro.",
|
||||
"plan_limit_reached": "Você atingiu o limite do plano Free. Mude para o Pro para continuar crescendo.",
|
||||
"plan_limit_reached_groups_one": "O plano Free permite até {{count}} grupo. Mude para o Pro para criar mais.",
|
||||
"plan_limit_reached_groups_other": "O plano Free permite até {{count}} grupos. Mude para o Pro para criar mais.",
|
||||
@@ -62,7 +63,9 @@
|
||||
"whatsapp_number_in_use": "Esse número de WhatsApp já está vinculado a outro professor.",
|
||||
"whatsapp_pairing_not_ready": "O WhatsApp ainda está preparando a vinculação. Tente novamente em alguns segundos.",
|
||||
"whatsapp_pairing_unsupported": "Este provedor de WhatsApp não permite vincular pelo número de telefone.",
|
||||
"whatsapp_provider_error": "Não conseguimos falar com o WhatsApp. Tente novamente em alguns minutos."
|
||||
"whatsapp_provider_error": "Não conseguimos falar com o WhatsApp. Tente novamente em alguns minutos.",
|
||||
"guardian_required": "Em uma turma de crianças você precisa cadastrar o responsável.",
|
||||
"group_has_kids_without_phone": "Há crianças sem telefone próprio: cadastre um antes de mudar a turma para adultos."
|
||||
},
|
||||
"auth": {
|
||||
"INVALID_EMAIL_OR_PASSWORD": "E-mail ou senha incorretos.",
|
||||
|
||||
@@ -93,5 +93,22 @@
|
||||
"importedLinked": "{{count}} já estavam em outros grupos seus.",
|
||||
"importedDuplicates_one": "{{count}} duplicado ignorado.",
|
||||
"importedDuplicates_other": "{{count}} duplicados ignorados."
|
||||
},
|
||||
"kid": {
|
||||
"kidSection": "A criança",
|
||||
"guardianSection": "Responsável",
|
||||
"guardianName": "Nome e sobrenome",
|
||||
"guardianNamePlaceholder": "Ex.: Ana Souza",
|
||||
"guardianEmailPlaceholder": "responsavel@exemplo.com",
|
||||
"guardianPhoneHint": "Recebe os avisos e lembretes da criança. Se já estiver cadastrado, reconhecemos pelo telefone.",
|
||||
"notesPlaceholder": "Ex.: Alergias, quem busca",
|
||||
"required": "Preencha o nome da criança e o nome e telefone do responsável.",
|
||||
"existing": {
|
||||
"found": "<strong>{{name}}</strong> já está cadastrado com esse telefone: fica como responsável.",
|
||||
"foundWithKids": "<strong>{{name}}</strong> já é responsável por estas crianças. É alguma delas ou um irmão novo?",
|
||||
"pickLabel": "Escolha a criança",
|
||||
"kidInGroup": "{{name}} (já está na turma)",
|
||||
"newSibling": "Outra criança"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,15 @@
|
||||
"form": {
|
||||
"name": "Nome do grupo",
|
||||
"namePlaceholder": "Ex.: Yoga Vinyasa · Nível 1",
|
||||
"audience": "Para quem é?",
|
||||
"audienceOption": {
|
||||
"ADULTS": "Adultos",
|
||||
"KIDS": "Crianças"
|
||||
},
|
||||
"audienceHint": {
|
||||
"ADULTS": "Cada aluno é o próprio contato",
|
||||
"KIDS": "Você fala com o responsável"
|
||||
},
|
||||
"days": "Dias de aula",
|
||||
"time": "Horário",
|
||||
"capacity": "Vagas",
|
||||
@@ -66,5 +75,13 @@
|
||||
"submitting": "Criando…",
|
||||
"whenLegend": "As aulas",
|
||||
"priceLegend": "A cobrança"
|
||||
},
|
||||
"edit": {
|
||||
"link": "Editar",
|
||||
"heading": "Editar turma",
|
||||
"description": "As alterações valem a partir de agora; as mensalidades já geradas não mudam.",
|
||||
"submit": "Salvar alterações",
|
||||
"error": "Não conseguimos salvar as alterações. Revise os dados e tente de novo.",
|
||||
"loadError": "Não conseguimos carregar a turma."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,5 +63,8 @@
|
||||
},
|
||||
"billing": {
|
||||
"priceInvalid": "Informe um preço maior que zero"
|
||||
},
|
||||
"guardian": {
|
||||
"nameRequired": "Informe o nome do responsável"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ import type {
|
||||
CreatePaymentsBatchResult,
|
||||
GroupAnalytics,
|
||||
GroupDto,
|
||||
GuardianInput,
|
||||
UpdateGroup,
|
||||
GroupInviteInfoDto,
|
||||
GroupList,
|
||||
GroupPreRegistrationList,
|
||||
@@ -220,6 +222,12 @@ export const getWhatsappStatus = () => apiFetch<WhatsappStatusDto>('/api/v1/what
|
||||
export const disconnectWhatsapp = () =>
|
||||
apiFetch<WhatsappDisconnectResultDto>('/api/v1/whatsapp/connect', { method: 'DELETE' })
|
||||
|
||||
export const updateGroup = (groupId: string, payload: UpdateGroup) =>
|
||||
apiFetch<GroupDto>(`/api/v1/groups/${groupId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
|
||||
export const updateGroupAutomations = (groupId: string, payload: UpdateGroupAutomations) =>
|
||||
apiFetch<GroupAutomationsDto>(`/api/v1/groups/${groupId}/automations`, {
|
||||
method: 'PATCH',
|
||||
@@ -329,6 +337,13 @@ export const updateGroupAttendee = (
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
|
||||
// El adulto a cargo de un chico: edita el que tiene o vincula uno (por teléfono).
|
||||
export const updateAttendeeGuardian = (groupId: string, attendeeId: string, payload: GuardianInput) =>
|
||||
apiFetch<AttendeeDto>(`/api/v1/groups/${groupId}/attendees/${attendeeId}/guardian`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
|
||||
// Mueve al miembro a otro grupo del profe; devuelve el attendee con su nuevo `groupId`.
|
||||
export const moveGroupAttendee = (groupId: string, attendeeId: string, targetGroupId: string) =>
|
||||
apiFetch<AttendeeDto>(`/api/v1/groups/${groupId}/attendees/${attendeeId}/move`, {
|
||||
|
||||
@@ -45,6 +45,7 @@ import { Route as AdminAccountsAccountIdRouteImport } from './routes/admin/accou
|
||||
import { Route as AuthenticatedClassSessionIdAttendanceRouteImport } from './routes/_authenticated/class/$sessionId/attendance'
|
||||
import { Route as AuthenticatedGroupsGroupIdIndexRouteImport } from './routes/_authenticated/groups/$groupId/index'
|
||||
import { Route as AuthenticatedGroupsGroupIdAnalyticsRouteImport } from './routes/_authenticated/groups/$groupId/analytics'
|
||||
import { Route as AuthenticatedGroupsGroupIdEditRouteImport } from './routes/_authenticated/groups/$groupId/edit'
|
||||
import { Route as AuthenticatedGroupsGroupIdAttendeesAttendeeIdRouteImport } from './routes/_authenticated/groups/$groupId/attendees/$attendeeId'
|
||||
import { Route as AuthenticatedGroupsGroupIdAttendeesNewRouteImport } from './routes/_authenticated/groups/$groupId/attendees/new'
|
||||
|
||||
@@ -233,6 +234,12 @@ const AuthenticatedGroupsGroupIdAnalyticsRoute =
|
||||
path: '/groups/$groupId/analytics',
|
||||
getParentRoute: () => AuthenticatedRoute,
|
||||
} as any)
|
||||
const AuthenticatedGroupsGroupIdEditRoute =
|
||||
AuthenticatedGroupsGroupIdEditRouteImport.update({
|
||||
id: '/groups/$groupId/edit',
|
||||
path: '/groups/$groupId/edit',
|
||||
getParentRoute: () => AuthenticatedRoute,
|
||||
} as any)
|
||||
const AuthenticatedGroupsGroupIdAttendeesAttendeeIdRoute =
|
||||
AuthenticatedGroupsGroupIdAttendeesAttendeeIdRouteImport.update({
|
||||
id: '/groups/$groupId/attendees/$attendeeId',
|
||||
@@ -280,6 +287,7 @@ export interface FileRoutesByFullPath {
|
||||
'/student/': typeof StudentStudentIndexRoute
|
||||
'/class/$sessionId/attendance': typeof AuthenticatedClassSessionIdAttendanceRoute
|
||||
'/groups/$groupId/analytics': typeof AuthenticatedGroupsGroupIdAnalyticsRoute
|
||||
'/groups/$groupId/edit': typeof AuthenticatedGroupsGroupIdEditRoute
|
||||
'/groups/$groupId/': typeof AuthenticatedGroupsGroupIdIndexRoute
|
||||
'/groups/$groupId/attendees/$attendeeId': typeof AuthenticatedGroupsGroupIdAttendeesAttendeeIdRoute
|
||||
'/groups/$groupId/attendees/new': typeof AuthenticatedGroupsGroupIdAttendeesNewRoute
|
||||
@@ -317,6 +325,7 @@ export interface FileRoutesByTo {
|
||||
'/student': typeof StudentStudentIndexRoute
|
||||
'/class/$sessionId/attendance': typeof AuthenticatedClassSessionIdAttendanceRoute
|
||||
'/groups/$groupId/analytics': typeof AuthenticatedGroupsGroupIdAnalyticsRoute
|
||||
'/groups/$groupId/edit': typeof AuthenticatedGroupsGroupIdEditRoute
|
||||
'/groups/$groupId': typeof AuthenticatedGroupsGroupIdIndexRoute
|
||||
'/groups/$groupId/attendees/$attendeeId': typeof AuthenticatedGroupsGroupIdAttendeesAttendeeIdRoute
|
||||
'/groups/$groupId/attendees/new': typeof AuthenticatedGroupsGroupIdAttendeesNewRoute
|
||||
@@ -358,6 +367,7 @@ export interface FileRoutesById {
|
||||
'/_student/student/': typeof StudentStudentIndexRoute
|
||||
'/_authenticated/class/$sessionId/attendance': typeof AuthenticatedClassSessionIdAttendanceRoute
|
||||
'/_authenticated/groups/$groupId/analytics': typeof AuthenticatedGroupsGroupIdAnalyticsRoute
|
||||
'/_authenticated/groups/$groupId/edit': typeof AuthenticatedGroupsGroupIdEditRoute
|
||||
'/_authenticated/groups/$groupId/': typeof AuthenticatedGroupsGroupIdIndexRoute
|
||||
'/_authenticated/groups/$groupId/attendees/$attendeeId': typeof AuthenticatedGroupsGroupIdAttendeesAttendeeIdRoute
|
||||
'/_authenticated/groups/$groupId/attendees/new': typeof AuthenticatedGroupsGroupIdAttendeesNewRoute
|
||||
@@ -398,6 +408,7 @@ export interface FileRouteTypes {
|
||||
| '/student/'
|
||||
| '/class/$sessionId/attendance'
|
||||
| '/groups/$groupId/analytics'
|
||||
| '/groups/$groupId/edit'
|
||||
| '/groups/$groupId/'
|
||||
| '/groups/$groupId/attendees/$attendeeId'
|
||||
| '/groups/$groupId/attendees/new'
|
||||
@@ -435,6 +446,7 @@ export interface FileRouteTypes {
|
||||
| '/student'
|
||||
| '/class/$sessionId/attendance'
|
||||
| '/groups/$groupId/analytics'
|
||||
| '/groups/$groupId/edit'
|
||||
| '/groups/$groupId'
|
||||
| '/groups/$groupId/attendees/$attendeeId'
|
||||
| '/groups/$groupId/attendees/new'
|
||||
@@ -475,6 +487,7 @@ export interface FileRouteTypes {
|
||||
| '/_student/student/'
|
||||
| '/_authenticated/class/$sessionId/attendance'
|
||||
| '/_authenticated/groups/$groupId/analytics'
|
||||
| '/_authenticated/groups/$groupId/edit'
|
||||
| '/_authenticated/groups/$groupId/'
|
||||
| '/_authenticated/groups/$groupId/attendees/$attendeeId'
|
||||
| '/_authenticated/groups/$groupId/attendees/new'
|
||||
@@ -751,6 +764,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof AuthenticatedGroupsGroupIdAnalyticsRouteImport
|
||||
parentRoute: typeof AuthenticatedRoute
|
||||
}
|
||||
'/_authenticated/groups/$groupId/edit': {
|
||||
id: '/_authenticated/groups/$groupId/edit'
|
||||
path: '/groups/$groupId/edit'
|
||||
fullPath: '/groups/$groupId/edit'
|
||||
preLoaderRoute: typeof AuthenticatedGroupsGroupIdEditRouteImport
|
||||
parentRoute: typeof AuthenticatedRoute
|
||||
}
|
||||
'/_authenticated/groups/$groupId/attendees/$attendeeId': {
|
||||
id: '/_authenticated/groups/$groupId/attendees/$attendeeId'
|
||||
path: '/groups/$groupId/attendees/$attendeeId'
|
||||
@@ -780,6 +800,7 @@ interface AuthenticatedRouteChildren {
|
||||
AuthenticatedGroupsIndexRoute: typeof AuthenticatedGroupsIndexRoute
|
||||
AuthenticatedClassSessionIdAttendanceRoute: typeof AuthenticatedClassSessionIdAttendanceRoute
|
||||
AuthenticatedGroupsGroupIdAnalyticsRoute: typeof AuthenticatedGroupsGroupIdAnalyticsRoute
|
||||
AuthenticatedGroupsGroupIdEditRoute: typeof AuthenticatedGroupsGroupIdEditRoute
|
||||
AuthenticatedGroupsGroupIdIndexRoute: typeof AuthenticatedGroupsGroupIdIndexRoute
|
||||
AuthenticatedGroupsGroupIdAttendeesAttendeeIdRoute: typeof AuthenticatedGroupsGroupIdAttendeesAttendeeIdRoute
|
||||
AuthenticatedGroupsGroupIdAttendeesNewRoute: typeof AuthenticatedGroupsGroupIdAttendeesNewRoute
|
||||
@@ -799,6 +820,7 @@ const AuthenticatedRouteChildren: AuthenticatedRouteChildren = {
|
||||
AuthenticatedClassSessionIdAttendanceRoute,
|
||||
AuthenticatedGroupsGroupIdAnalyticsRoute:
|
||||
AuthenticatedGroupsGroupIdAnalyticsRoute,
|
||||
AuthenticatedGroupsGroupIdEditRoute: AuthenticatedGroupsGroupIdEditRoute,
|
||||
AuthenticatedGroupsGroupIdIndexRoute: AuthenticatedGroupsGroupIdIndexRoute,
|
||||
AuthenticatedGroupsGroupIdAttendeesAttendeeIdRoute:
|
||||
AuthenticatedGroupsGroupIdAttendeesAttendeeIdRoute,
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { createFileRoute, useParams } from '@tanstack/react-router'
|
||||
import { EditGroupView } from '../../../../features/groups/EditGroupView'
|
||||
|
||||
export const Route = createFileRoute('/_authenticated/groups/$groupId/edit')({
|
||||
component: () => {
|
||||
const { groupId } = useParams({ from: '/_authenticated/groups/$groupId/edit' })
|
||||
return <EditGroupView groupId={groupId} />
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user