import { z } from 'zod';
import { SummaryModel } from './mongoose-models/SummaryModel.js';
export const CollectionNameParser = z.object({
    collectionName: z.string(),
});
export const getCollectionTestAutomationSummary = ({ collectionName, }) => SummaryModel.find({ collectionName, duration: '90 days' }, {
    project: 1,
    totalActiveRepos: 1,
    totalRepos: 1,
    weeklyTestsSummary: 1,
    weeklyCoverageSummary: 1,
});
export const getCollectionBuildsSummary = ({ collectionName, }) => SummaryModel.find({ collectionName, duration: '90 days' }, {
    project: 1,
    totalActiveRepos: 1,
    totalRepos: 1,
    totalBuilds: 1,
    successfulBuilds: 1,
    centralTemplatePipeline: 1,
    pipelines: 1,
    centralTemplateUsage: 1,
});
export const getCollectionReleasesSummary = ({ collectionName, }) => SummaryModel.find({ collectionName, duration: '90 days' }, {
    project: 1,
    masterOnly: 1,
    runCount: 1,
    branchPolicy: 1,
    startsWithArtifact: 1,
    pipelineCount: 1,
});
export const getCollectionCodeQualitySummary = async ({ collectionName, }) => SummaryModel.find({ collectionName, duration: '90 days' }, {
    _id: 0,
    project: 1,
    totalActiveRepos: 1,
    totalRepos: 1,
    healthyBranches: 1,
    reposWithSonarQube: 1,
    sonarProjects: 1,
    weeklyReposWithSonarQubeCount: 1,
    weeklySonarProjectsCount: 1,
    branchPolicy: 1,
});
