chore: update comments and documentation for clarity and consistency across various files
- Translated comments from Spanish to English in vite.config.ts, docker-compose.yml, attendance-risk.ts, analytics.ts, attendance.ts, attendees.ts, enums.ts, groups.ts, and onboarding.ts. - Improved descriptions for better understanding of code functionality and purpose. - Ensured uniformity in terminology and phrasing throughout the codebase.
This commit is contained in:
@@ -69,10 +69,10 @@ export type UpdateStudentStatusResult = z.output<typeof UpdateStudentStatusResul
|
||||
export const groupRiskLevelSchema = z.enum(['NONE', 'MEDIUM', 'HIGH']);
|
||||
export type GroupRiskLevel = z.output<typeof groupRiskLevelSchema>;
|
||||
|
||||
/** Cuántos miembros van en la lista de urgentes del resumen. La tarjeta del
|
||||
* listado solo nombra al primero o dos; el detalle tiene su propia pantalla
|
||||
* de alumnos en riesgo, así que el resumen no necesita arrastrar al grupo
|
||||
* entero por la red. */
|
||||
/** How many members go in the summary's urgent list. The listing card only
|
||||
* names the first one or two; the detail page has its own at-risk students
|
||||
* screen, so the summary does not need to drag the whole group over the
|
||||
* network. */
|
||||
export const URGENT_MEMBERS_LIMIT = 5;
|
||||
|
||||
export const UrgentMemberSummarySchema = z.object({
|
||||
@@ -85,21 +85,22 @@ export const UrgentMemberSummarySchema = z.object({
|
||||
});
|
||||
export type UrgentMemberSummary = z.output<typeof UrgentMemberSummarySchema>;
|
||||
|
||||
/* El nivel es el peor alumno del grupo; los dos contadores dicen por qué se
|
||||
dispara, para que la lista pueda nombrar el motivo en vez de un "riesgo".
|
||||
Son disjuntos: un miembro con racha de faltas va solo en el primero, y el
|
||||
segundo agrupa a los que solo cruzan por asistencia baja. */
|
||||
/* The level is the worst attendee in the group; the two counters say why it
|
||||
fires, so the list can name the reason instead of a bare "risk". They are
|
||||
disjoint: a member with an absence streak lands only in the first, and the
|
||||
second groups those who only cross over for low attendance. */
|
||||
export const GroupRiskSummarySchema = z.object({
|
||||
groupId: z.string(),
|
||||
groupName: z.string(),
|
||||
riskLevel: groupRiskLevelSchema,
|
||||
absenceStreakCount: z.number().int().min(0),
|
||||
lowAttendanceCount: z.number().int().min(0),
|
||||
/* Lo que come la tarjeta del listado y la sección de seguimiento del Inicio.
|
||||
Sale de `getGroupAttendanceSummary` (packages/shared/src/lib/attendance-risk.ts),
|
||||
que ya recibe todo el historial en memoria: el resumen por nivel no se puede
|
||||
derivar de los dos contadores de arriba, porque "ok" es la diferencia y los
|
||||
lugares libres salen del cupo, no de la asistencia. */
|
||||
/* What the listing card and the Home follow-up section consume. It comes
|
||||
from `getGroupAttendanceSummary` (packages/shared/src/lib/attendance-risk.ts),
|
||||
which already receives the whole history in memory: the per-level summary
|
||||
cannot be derived from the two counters above, because "ok" is the
|
||||
difference and the free spots come from the capacity, not from
|
||||
attendance. */
|
||||
riesgoAlto: z.number().int().min(0),
|
||||
atencion: z.number().int().min(0),
|
||||
ok: z.number().int().min(0),
|
||||
|
||||
@@ -6,9 +6,9 @@ const isoDateTimeSchema = z.string().datetime();
|
||||
export const attendanceStatusSchema = z.enum(['PRESENT', 'ABSENT', 'EXCUSED']);
|
||||
export type AttendanceStatus = z.output<typeof attendanceStatusSchema>;
|
||||
|
||||
/* Los tres niveles del semáforo de asistencia, en el orden de la regla (de
|
||||
mejor a peor). El dominio los usa como tipo y este schema los valida cuando
|
||||
viajan por la API, así que hay una sola definición. */
|
||||
/* The three levels of the attendance status light, in rule order (best to
|
||||
worst). The domain uses them as a type and this schema validates them when
|
||||
they travel over the API, so there is a single definition. */
|
||||
export const attendanceRiskLevelSchema = z.enum(['ok', 'atencion', 'riesgo_alto']);
|
||||
export type AttendanceRiskLevelDto = z.output<typeof attendanceRiskLevelSchema>;
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ const pageSchema = createPageSchema();
|
||||
const pageSizeSchema = createPageSizeSchema(10);
|
||||
const paginationSchema = createPaginationSchema();
|
||||
|
||||
/* Cuántas clases recientes viajan por miembro en el listado. Es el tamaño de la
|
||||
tira de puntos del roster, no una ventana de análisis: la analítica pide
|
||||
HISTORY_SESSIONS_LIMIT clases aparte. */
|
||||
/* How many recent class sessions travel per member in the listing. This is the
|
||||
size of the roster's dot strip, not an analysis window: analytics asks for
|
||||
HISTORY_SESSIONS_LIMIT classes separately. */
|
||||
export const RECENT_ATTENDANCE_LIMIT = 5;
|
||||
|
||||
export const AttendeeDtoSchema = z.object({
|
||||
@@ -49,9 +49,9 @@ export const AttendeeQuerySchema = z.object({
|
||||
export type AttendeeQuery = z.output<typeof AttendeeQuerySchema>;
|
||||
|
||||
/**
|
||||
* Cobro del período vigente, tal como está en la base: sin columna
|
||||
* desnormalizada y sin veredicto calculado. El backend devuelve el pago
|
||||
* impago más reciente; el cliente decide cómo presentarlo.
|
||||
* Charge for the current period, as stored in the database: no denormalized
|
||||
* column and no computed verdict. The backend returns the most recent unpaid
|
||||
* payment; the client decides how to present it.
|
||||
*/
|
||||
export const AttendeePaymentSummarySchema = z.object({
|
||||
status: paymentStatusSchema,
|
||||
@@ -60,15 +60,14 @@ export const AttendeePaymentSummarySchema = z.object({
|
||||
export type AttendeePaymentSummary = z.output<typeof AttendeePaymentSummarySchema>;
|
||||
|
||||
/**
|
||||
* Item del listado de miembros: `AttendeeDto` más el resumen que la fila
|
||||
* necesita para no vaciarse de datos. Es un superconjunto, así que todo
|
||||
* consumidor del DTO plano sigue sirviéndose sin cambios; solo los listados
|
||||
* verían estos dos campos extra.
|
||||
* Member listing item: `AttendeeDto` plus the summary the row needs so it does
|
||||
* not run dry of data. It is a superset, so every consumer of the plain DTO
|
||||
* keeps working unchanged; only the listings see these two extra fields.
|
||||
*/
|
||||
export const AttendeeListItemSchema = AttendeeDtoSchema.extend({
|
||||
/** Últimas clases de más antigua a más reciente. Vacío si nunca se registró ninguna. */
|
||||
/** Most recent class sessions, oldest to newest. Empty if none was ever recorded. */
|
||||
recentAttendance: z.array(attendanceStatusSchema).max(RECENT_ATTENDANCE_LIMIT),
|
||||
/** `null` si no hay ningún cobro impago registrado. */
|
||||
/** `null` if there is no unpaid charge on record. */
|
||||
payment: AttendeePaymentSummarySchema.nullable(),
|
||||
});
|
||||
export type AttendeeListItem = z.output<typeof AttendeeListItemSchema>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
// Días de la semana en que se dictan las clases.
|
||||
// Weekdays on which classes are held.
|
||||
export const weekdaySchema = z.enum([
|
||||
'MONDAY',
|
||||
'TUESDAY',
|
||||
@@ -12,10 +12,10 @@ export const weekdaySchema = z.enum([
|
||||
]);
|
||||
export type WeekDay = z.output<typeof weekdaySchema>;
|
||||
|
||||
// Procesadores de pago soportados.
|
||||
// Supported payment processors.
|
||||
export const paymentProviderSchema = z.enum(['MERCADO_PAGO', 'STRIPE']);
|
||||
export type PaymentProvider = z.output<typeof paymentProviderSchema>;
|
||||
|
||||
// Frecuencia de cobro de un grupo.
|
||||
// Billing frequency of a group.
|
||||
export const billingTypeSchema = z.enum(['MONTHLY', 'PER_CLASS']);
|
||||
export type BillingType = z.output<typeof billingTypeSchema>;
|
||||
@@ -15,7 +15,7 @@ export const GroupDtoSchema = z.object({
|
||||
createdById: z.string(),
|
||||
createdAt: isoDateTimeSchema,
|
||||
updatedAt: isoDateTimeSchema,
|
||||
// Horario y cobro: quedan vacíos si el grupo aún no tiene configurado el plan.
|
||||
// Schedule and billing: null while the group has no plan configured yet.
|
||||
days: z.array(weekdaySchema).nullable(),
|
||||
time: z.string().nullable(),
|
||||
capacity: z.number().int().min(1).nullable(),
|
||||
@@ -45,11 +45,11 @@ export const InviteTokenResultSchema = z.object({
|
||||
});
|
||||
export type InviteTokenResult = z.output<typeof InviteTokenResultSchema>;
|
||||
|
||||
/* En el listado cada grupo viaja con sus dos contadores de ocupación porque la
|
||||
card los muestra: `attendeesCount` son los miembros del grupo (todos, igual
|
||||
que cuenta el detalle) y `waitlistCount` los que están en lista de espera
|
||||
esperando cupo (PENDING). La lista de pre-inscriptos es otra cosa y no
|
||||
entra acá. */
|
||||
/* In the listing every group travels with its two occupancy counters because
|
||||
the card shows them: `attendeesCount` are the group's members (all of them,
|
||||
same as the detail page counts) and `waitlistCount` those on the waitlist
|
||||
waiting for a spot (PENDING). The pre-registrations list is a different
|
||||
thing and does not belong here. */
|
||||
export const GroupListItemSchema = GroupDtoSchema.extend({
|
||||
attendeesCount: z.number().int().min(0),
|
||||
waitlistCount: z.number().int().min(0),
|
||||
@@ -59,7 +59,7 @@ export type GroupListItem = z.output<typeof GroupListItemSchema>;
|
||||
export const GroupQuerySchema = z.object({
|
||||
page: pageSchema,
|
||||
pageSize: pageSizeSchema,
|
||||
// Zona de la persona: el listado se ordena por la próxima clase en su hora local.
|
||||
// The person's time zone: the listing sorts by the next class in their local time.
|
||||
timeZone: timeZoneSchema.optional(),
|
||||
});
|
||||
export type GroupQuery = z.output<typeof GroupQuerySchema>;
|
||||
|
||||
@@ -5,10 +5,10 @@ import { GroupDtoSchema } from './groups.js';
|
||||
export type { BillingType, PaymentProvider, WeekDay } from './enums.js';
|
||||
export { billingTypeSchema, paymentProviderSchema, weekdaySchema } from './enums.js';
|
||||
|
||||
// Paso 2: vincula la cuenta de cobro del profesor.
|
||||
// Step 2: link the teacher's payment account.
|
||||
export const ConnectPaymentSchema = z.strictObject({
|
||||
provider: paymentProviderSchema,
|
||||
// Para el MVP se conecta en modo simulación / sandbox.
|
||||
// For the MVP it connects in simulation / sandbox mode.
|
||||
sandbox: z.boolean().default(true),
|
||||
accessToken: z.string().optional(),
|
||||
});
|
||||
@@ -21,7 +21,7 @@ export const ConnectPaymentResultSchema = z.object({
|
||||
});
|
||||
export type ConnectPaymentResult = z.output<typeof ConnectPaymentResultSchema>;
|
||||
|
||||
// Paso 3: crea el primer grupo del profesor.
|
||||
// Step 3: create the teacher's first group.
|
||||
export const CreateFirstGroupSchema = z.strictObject({
|
||||
name: z
|
||||
.string()
|
||||
@@ -64,7 +64,7 @@ export const CreateFirstGroupResultSchema = z.object({
|
||||
});
|
||||
export type CreateFirstGroupResult = z.output<typeof CreateFirstGroupResultSchema>;
|
||||
|
||||
// Estado del onboarding para retomar el flujo si se interrumpió.
|
||||
// Onboarding state, to resume the flow if it was interrupted.
|
||||
export const onboardingStepSchema = z.enum(['NOT_STARTED', 'PAYMENT_CONNECTED', 'COMPLETED']);
|
||||
export type OnboardingStep = z.output<typeof onboardingStepSchema>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user