import { model, Schema } from 'mongoose';
const buildTimelineRecordSchema = new Schema({
    name: { type: String, required: true },
    order: { type: Number, required: true },
    type: { type: String, required: true },
    result: { type: String, required: true },
    errorCount: { type: Number, required: true },
    warningCount: { type: Number, required: true },
    startTime: { type: Date, required: true },
    finishTime: { type: Date, required: true },
});
const buildTimelineSchema = new Schema({
    collectionName: { type: String, required: true },
    project: { type: String, required: true },
    buildId: { type: Number, required: true },
    buildDefinitionId: { type: Number, required: true },
    records: [buildTimelineRecordSchema],
}, {
    timestamps: true,
});
buildTimelineSchema.index({
    collectionName: 1,
    project: 1,
    buildId: 1,
});
buildTimelineSchema.index({
    collectionName: 1,
    project: 1,
    buildDefinitionId: 1,
});
export const BuildTimelineModel = model('BuildTimeline', buildTimelineSchema);
