Files
Eventment-API/models/organization.js

64 lines
1023 B
JavaScript

const mongoose = require('mongoose');
const timestamps = require('mongoose-timestamp');
const PeopleSchema = new mongoose.Schema(
{
name: {
type: String,
required: true,
trim: true,
},
title: {
type: String,
required: true,
trim: true,
},
bio: {
type: String,
trim: true,
},
address: AddressSchema,
email: EmailSchema,
phone: PhoneSchema,
},
{ minimize: false },
);
const OrganizationSchema = new mongoose.Schema(
{
name: {
type: String,
required: true,
trim: true,
},
url: String,
address: [ AddressSchema ],
telephone: [ TelephoneSchema ],
about: {
type: String,
required: true,
trim: true,
},
team: [ PeopleSchema ],
board: [ PeopleSchema ],
privacyUrl: String,
tosUrl: String,
copyright: String,
},
{ minimize: false },
);
OrganizationSchema.plugin(timestamps);
const Organization = mongoose.model('Organization', OrganizationSchema);
module.exports = Organization;