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,25 @@
'use strict';
const { doorLockEvents } = require('../constants/constants');
module.exports = (sequelize, DataTypes) => {
const unscheduledIncident = sequelize.define('unscheduledIncident', {
reservationId: DataTypes.TEXT,
memberId: DataTypes.TEXT,
resourceId: DataTypes.TEXT,
bookingStart: DataTypes.DATE,
bookingEnd: DataTypes.DATE,
doorLockEventTimestamp: DataTypes.DATE,
doorLockEventType: {
type: DataTypes.ENUM,
values: [doorLockEvents.USER_LOCKED, doorLockEvents.USER_UNLOCKED]
},
chargePrice: DataTypes.FLOAT,
timeIntervalsToCharge: DataTypes.INTEGER,
totalChargeFee: DataTypes.FLOAT,
}, {});
unscheduledIncident.associate = function(models) {
// associations can be defined here
};
return unscheduledIncident;
};