add stripe
Build & Push / Pipeline Tests (push) Failing after 1m6s
Build & Push / Build & Push Docker Image (push) Has been skipped
Test / Type Check (all packages) (push) Failing after 56s
Test / API Unit Tests (push) Has been skipped
Test / Homepage Unit Tests (push) Has been skipped
Test / Carplace Unit Tests (push) Has been skipped
Test / Admin Unit Tests (push) Has been skipped
Test / Dashboard Unit Tests (push) Has been skipped
Test / API Integration Tests (push) Has been skipped

This commit is contained in:
root
2026-07-22 20:17:12 -04:00
parent 7ecd85e9b7
commit bcabd17220
38 changed files with 1674 additions and 96 deletions
@@ -0,0 +1,11 @@
ALTER TYPE "PaymentProvider" ADD VALUE IF NOT EXISTS 'STRIPE';
ALTER TABLE "rental_payments"
ADD COLUMN IF NOT EXISTS "stripeCheckoutSessionId" TEXT,
ADD COLUMN IF NOT EXISTS "stripePaymentIntentId" TEXT;
CREATE UNIQUE INDEX IF NOT EXISTS "rental_payments_stripeCheckoutSessionId_key"
ON "rental_payments"("stripeCheckoutSessionId");
CREATE UNIQUE INDEX IF NOT EXISTS "rental_payments_stripePaymentIntentId_key"
ON "rental_payments"("stripePaymentIntentId");
@@ -0,0 +1,5 @@
ALTER TABLE "subscription_invoices"
ADD COLUMN IF NOT EXISTS "stripeCheckoutSessionId" TEXT;
CREATE UNIQUE INDEX IF NOT EXISTS "subscription_invoices_stripeCheckoutSessionId_key"
ON "subscription_invoices"("stripeCheckoutSessionId");
@@ -0,0 +1,3 @@
ALTER TABLE "subscription_invoices"
ADD COLUMN IF NOT EXISTS "requestedPlan" "Plan",
ADD COLUMN IF NOT EXISTS "requestedBillingPeriod" "BillingPeriod";
+4
View File
@@ -148,6 +148,7 @@ enum BillingCreditNoteStatus {
enum PaymentProvider {
AMANPAY
PAYPAL
STRIPE
MANUAL
}
@@ -603,12 +604,15 @@ model SubscriptionInvoice {
company Company @relation(fields: [companyId], references: [id], onDelete: Cascade)
subscriptionId String
subscription Subscription @relation(fields: [subscriptionId], references: [id])
requestedPlan Plan?
requestedBillingPeriod BillingPeriod?
providerInvoiceId String?
amount Int
currency String @default("MAD")
status InvoiceStatus
amanpayTransactionId String? @unique
paypalCaptureId String? @unique
stripeCheckoutSessionId String? @unique
paymentProvider PaymentProvider @default(AMANPAY)
billingInvoiceId String? @unique
billingInvoice BillingInvoice? @relation(fields: [billingInvoiceId], references: [id])