const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
let mongoose = require("mongoose");
mongoose = require_rolldown_runtime.__toESM(mongoose);

//#region src/schemas/audit.schema.ts
const auditSchema = new mongoose.Schema({
	url: {
		type: String,
		required: true
	},
	summary: {
		type: mongoose.Schema.Types.Mixed,
		required: true
	},
	errors: {
		type: mongoose.Schema.Types.Mixed,
		required: true,
		default: {}
	},
	score: {
		type: Number,
		required: true
	},
	label: {
		type: String,
		required: true
	},
	userId: {
		type: mongoose.Schema.Types.ObjectId,
		ref: "User",
		required: false
	},
	projectId: {
		type: mongoose.Schema.Types.ObjectId,
		ref: "Project",
		required: false
	}
}, {
	timestamps: true,
	toJSON: {
		virtuals: true,
		versionKey: false,
		transform(_doc, ret) {
			const { _id,...rest } = ret;
			return {
				...rest,
				id: _id.toString()
			};
		}
	},
	toObject: {
		virtuals: true,
		transform(_doc, ret) {
			const { _id,...rest } = ret;
			return {
				...rest,
				id: _id
			};
		}
	}
});

//#endregion
exports.auditSchema = auditSchema;
//# sourceMappingURL=audit.schema.cjs.map