routes.js 858 B

1234567891011121314151617181920
  1. const C = require('./controllers')
  2. const { routes:crudRoutes } = require('@alancnet/material-framework/lib/crud')
  3. module.exports = app => {
  4. app.get('/api/statistics', C.auth.verify('METRICS_VIEW'), C.statistics.get)
  5. crudRoutes({ app, apiPrefix: '/api/staff-members/:terminal', controller: C.staffMember, camelName: 'staffMember' })
  6. // crudRoutes({ app, controller: C.staffMember, camelName: 'staffMember' })
  7. crudRoutes({ app, controller: C.staffingAgency, camelName: 'staffingAgency' })
  8. // Labor
  9. app.get('/api/labor/:terminal', C.labor.list)
  10. app.get('/api/labor/:terminal/:week', C.labor.get)
  11. app.patch('/api/labor/:terminal/:week', C.labor.patch)
  12. // Services
  13. app.get('/api/services/:terminal', C.services.list)
  14. app.get('/api/services/:terminal/:week', C.services.get)
  15. app.patch('/api/services/:terminal/:week', C.services.patch)
  16. }