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

@@ -0,0 +1,40 @@
import { logger } from '@/logger';
import { MarkOverduePayments } from './mark-overdue-payments';
import { ReconcilePayments } from './reconcile-payments';
const RECONCILE_CRON = '*/15 * * * *';
const OVERDUE_CRON = '4 4 * * *';
/**
* Registers the payment background jobs. Called once from `server.ts`, following
* the same guards as `startMpJobs`: Bun's in-process cron treats a rejected
* promise as an unhandledRejection (which would crash the process), and `unref`
* keeps the jobs from holding the process alive on their own.
*/
export function startPaymentJobs(): void {
Bun.cron(
RECONCILE_CRON,
async () => {
try {
const totals = await new ReconcilePayments().execute();
logger.info(totals, 'Mercado Pago payments reconciliation finished');
} catch (error) {
logger.error({ err: error }, 'Mercado Pago payments reconciliation failed');
}
},
{ tz: 'UTC' },
).unref();
Bun.cron(
OVERDUE_CRON,
async () => {
try {
const totals = await new MarkOverduePayments().execute();
logger.info(totals, 'Overdue payments marked');
} catch (error) {
logger.error({ err: error }, 'Marking overdue payments failed');
}
},
{ tz: 'UTC' },
).unref();
}