import * as mongoose from 'mongoose' export type Booker = { name: string email: string phone: string street: string zip: string city: string } export type BookerDocument = Booker & mongoose.SchemaTimestampsConfig & mongoose.Document export type BookerModel = mongoose.Model const BookerSchema = new mongoose.Schema( { name: { type: String, required: true }, email: { type: String, required: true, unique: true, minlength: 5 }, phone: { type: String, required: false }, street: { type: String, required: true }, zip: { type: String, required: true }, city: { type: String, required: true }, }, { timestamps: true, collation: { locale: 'de', strength: 1 } } ) export default mongoose.models.Booker || mongoose.model('Booker', BookerSchema)