feat: Adding warehouse role to user, fix: when creating new employee genKey error
This commit is contained in:
@@ -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');
|
||||||
|
|||||||
@@ -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' },
|
||||||
|
|||||||
Reference in New Issue
Block a user