mirror of
https://github.com/Litlyx/litlyx
synced 2026-02-05 15:12:18 +01:00
implementing new payment system + rewrite deploy scripts
This commit is contained in:
22
shared_global/schema/PremiumSchema.ts
Normal file
22
shared_global/schema/PremiumSchema.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
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,
|
||||
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 },
|
||||
created_at: { type: Date, default: () => Date.now() }
|
||||
})
|
||||
|
||||
export const PremiumModel = model<TPremium>('premiums', PremiumSchema);
|
||||
|
||||
Reference in New Issue
Block a user