feat: Adding warehouse role to user, fix: when creating new employee genKey error

This commit is contained in:
Josepablo C
2025-02-25 00:51:44 -06:00
parent 2b96f7a20d
commit a44f24853a
2 changed files with 3 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
'user strict'; 'user strict';
const { ROOT_PATH, HANDLERS_PATH, LIB_PATH } = process.env; const { ROOT_PATH, HANDLERS_PATH, LIB_PATH } = process.env;
const { getModel } = require( '../Models' ); const { getModel } = require( '../Models' );
const { GenericHandler } = require( `${ROOT_PATH}/${HANDLERS_PATH}/Generic.handler.js` ); const { GenericHandler } = require( '../Handlers/Generic.handler' );
const { getPagination } = require( `${ROOT_PATH}/${LIB_PATH}/Misc.js` ); const { getPagination, genKey } = require( '../../lib/Misc' );
const usersModel = getModel('users'); const usersModel = getModel('users');
const companiesModel = getModel('companies'); const companiesModel = getModel('companies');

View File

@@ -27,7 +27,7 @@ const schema = new Schema({
dob: { type: String }, dob: { type: String },
// vehicle_status: { type: String, enum: ['Free', 'Loading', 'Moving', 'Downloading'] }, // vehicle_status: { type: String, enum: ['Free', 'Loading', 'Moving', 'Downloading'] },
job_role: { type: String, enum : [ 'admin', 'owner', 'manager', 'driver', 'staff' ] }, job_role: { type: String, enum : [ 'admin', 'owner', 'manager', 'driver', 'staff', 'warehouse' ] },
employee_id: { type: String }, //EM-1000-1 EM-1000-2 employee_id: { type: String }, //EM-1000-1 EM-1000-2
company: { type: Schema.Types.ObjectId, ref: 'companies' }, company: { type: Schema.Types.ObjectId, ref: 'companies' },