import { model, Schema } from 'mongoose';
const workItemTypeSchema = new Schema({
    collectionName: { type: String, required: true },
    project: { type: String, required: true },
    name: { type: String, required: true },
    referenceName: { type: String, required: true },
    description: String,
    icon: {
        id: { type: String, required: true },
        url: { type: String, required: true },
    },
    fields: [
        {
            referenceName: { type: String, required: true },
            name: { type: String, required: true },
            helpText: String,
        },
    ],
    transitions: Schema.Types.Mixed,
    states: [
        {
            name: { type: String, required: true },
            color: { type: String, required: true },
            category: { type: String, required: true },
        },
    ],
});
workItemTypeSchema.index({ collectionName: 1, project: 1, referenceName: 1 });
export const WorkItemTypeModel = model('WorkItemType', workItemTypeSchema);
