| 1234567891011121314151617181920212223242526 |
- const Sequelize = require('sequelize')
- const sequelize = require('./sequelize')
- const Service = sequelize.define('service', {
- id: {
- type: Sequelize.UUID,
- defaultValue: Sequelize.UUIDV1,
- primaryKey: true
- },
- workdayId: Sequelize.UUID,
- retailerId: Sequelize.UUID,
- date: Sequelize.DATEONLY, // Copy from Workday
- delivered: Sequelize.INTEGER,
- scanned: Sequelize.INTEGER,
- cartons: Sequelize.INTEGER
- }, {
- paranoid: true,
- indexes: [
- {
- unique: true,
- fields: ['workdayId', 'retailerId']
- }
- ]
- })
- module.exports = Service
|