diff options
author | eug-vs <eug-vs@keemail.me> | 2020-11-14 14:56:12 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-11-14 14:56:12 +0300 |
commit | fd3efcdec584d550f70fb473386e01086e8238e0 (patch) | |
tree | d5019e835f70fd70fe6825704e8aa7c010ed8ce3 /services/events | |
parent | 87306ea2e4ffad7b8c588da0423ecf199575ac9c (diff) | |
download | bsu-fantom-fd3efcdec584d550f70fb473386e01086e8238e0.tar.gz |
feat: add Users and Events services
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); + |