- Initial commit... A DB, some routes, and basic authentication routines...
This commit is contained in:
63
models/organization.js
Normal file
63
models/organization.js
Normal 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;
|
||||
Reference in New Issue
Block a user