2021-02-25 07:22:24 -05:00
|
|
|
const AbstractMockApi = require('./AbstractMockApi')
|
|
|
|
|
|
|
|
class MockAnalyticsApi extends AbstractMockApi {
|
|
|
|
reset() {
|
|
|
|
this.updates = {}
|
|
|
|
}
|
|
|
|
|
|
|
|
applyRoutes() {
|
|
|
|
this.app.get('/graphs/:graph', (req, res) => {
|
|
|
|
return res.json({})
|
|
|
|
})
|
|
|
|
|
|
|
|
this.app.get('/recentInstitutionActivity', (req, res) => {
|
|
|
|
res.json({
|
|
|
|
institutionId: 123,
|
|
|
|
day: {
|
|
|
|
projects: 0,
|
2021-04-27 03:52:58 -04:00
|
|
|
users: 0,
|
2021-02-25 07:22:24 -05:00
|
|
|
},
|
|
|
|
week: {
|
|
|
|
projects: 0,
|
2021-04-27 03:52:58 -04:00
|
|
|
users: 0,
|
2021-02-25 07:22:24 -05:00
|
|
|
},
|
|
|
|
month: {
|
|
|
|
projects: 1,
|
2021-04-27 03:52:58 -04:00
|
|
|
users: 2,
|
|
|
|
},
|
2021-02-25 07:22:24 -05:00
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = MockAnalyticsApi
|
|
|
|
|
|
|
|
// type hint for the inherited `instance` method
|
|
|
|
/**
|
|
|
|
* @function instance
|
|
|
|
* @memberOf MockAnalyticsApi
|
|
|
|
* @static
|
|
|
|
* @returns {MockAnalyticsApi}
|
|
|
|
*/
|