-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sync): add dump surveys config for debugging (#18)
- Loading branch information
1 parent
b1d251b
commit b8d0374
Showing
8 changed files
with
62 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
exports.address = require('./address'); | ||
exports.surveyAddressState = require('./surveyAddressState'); | ||
exports.SurveyAddress = require('./surveyAddress'); | ||
exports.SurveyDump = require('./surveyDump'); | ||
exports.SyncLog = require('./syncLog'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const {SURVEYS_COLLECTION} = process.env; | ||
const mongoose = require('mongoose'); | ||
|
||
const {Mixed, ObjectId, Schema} = mongoose; | ||
|
||
module.exports = mongoose.model('SurveyDump', new Schema({ | ||
user: {type: ObjectId, required: true, ref: 'User'}, | ||
surveys: {type: Mixed} | ||
}, {collection: `${SURVEYS_COLLECTION}_dump`, strict: false, timestamps: true})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
exports.StatusService = require('./status'); | ||
exports.SyncService = require('./sync'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const {SurveyDump} = require('../model'); | ||
|
||
class SyncService { | ||
static dumpSurveys(user, surveys) { | ||
const surveyDump = new SurveyDump({user, surveys}); | ||
return surveyDump.save(); | ||
} | ||
} | ||
|
||
module.exports = SyncService; |