Calcolo Hours

This commit is contained in:
Paolo Arena
2021-02-11 02:20:35 +01:00
parent 686d6bf97a
commit 88ae9af12c
12 changed files with 335 additions and 33 deletions

View File

@@ -221,6 +221,12 @@ const UserSchema = new mongoose.Schema({
manage_telegram: {
type: Boolean
},
resplist: {
type: Boolean
},
workerslist: {
type: Boolean
},
dateofbirth: {
type: Date,
},
@@ -1263,6 +1269,28 @@ UserSchema.statics.getusersManagers = async function (idapp) {
});
};
UserSchema.statics.getusersRespList = async function (idapp) {
const User = this;
return await User.find({ idapp, 'profile.resplist': true }, { _id:1, username: 1, name: 1, surname: 1 })
.then((arrrec) => {
return (!!arrrec) ? arrrec : null;
}).catch((e) => {
console.error('getusersRespList', e);
});
};
UserSchema.statics.getusersWorkersList = async function (idapp) {
const User = this;
return await User.find({ idapp, 'profile.workerslist': true }, { _id:1, username: 1, name: 1, surname: 1 })
.then((arrrec) => {
return (!!arrrec) ? arrrec : null;
}).catch((e) => {
console.error('getusersWorkersList', e);
});
};
UserSchema.statics.getusersManagersAndZoomeri = async function (idapp) {
const User = this;