upload, parse and store door lock entries

This commit is contained in:
Bilal Catic
2019-05-30 03:44:11 +02:00
parent d141889c4d
commit 79bcf91dc7
16 changed files with 528 additions and 57 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.STRING,
memberNumber: DataTypes.INTEGER,
event: {
type: DataTypes.ENUM,
values: [USER_LOCKED_DOOR, USER_UNLOCKED_DOOR]
},
date: DataTypes.DATEONLY,
time: DataTypes.TIME,
}, {});
doorLockEvent.associate = function(models) {
// associations can be defined here
};
return doorLockEvent;
};