Files
old-crm-integration/models/unlockedIncident.js
2019-06-14 17:41:09 +02:00

30 lines
1.0 KiB
JavaScript

'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;
};