import { model, Schema } from 'mongoose';
const codeCoverageSchema = new Schema({
    collectionName: { type: String, required: true },
    project: { type: String, required: true },
    build: {
        id: { type: Number },
        url: { type: String },
    },
    coverageData: [
        {
            coverageStats: [
                {
                    covered: { type: Number, required: true },
                    delta: { type: Number },
                    isDeltaAvailable: { type: Boolean },
                    label: { type: String },
                    position: { type: Number },
                    total: { type: Number },
                },
            ],
        },
    ],
}, { timestamps: true });
codeCoverageSchema.index({
    'collectionName': 1,
    'project': 1,
    'build.id': 1,
});
codeCoverageSchema.index({
    'collectionName': 1,
    'project': 1,
    'build.id': 1,
    'coverageData.coverageStats.label': 1,
});
export const CodeCoverageModel = model('CodeCoverage', codeCoverageSchema);
