- Initial commit... A DB, some routes, and basic authentication routines...

This commit is contained in:
2019-07-04 16:19:30 -04:00
commit d9a2d33913
32 changed files with 3465 additions and 0 deletions

63
models/organization.js Normal file
View File

@@ -0,0 +1,63 @@
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;