diff options
Diffstat (limited to 'services/events')
-rw-r--r-- | services/events/event.model.js | 6 | ||||
-rw-r--r-- | services/events/event.schema.js | 16 | ||||
-rw-r--r-- | services/events/event.service.js | 7 |
3 files changed, 29 insertions, 0 deletions
diff --git a/services/events/event.model.js b/services/events/event.model.js new file mode 100644 index 0000000..7bac9d5 --- /dev/null +++ b/services/events/event.model.js @@ -0,0 +1,6 @@ +const { model } = require('mongoose'); +const eventSchema = require('./event.schema.js'); + +module.exports = model('Event', eventSchema); + + diff --git a/services/events/event.schema.js b/services/events/event.schema.js new file mode 100644 index 0000000..555153b --- /dev/null +++ b/services/events/event.schema.js @@ -0,0 +1,16 @@ +const { Schema, Types } = require('mongoose'); + +module.exports = new Schema({ + startDate: { + type: Date, + required: true + }, + endDate: { + type: Date, + required: true + }, + attendanceId: Number, + conferenceId: Number, + participantIds: [Types.ObjectId] +}, { timestamps: true }); + diff --git a/services/events/event.service.js b/services/events/event.service.js new file mode 100644 index 0000000..e9e7e50 --- /dev/null +++ b/services/events/event.service.js @@ -0,0 +1,7 @@ +const service = require('feathers-mongoose'); +const Model = require('./event.model.js'); + +const EventService = service({ Model }) + +module.exports = app => app.use('/events', EventService); + |