Make lock charges calculation functional for happy path

This commit is contained in:
Senad Uka
2019-06-03 18:04:42 +02:00
parent d850aef0b8
commit 8e4eb0cf1f
22 changed files with 820 additions and 61 deletions

20
models/doorLockEvent.js Normal file
View File

@@ -0,0 +1,20 @@
'use strict';
const { USER_LOCKED_DOOR, USER_UNLOCKED_DOOR } = require('../constants/constants');
module.exports = (sequelize, DataTypes) => {
const doorLockEvent = sequelize.define('doorLockEvent', {
memberName: DataTypes.TEXT,
memberNumber: DataTypes.INTEGER,
memberId: DataTypes.TEXT,
event: {
type: DataTypes.ENUM,
values: [USER_LOCKED_DOOR, USER_UNLOCKED_DOOR]
},
timestamp: DataTypes.DATE,
}, {});
doorLockEvent.associate = function(models) {
// associations can be defined here
};
return doorLockEvent;
};