Skip to content

Students

The gym’s student registry — mirrors apps/web’s Students page exactly. health_declaration is LGPD-sensitive personal data (Lei 13.709/2018 art. 5º II); health_declaration_accepted records consent.

List students for the caller’s org.

ArgumentTypeRequiredNotes
limitnumbernodefault 50, max 200
offsetnumbernodefault 0
statusactive | inactive | cancellednofilter

Ordered by full_name ascending.

Each item keeps the existing student fields and adds four operational fields:

FieldTypeMeaning
whatsapp_number_configuredbooleantrue when students.phone contains a non-empty value.
whatsapp_numberstring | nullThe stored value, or null when it is not configured.
payment_due_day_configuredbooleantrue when an active contract contains due_day.
payment_due_daynumber | nullThe configured day, or null when it is not configured.

The payment day comes from contracts.due_day, not an invoice date. Cancelled and expired contracts do not define the current payment day. If multiple active contracts contain a day, the newest start_date wins. The newest created_at wins the next tie. The ascending contract id wins the final tie.

A successful response makes false plus null mean not configured. If the related data is unavailable, the tool returns an error. It does not report an unknown value as not configured. The query uses the caller’s JWT and existing RLS scope.

ArgumentTypeRequired
iduuidyes
ArgumentTypeRequiredNotes
full_namestringyes
phonestringno
cpfstringno
birth_datestringnoYYYY-MM-DD
statusactive | inactive | cancellednodefaults to active
emergency_contact_namestringno
emergency_contact_phonestringno
health_declarationstringnofree text
health_declaration_acceptedbooleannotrue stamps health_declaration_accepted_at now

Same fields as create_student, all optional (partial update), plus id (required). Nullable fields accept null to clear. health_declaration_accepted: false clears the consent timestamp; omit to leave it unchanged.

ArgumentTypeRequired
iduuidyes

Fails if the student still has class_enrollments, check_ins, or contracts rows (no cascading deletes).