import mongoose from 'mongoose';
import { schemaCore } from './core.js';
const { Schema, model } = mongoose;
const azureBuildReportSchema = new Schema({
    collectionName: { type: String, required: true },
    collectionId: { type: String, required: true },
    project: { type: String, required: true },
    ...schemaCore,
    repoUrl: { type: String }, // Not required: true, for backwards compatibility
    buildReason: { type: String, required: true },
    buildScript: { type: String },
    templateRepo: String,
    agentName: String,
    centralTemplate: Schema.Types.Mixed,
}, { timestamps: true });
azureBuildReportSchema.index({
    collectionName: 1,
    project: 1,
    buildId: 1,
});
azureBuildReportSchema.index({
    collectionName: 1,
    project: 1,
    repo: 1,
    buildDefinitionId: 1,
});
export const AzureBuildReportModel = model('AzureBuildReport', azureBuildReportSchema);
