import { Schema } from 'mongoose';
import { z } from 'zod';
import { specmaticCoverageReportValidator, specmaticStubUsageReportValidator, specmaticCentralRepoReportValidator, } from './specmatic-types.js';
export const buildReportCoreValidator = z.object({
    repo: z.string(),
    repoId: z.string(),
    repoUrl: z.string(),
    branch: z.string(),
    branchName: z.string(),
    buildId: z.string(),
    buildDefinitionId: z.string(),
    sonarHost: z.string().optional(),
    sonarProjectKey: z.string().optional(),
    specmaticConfigPath: z.string().optional(),
    specmaticCoverage: specmaticCoverageReportValidator.optional(),
    specmaticStubUsage: specmaticStubUsageReportValidator.optional(),
    specmaticCentralRepoReport: specmaticCentralRepoReportValidator.optional(),
});
export const schemaCore = {
    repo: { type: String, required: true },
    repoId: { type: String, required: true },
    repoUrl: { type: String, required: true }, // Should have required: true, but leaving it off for backwards compatibility
    branch: { type: String, required: true },
    branchName: { type: String, required: true },
    buildId: { type: String, required: true },
    buildDefinitionId: { type: String, required: true },
    sonarHost: String,
    sonarProjectKey: String,
    specmaticConfigPath: String,
    specmaticCoverage: Schema.Types.Mixed,
    specmaticStubUsage: Schema.Types.Mixed,
    specmaticCentralRepoReport: Schema.Types.Mixed,
};
