service.js 530 B

12345678910111213141516171819202122232425
  1. const Sequelize = require('sequelize')
  2. const sequelize = require('./sequelize')
  3. const Service = sequelize.define('service', {
  4. id: {
  5. type: Sequelize.UUID,
  6. defaultValue: Sequelize.UUIDV1,
  7. primaryKey: true
  8. },
  9. workdayId: Sequelize.UUID,
  10. clientId: Sequelize.UUID,
  11. date: Sequelize.DATEONLY, // Copy from Workday
  12. delivered: Sequelize.INTEGER,
  13. inbound: Sequelize.INTEGER
  14. }, {
  15. paranoid: true,
  16. indexes: [
  17. {
  18. unique: true,
  19. fields: ['workdayId', 'clientId']
  20. }
  21. ]
  22. })
  23. module.exports = Service