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:
@@ -0,0 +1,13 @@
|
||||
-- Country of the professor (onboarding) + Mercado Pago Checkout Pro payment links.
|
||||
|
||||
-- AlterTable (users)
|
||||
ALTER TABLE "users" ADD COLUMN "country_code" TEXT;
|
||||
|
||||
-- AlterTable (payments)
|
||||
ALTER TABLE "payments" ADD COLUMN "description" TEXT;
|
||||
ALTER TABLE "payments" ADD COLUMN "checkout_url" TEXT;
|
||||
ALTER TABLE "payments" ADD COLUMN "mp_preference_id" TEXT;
|
||||
ALTER TABLE "payments" ADD COLUMN "mp_payment_id" TEXT;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "payments_mp_preference_id_key" ON "payments"("mp_preference_id");
|
||||
@@ -7,6 +7,7 @@ model User {
|
||||
emailVerified Boolean @default(false) @map("email_verified")
|
||||
image String?
|
||||
onboardingCompleted Boolean @default(false) @map("onboarding_completed")
|
||||
country String? @map("country_code")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
|
||||
@@ -95,9 +95,13 @@ model Payment {
|
||||
groupId String @map("group_id")
|
||||
attendeeId String @map("attendee_id")
|
||||
amount Decimal @db.Decimal(10, 2)
|
||||
currency String @default("MXN")
|
||||
currency String @default("ARS")
|
||||
status PaymentStatus @default(PENDING) // PENDING, PAID, OVERDUE, CANCELLED
|
||||
dueDate DateTime @map("due_date")
|
||||
description String? @map("description")
|
||||
checkoutUrl String? @map("checkout_url")
|
||||
mpPreferenceId String? @unique(map: "payments_mp_preference_id_key") @map("mp_preference_id")
|
||||
mpPaymentId String? @map("mp_payment_id")
|
||||
paidAt DateTime? @map("paid_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
Reference in New Issue
Block a user