change in progress

This commit is contained in:
Emily
2024-10-02 17:05:34 +02:00
parent f516c53b7b
commit 314660d8a3
22 changed files with 503 additions and 438 deletions

View File

@@ -0,0 +1,16 @@
import { VisitModel } from "@schema/metrics/VisitSchema";
import { EventModel } from "@schema/metrics/EventSchema";
import type { Model } from "mongoose";
export type TModelName = keyof typeof allowedModels;
export const allowedModels: Record<string, { model: Model<any> }> = {
'events': {
model: EventModel,
},
'visits': {
model: VisitModel,
}
}

View File

@@ -5,7 +5,7 @@ import type mongoose from "mongoose";
export type TimelineAggregationOptions = {
projectId: mongoose.Schema.Types.ObjectId,
projectId: mongoose.Schema.Types.ObjectId | mongoose.Types.ObjectId,
model: mongoose.Model<any>,
from: string | number,
to: string | number,