mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
20 lines
542 B
JavaScript
20 lines
542 B
JavaScript
import { v4 as uuidv4 } from 'uuid'
|
|
import * as mongoose from 'mongoose'
|
|
|
|
const BookerSchema = new mongoose.Schema(
|
|
{
|
|
_id: {
|
|
type: String,
|
|
default: uuidv4,
|
|
},
|
|
name: { type: String, required: true },
|
|
email: { type: String, required: true, unique: true, minlength: 5 },
|
|
street: { type: String, required: true },
|
|
zip: { type: String, required: true },
|
|
city: { type: String, required: true },
|
|
},
|
|
{ timestamps: true }
|
|
)
|
|
|
|
export default mongoose.models.Booker || mongoose.model('Booker', BookerSchema)
|