- verifica email se non è stata verificata (componente)

- altri aggiornamenti grafica PAGERIS.
- OLLAMA AI
This commit is contained in:
Surya Paolo
2025-12-12 00:44:12 +01:00
parent b8dcd7f5e0
commit 037ff6f7f9
16 changed files with 1486 additions and 14 deletions

View File

@@ -342,8 +342,12 @@ MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username
'circuitfrom.symbol': 1,
'circuitto.symbol': 1,
'userfrom.verified_by_aportador': 1,
'userfrom.name': 1,
'userfrom.surname': 1,
'userfrom.username': 1,
'userfrom.profile.img': 1,
'userto.name': 1,
'userto.surname': 1,
'userto.username': 1,
'userto.profile.img': 1,
'userto.verified_by_aportador': 1,
@@ -579,7 +583,11 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function (idapp,
'circuitfrom.symbol': 1,
'circuitto.symbol': 1,
'userfrom.username': 1,
'userfrom.name': 1,
'userfrom.surname': 1,
'userfrom.profile.img': 1,
'userto.name': 1,
'userto.surname': 1,
'userto.username': 1,
'userto.profile.img': 1,
'groupfrom.groupname': 1,
@@ -1013,7 +1021,11 @@ MovementSchema.statics.getLastN_Transactions = async function (
'circuitto.name': 1,
'userfrom.verified_by_aportador': 1,
'userfrom.username': 1,
'userfrom.name': 1,
'userfrom.surname': 1,
'userfrom.profile.img': 1,
'userto.name': 1,
'userto.surname': 1,
'userto.username': 1,
'userto.profile.img': 1,
'userto.verified_by_aportador': 1,

View File

@@ -56,6 +56,9 @@ const UserSchema = new mongoose.Schema(
message: '{VALUE} is not a valid email'
}*/
},
link_verif_email: {
type: String,
},
hash: {
type: String,
},
@@ -2614,6 +2617,12 @@ UserSchema.statics.removeBookmark = async function (idapp, username, id, tab) {
UserSchema.statics.addBookmark = async function (idapp, username, id, tab) {
return await User.updateOne({ idapp, username }, { $push: { 'profile.bookmark': { id, tab } } });
};
UserSchema.statics.setLinkToVerifiedEmail = async function (idapp, username, link_verif_email) {
return await User.updateOne({ idapp, username }, { $set: { link_verif_email } });
};
UserSchema.statics.findByLinkVerifEmail = async function (idapp, link_verif_email) {
return await User.findOne({ idapp, link_verif_email });
};
// Rimuovo il Partecipa
UserSchema.statics.removeAttend = async function (idapp, username, id, tab) {
return await User.updateOne({ idapp, username }, { $pull: { 'profile.attend': { id: { $in: [id] }, tab } } });
@@ -6989,28 +6998,24 @@ UserSchema.statics.getTokenByUsernameAndCircuitName = async function (idapp, use
return user?.profile?.mycircuits?.[0]?.token || null;
};
UserSchema.statics.softDelete = async function(id) {
UserSchema.statics.softDelete = async function (id) {
return this.findByIdAndUpdate(
id,
{
{
deleted: true,
deletedAt: new Date()
deletedAt: new Date(),
},
{ new: true }
);
};
UserSchema.statics.getUsersList = function(idapp) {
UserSchema.statics.getUsersList = function (idapp) {
return this.find({
idapp: idapp,
$or: [
{ deleted: { $exists: false } },
{ deleted: false }
]
$or: [{ deleted: { $exists: false } }, { deleted: false }],
}).lean();
};
const User = mongoose.model('User', UserSchema);
class Hero {