File size: 1,486 Bytes
4e83772 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import { QueryProjectDTO } from "@/dtos/project.dto.js";
import { IProject } from "@/models/Projects.js";
import { Types } from "mongoose";
export interface IProjectRepository {
createProject(project: Partial<IProject>): Promise<IProject | null>;
getAllProjects(userId: string, query: QueryProjectDTO & { fields?: string[] }): Promise<{ projects: IProject[]; total: number }>;
findProject(projectId: string, userId: string, options?: { include?: string; fields?: string[]; deletedToo?: boolean }): Promise<IProject | null>;
findProjectsBySubdomain(subdomain: string): Promise<IProject[]>;
deleteProject(projectId: string, userId: string): Promise<IProject | null>;
checkProjectExistBySubdomain(subdomain: string): Promise<{ _id: string } | null>;
updateProject(projectId: string, userId: string, updateData: Partial<IProject>): Promise<IProject | null>;
pushToDeployments(prjectId: string, userId: string, newDeployment: string | Types.ObjectId): Promise<IProject | null>;
pullDeployments(
projectId: string,
userId: string,
newDeployment: string | Types.ObjectId,
backUpDeployment: string | null,
): Promise<IProject | null>;
__findProject(projectId: string): Promise<IProject | null>;
__findProjectByRepo(repoId: number): Promise<IProject | null>;
__updateProject(projectId: string, updateData: Partial<IProject>): Promise<IProject | null>;
__updateManyProject(repoIds: number[], updateData: Partial<IProject>, userId?: string): Promise<IProject | null>;
}
|