detect and save unscheduled and unlocked incidents

This commit is contained in:
Bilal Catic
2019-06-14 08:05:24 +02:00
parent 07061d3d19
commit 596336c41b
19 changed files with 929 additions and 78 deletions

View File

@@ -0,0 +1,29 @@
'use strict';
const { unlockedIncidentLevelsPrices } = require('../constants/constants');
module.exports = (sequelize, DataTypes) => {
const unlockedIncident = sequelize.define('unlockedIncident', {
reservationId: DataTypes.TEXT,
memberId: DataTypes.TEXT,
resourceId: DataTypes.TEXT,
bookingStart: DataTypes.DATE,
bookingEnd: DataTypes.DATE,
incidentLevel: {
type: DataTypes.ENUM,
values: [
unlockedIncidentLevelsPrices.UNLOCKED_0.title,
unlockedIncidentLevelsPrices.UNLOCKED_1.title,
unlockedIncidentLevelsPrices.UNLOCKED_2.title,
unlockedIncidentLevelsPrices.UNLOCKED_3.title,
unlockedIncidentLevelsPrices.UNLOCKED_4.title,
unlockedIncidentLevelsPrices.UNLOCKED_5.title,
]
},
incidentLevelPrice: DataTypes.FLOAT,
}, {});
unlockedIncident.associate = function(models) {
// associations can be defined here
};
return unlockedIncident;
};