* refactor: use dependency injection for InsightsRoutingService * remove unused getter * clean up * Revert "clean up" This reverts commit a95b83d5dfd4c3236e44268df40bab935237101e. * Update insightsRoutingDI.ts * Revert "Update insightsRoutingDI.ts" This reverts commit 39ead809fa8dabfc17da043c6416bbc6d1fed58d. --------- Co-authored-by: Alex van Andel <me@alexvanandel.com>
30 lines
713 B
TypeScript
30 lines
713 B
TypeScript
import type { readonlyPrisma } from "@calcom/prisma";
|
|
|
|
import {
|
|
InsightsRoutingBaseService,
|
|
type InsightsRoutingServicePublicOptions,
|
|
type InsightsRoutingServiceFilterOptions,
|
|
} from "./insightsRoutingBase";
|
|
|
|
export interface IInsightsRoutingService {
|
|
prisma: typeof readonlyPrisma;
|
|
}
|
|
|
|
export class InsightsRoutingService {
|
|
constructor(private readonly dependencies: IInsightsRoutingService) {}
|
|
|
|
create({
|
|
options,
|
|
filters,
|
|
}: {
|
|
options: InsightsRoutingServicePublicOptions;
|
|
filters: InsightsRoutingServiceFilterOptions;
|
|
}): InsightsRoutingBaseService {
|
|
return new InsightsRoutingBaseService({
|
|
prisma: this.dependencies.prisma,
|
|
options,
|
|
filters,
|
|
});
|
|
}
|
|
}
|