mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
update payment system
This commit is contained in:
@@ -2,14 +2,14 @@ import { model, Schema, Types } from 'mongoose';
|
||||
|
||||
export type TLimitNotify = {
|
||||
_id: Schema.Types.ObjectId,
|
||||
project_id: Schema.Types.ObjectId,
|
||||
user_id: Schema.Types.ObjectId,
|
||||
limit1: boolean,
|
||||
limit2: boolean,
|
||||
limit3: boolean
|
||||
}
|
||||
|
||||
const LimitNotifySchema = new Schema<TLimitNotify>({
|
||||
project_id: { type: Types.ObjectId, index: 1 },
|
||||
user_id: { type: Types.ObjectId, index: 1 },
|
||||
limit1: { type: Boolean },
|
||||
limit2: { type: Boolean },
|
||||
limit3: { type: Boolean }
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import { model, Schema, Types } from 'mongoose';
|
||||
|
||||
export type TProjectLimit = {
|
||||
_id: Schema.Types.ObjectId,
|
||||
project_id: Schema.Types.ObjectId,
|
||||
events: number,
|
||||
visits: number,
|
||||
ai_messages: number,
|
||||
limit: number,
|
||||
ai_limit: number,
|
||||
billing_expire_at: Date,
|
||||
billing_start_at: Date,
|
||||
}
|
||||
|
||||
const ProjectLimitSchema = new Schema<TProjectLimit>({
|
||||
project_id: { type: Types.ObjectId, index: true, unique: true },
|
||||
events: { type: Number, required: true, default: 0 },
|
||||
visits: { type: Number, required: true, default: 0 },
|
||||
ai_messages: { type: Number, required: true, default: 0 },
|
||||
limit: { type: Number, required: true },
|
||||
ai_limit: { type: Number, required: true },
|
||||
billing_start_at: { type: Date, required: true },
|
||||
billing_expire_at: { type: Date, required: true },
|
||||
});
|
||||
|
||||
export const ProjectLimitModel = model<TProjectLimit>('project_limits', ProjectLimitSchema);
|
||||
Reference in New Issue
Block a user