refactoring dashboard

This commit is contained in:
Emily
2025-01-23 17:34:43 +01:00
parent afeaac1b0d
commit e4bdf7e4c3
112 changed files with 2345 additions and 12532 deletions

View File

@@ -0,0 +1,20 @@
import { model, Schema, Types } from 'mongoose';
export type TApiSettings = {
_id: Schema.Types.ObjectId,
project_id: Schema.Types.ObjectId,
apiKey: string,
apiName: string,
usage: number,
created_at: Date
}
const ApiSettingsSchema = new Schema<TApiSettings>({
project_id: { type: Types.ObjectId, index: 1 },
apiKey: { type: String, required: true },
apiName: { type: String, required: true },
usage: { type: Number, default: 0, required: true, },
created_at: { type: Date, default: () => Date.now() },
});
export const ApiSettingsModel = model<TApiSettings>('api_settings', ApiSettingsSchema);