import { model, Schema } from 'mongoose';
const workItemStateChanges = new Schema({
    id: { type: Number, required: true },
    collectionName: { type: String, required: true },
    project: { type: String, required: true },
    workItemType: { type: String, required: true },
    stateChanges: [
        {
            state: { type: String, required: true },
            date: { type: Date, required: true },
        },
    ],
}, { timestamps: true });
workItemStateChanges.index({ collectionName: 1, id: 1 }, { unique: true }); // Used for writes
workItemStateChanges.index({ collectionName: 1, workItemType: 1 });
export const WorkItemStateChangesModel = model('WorkItemStateChanges', workItemStateChanges);
