feat(billing): planes Free/Pro con Suscripciones de Mercado Pago
- Módulo billing: suscripción Pro mensual vía /preapproval con credenciales de plataforma por país, webhook firmado y reconciliación por polling. - PlanGuard en los use-cases que crean grupos/alumnos, cobran con MP o activan automatizaciones (402 plan_limit_reached / plan_feature_required / plan_read_only), detrás de BILLING_ENFORCEMENT. - Onboarding: paso Plan obligatorio (POST /onboarding/plan); con Free se saltean Cobros y WhatsApp. - Web: pantalla /billing, aviso de Pro desde el MutationCache. - Migración billing_subscriptions y docs/billing.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
19
apps/backend/src/modules/billing/lib/index.ts
Normal file
19
apps/backend/src/modules/billing/lib/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export { getGraceDays, getPlatformCredentials, isBillingEnforced, type PlatformCredentials } from './config';
|
||||
export {
|
||||
type Entitlements,
|
||||
exceedsLimits,
|
||||
PlanGuard,
|
||||
type PlanResolution,
|
||||
type PlanUsage,
|
||||
resolvePlan,
|
||||
type SubscriptionSnapshot,
|
||||
} from './entitlements';
|
||||
export { buildSubscriptionBackUrl, countryOf, toBillingChargeDto } from './helpers';
|
||||
export {
|
||||
type MpAuthorizedPayment,
|
||||
type MpPreapproval,
|
||||
mpPreapprovalClient,
|
||||
type PreapprovalClient,
|
||||
} from './mp-preapproval';
|
||||
export { coveredUntil, SyncSubscription, type SyncSubscriptionDeps } from './sync';
|
||||
export { verifyMpSignature } from './webhook-signature';
|
||||
Reference in New Issue
Block a user