import { Schema } from "mongoose";

//#region src/schemas/session.schema.ts
const sessionSchema = new Schema({
	activeOrganizationId: {
		type: Schema.Types.ObjectId,
		ref: "Organization",
		required: false
	},
	activeProjectId: {
		type: 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
export { sessionSchema };
//# sourceMappingURL=session.schema.mjs.map