import mongoose, {Document, Schema} from 'mongoose';

export interface ILocation {
	name: string;
	description?: string;
}

export interface ILocationModel extends ILocation, Document {}

const LocationSchema: Schema = new Schema(
	{
		name: {
			type: String,
			required: true,
		},
		description: {
			type: String,
		},
	},
	{versionKey: false}
);

export default mongoose.model<ILocationModel>('Location', LocationSchema);
