Merge pull request #29982 from overleaf/ls-group-ownership-transfer

Stripe subscription ownership transfer

GitOrigin-RevId: 8285f635ecc220595782fbea6def74fdc9a92f36
This commit is contained in:
Liangjun Song
2025-12-11 09:05:57 +00:00
committed by Copybot
parent 427419e6a5
commit 7effe4630f
3 changed files with 135 additions and 23 deletions
+26 -23
View File
@@ -4,6 +4,30 @@ import { TeamInviteSchema } from './TeamInvite.mjs'
const { Schema } = mongoose
const { ObjectId } = Schema
const PaymentProvider = {
service: {
type: String,
},
subscriptionId: {
type: String,
},
state: {
type: String,
},
pausePeriodStart: {
type: Date,
},
pausePeriodEnd: {
type: Date,
},
trialStartedAt: {
type: Date,
},
trialEndsAt: {
type: Date,
},
}
export const SubscriptionSchema = new Schema(
{
admin_id: {
@@ -68,29 +92,8 @@ export const SubscriptionSchema = new Schema(
type: Date,
},
},
paymentProvider: {
service: {
type: String,
},
subscriptionId: {
type: String,
},
state: {
type: String,
},
pausePeriodStart: {
type: Date,
},
pausePeriodEnd: {
type: Date,
},
trialStartedAt: {
type: Date,
},
trialEndsAt: {
type: Date,
},
},
paymentProvider: PaymentProvider,
previousPaymentProvider: PaymentProvider,
collectionMethod: {
type: String,
enum: ['automatic', 'manual'],