28 lines
781 B
TypeScript
28 lines
781 B
TypeScript
import Database from "@Common/databases/database";
|
|
import BaseRepository from "@Repositories/BaseRepository";
|
|
import { Service } from "typedi";
|
|
import { Prisma } from "@prisma/client";
|
|
|
|
@Service()
|
|
export default class RulesGroupsRepository extends BaseRepository {
|
|
constructor(private database: Database) {
|
|
super();
|
|
}
|
|
protected get model() {
|
|
return this.database.getClient().rulesGroups;
|
|
}
|
|
protected get instanceDb() {
|
|
return this.database.getClient();
|
|
}
|
|
|
|
/**
|
|
* @description : Find many subscriptions
|
|
*/
|
|
public async findMany(query: Prisma.RulesGroupsFindManyArgs) {
|
|
query.take = Math.min(query.take || this.defaultFetchRows, this.maxFetchRows);
|
|
if (!query.include) return this.model.findMany({ ...query });
|
|
return this.model.findMany({ ...query });
|
|
}
|
|
|
|
}
|