-
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.
Update SessionRepository to use new db
Update DBFactory to create a single db Update config to the single db type Create Session model Create Session Mapper Update Session Router to class Create GenericRouter Create session tests Separeted Auth stub to its own class Commented prints on index.js Created npm script to lint-fix
- Loading branch information
Eduardo Maia
committed
Jun 27, 2019
1 parent
227e551
commit da916b1
Showing
27 changed files
with
381 additions
and
478 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
port: 3000, | ||
db: 'firestore2' | ||
db: 'firestore' | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
class NoteController { | ||
constructor (noteRepository) { | ||
this.noteRepository = noteRepository | ||
} | ||
|
||
async getNotesFromSession (note) { | ||
return this.noteRepository.getNotes(note.getNote()) | ||
} | ||
|
||
async addNewNoteToSession (note) { | ||
return this.noteRepository.addNewNoteToSession(note.getNote()) | ||
} | ||
|
||
async deleteNote (note) { | ||
return this.noteRepository.deleteNote(note.id) | ||
} | ||
|
||
async editNote (note) { | ||
return this.noteRepository.editNote(note.id, note.getNote()) | ||
} | ||
} | ||
|
||
module.exports = NoteController |
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
const Joi = require('joi') | ||
|
||
class SessionController { | ||
constructor (sessionRepository) { | ||
this.sessionRepository = sessionRepository | ||
} | ||
|
||
async getAllSessions (meeting) { | ||
return this.sessionRepository.getAllSessions(meeting) | ||
} | ||
|
||
async getSession (session) { | ||
this.validateSessionId(session) | ||
return this.sessionRepository.getSession(session.getIdObject()) | ||
} | ||
|
||
async createSession (session) { | ||
this.validateSession(session) | ||
return this.sessionRepository.createSession(session.getSession()) | ||
} | ||
|
||
async deleteSession (session) { | ||
this.validateSessionId(session) | ||
return this.sessionRepository.deleteSession(session.id) | ||
} | ||
|
||
async editSession (session) { | ||
this.validateFullSession(session) | ||
return this.sessionRepository.editSession(session.id, session.getSession()) | ||
} | ||
|
||
validateSessionId (session) { | ||
Joi.validate(session, Joi.object({ | ||
id: Joi.string().required() | ||
})) | ||
} | ||
|
||
validateFullSession (session) { | ||
Joi.validate(session, Joi.object({ | ||
id: Joi.string().required(), | ||
topics: Joi.array().items(Joi.string()).required(), | ||
timestamp: Joi.date().timestamp().required() | ||
})) | ||
} | ||
|
||
validateSession (session) { | ||
Joi.validate(session, Joi.object({ | ||
topics: Joi.array().items(Joi.string()).required() | ||
})) | ||
} | ||
} | ||
module.exports = SessionController |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.