diff options
author | Raphael Kabo <raphaelkabo@hey.com> | 2023-05-12 16:54:06 +0100 |
---|---|---|
committer | Raphael Kabo <raphaelkabo@hey.com> | 2023-05-12 16:54:06 +0100 |
commit | bfe708d48f603998a1f2c4cad4a6f9f8683dc18f (patch) | |
tree | bc0402abb6fd999f00e2b180144a34c851e36abf /src/models/EventGroup.js | |
parent | 69b4c854b399554ed413cc7ff9d625aee5053927 (diff) |
Migrate to Typescript
Diffstat (limited to 'src/models/EventGroup.js')
-rwxr-xr-x | src/models/EventGroup.js | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/models/EventGroup.js b/src/models/EventGroup.js new file mode 100755 index 0000000..c70ef95 --- /dev/null +++ b/src/models/EventGroup.js @@ -0,0 +1,57 @@ +const mongoose = require('mongoose'); + +const Subscriber = new mongoose.Schema({ + email: { + type: String, + trim: true + }, +}) + +const EventGroupSchema = new mongoose.Schema({ + id: { + type: String, + required: true, + unique: true + }, + name: { + type: String, + trim: true, + required: true + }, + description: { + type: String, + trim: true, + required: true + }, + image: { + type: String, + trim: true + }, + url: { + type: String, + trim: true + }, + creatorEmail: { + type: String, + trim: true + }, + hostName: { + type: String, + trim: true + }, + editToken: { + type: String, + trim: true, + minlength: 32, + maxlength: 32 + }, + firstLoad: { + type: Boolean, + trim: true, + default: true + }, + events: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Event' }], + subscribers: [Subscriber], +}); + +module.exports = mongoose.model('EventGroup', EventGroupSchema); |