new selfhosted version

This commit is contained in:
antonio
2025-11-28 14:11:51 +01:00
parent afda29997d
commit 951860f67e
1046 changed files with 72586 additions and 574750 deletions

View File

@@ -0,0 +1,26 @@
import { model, Schema, Types } from 'mongoose';
export type TPremium = {
user_id: Schema.Types.ObjectId,
premium_type: number,
customer_id: string,
subscription_id: string,
expire_at: number,
payment_failed?: boolean,
plan_cancelled?: boolean,
created_at: Date,
}
const PremiumSchema = new Schema<TPremium>({
user_id: { type: Types.ObjectId, unique: true, index: 1 },
customer_id: { type: String },
premium_type: { type: Number },
subscription_id: { type: String },
expire_at: { type: Number },
payment_failed: { type: Boolean },
plan_cancelled: { type: Boolean },
created_at: { type: Date, default: () => Date.now() }
})
export const PremiumModel = model<TPremium>('premiums', PremiumSchema);