feat: add country selection during onboarding and implement payment management features

- Introduced CountryStep component for selecting the country during onboarding, affecting payment currency.
- Updated FirstGroupStep to include country information.
- Enhanced PaymentsProvider to manage payment states and renewals.
- Created PaymentRow component for displaying individual payment details.
- Implemented PaymentsView for listing and filtering payments by group and status.
- Added API endpoints for fetching and creating payments, including batch processing.
- Defined payment schemas for validation and data handling.
- Updated GroupHeader and GroupDetailView to include charging functionality for group members.
This commit is contained in:
Jose Selesan
2026-10-08 11:42:13 -03:00
parent b11dd47534
commit 8c5caecdda
49 changed files with 2367 additions and 90 deletions

View File

@@ -1,12 +1,17 @@
import { z } from 'zod';
import { countryCodeSchema, DEFAULT_COUNTRY } from './country.js';
import { billingTypeSchema, weekdaySchema } from './enums.js';
import { GroupDtoSchema } from './groups.js';
export { countryCodeSchema } from './country.js';
export type { BillingType, WeekDay } from './enums.js';
export { billingTypeSchema, weekdaySchema } from './enums.js';
// Step 3: create the teacher's first group. Linking Mercado Pago is step 2 and
// is skippable, so nothing here may require a linked account.
// Step 4: create the teacher's first group. Linking Mercado Pago is step 2 and
// is skippable, so nothing here may require a linked account. The country is
// stored on the user and drives the currency of the payment links later. It
// defaults to Argentina because the group form (also used outside onboarding)
// has no country field: the country lives on the user, not on the group.
export const CreateFirstGroupSchema = z.strictObject({
name: z
.string()
@@ -30,6 +35,7 @@ export const CreateFirstGroupSchema = z.strictObject({
.int({ message: 'El día debe ser un número entero' })
.min(1, 'El día de vencimiento debe estar entre 1 y 28')
.max(28, 'El día de vencimiento debe estar entre 1 y 28'),
country: countryCodeSchema.default(DEFAULT_COUNTRY),
});
export type CreateFirstGroup = z.output<typeof CreateFirstGroupSchema>;