Lista Richieste e Rifiutati dei Conti Collettivi
This commit is contained in:
@@ -23,3 +23,5 @@ se hai bisogno di aiuto chiedi in questa chat: 👉🏻 chat riso help
|
|||||||
Gio 05/01 ORE 19:28: USER [paoloar77]: vai al sito
|
Gio 05/01 ORE 19:28: USER [paoloar77]: vai al sito
|
||||||
|
|
||||||
Gio 05/01 ORE 19:28: USER [paoloar77]: link da condividere
|
Gio 05/01 ORE 19:28: USER [paoloar77]: link da condividere
|
||||||
|
|
||||||
|
Gio 16/02 ORE 18:14: USER [paoloar77]: vai al sito
|
||||||
|
|||||||
@@ -47,12 +47,13 @@
|
|||||||
"RICHIESTA_BLOCCO_CIRCUIT": "Richiesta di bloccare il Circuito %s da parte di %s",
|
"RICHIESTA_BLOCCO_CIRCUIT": "Richiesta di bloccare il Circuito %s da parte di %s",
|
||||||
"CIRCUIT_ELIMINATO": "Il circuito %s è stato eliminato da parte di %s",
|
"CIRCUIT_ELIMINATO": "Il circuito %s è stato eliminato da parte di %s",
|
||||||
"ACCETTATO_NOTIFICA_ADMINS_CIRCUIT": "✅ l'utente %s è stato accettato a far parte del Circuito %s (da parte di %s)",
|
"ACCETTATO_NOTIFICA_ADMINS_CIRCUIT": "✅ l'utente %s è stato accettato a far parte del Circuito %s (da parte di %s)",
|
||||||
"ACCETTATO_NOTIFICA_ADMINS_CIRCUIT_MYGROUP": "✅ il gruppo %s è stato accettato a far parte del Circuito %s (da parte di %s)",
|
"ACCETTATO_NOTIFICA_ADMINS_CIRCUIT_MYGROUP": "✅ il Conto Collettivo %s è stato accettato a far parte del Circuito %s (da parte di %s)",
|
||||||
"CIRCUIT_ACCEPTED": "✅ Sei stato accettato da %s a far parte del Circuito %s.\nApri la APP e clicca in alto a destra sull'icona delle monete, oppure clicca qui: %s",
|
"CIRCUIT_ACCEPTED": "✅ Sei stato accettato da %s a far parte del Circuito %s.\nApri la APP e clicca in alto a destra sull'icona delle monete, oppure clicca qui: %s",
|
||||||
"CIRCUIT_ACCEPTED_YOU": "✅ Hai accettato %s a far parte del Circuito %s",
|
"CIRCUIT_ACCEPTED_YOU": "✅ Hai accettato %s a far parte del Circuito %s",
|
||||||
"CIRCUIT_REFUSED": "❌ Ti è stato rifiutato l'accesso da %s a far parte del Circuito %s. Se pensi sia un'errore, contatta l'amministratore del Circuito.",
|
"CIRCUIT_REFUSED": "❌ Ti è stato rifiutato l'accesso da %s a far parte del Circuito %s. Se pensi sia un'errore, contatta l'amministratore del Circuito.",
|
||||||
"CIRCUIT_REMOVED": "❌ l'utente %s è stato rimosso del Circuito %s (da parte di %s)",
|
"CIRCUIT_REMOVED": "❌ l'utente %s è stato rimosso del Circuito %s (da parte di %s)",
|
||||||
"CIRCUIT_REFUSED_TO_ME": "All'utente %s gli è stato rifiutato l'accesso a far parte del Circuito %s (da parte di %s).",
|
"CIRCUIT_REFUSED_TO_ME": "All'utente %s gli è stato rifiutato l'accesso a far parte del Circuito %s (da parte di %s).",
|
||||||
|
"CIRCUIT_REFUSED_TO_MYGROUP": "Al Conto Collettivo %s gli è stato rifiutato l'accesso a far parte del Circuito %s (da parte di %s).",
|
||||||
"CIRCUIT_EXIT_USER": "❌ l'utente %s è uscito dal Circuito %s",
|
"CIRCUIT_EXIT_USER": "❌ l'utente %s è uscito dal Circuito %s",
|
||||||
"CIRCUIT_EXIT_USER_TO_ME": "❌ Sei uscito dal Circuito %s",
|
"CIRCUIT_EXIT_USER_TO_ME": "❌ Sei uscito dal Circuito %s",
|
||||||
"CIRCUIT_REMOVED_TO_ME": "❌ Sei stato rimosso dal Circuito %s (da parte di %s)",
|
"CIRCUIT_REMOVED_TO_ME": "❌ Sei stato rimosso dal Circuito %s (da parte di %s)",
|
||||||
|
|||||||
@@ -343,7 +343,9 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = async function (recnotif, us
|
|||||||
tag = 'remcircuit';
|
tag = 'remcircuit';
|
||||||
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_REFUSED) {
|
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_REFUSED) {
|
||||||
if (recnotif.paramsObj.isAdmin) {
|
if (recnotif.paramsObj.isAdmin) {
|
||||||
newdescr = i18n.__('CIRCUIT_REFUSED_TO_ME', sender, recnotif.paramsObj.circuitnameDest, username_action);
|
if (recnotif.extrarec.groupname) {
|
||||||
|
newdescr = i18n.__('CIRCUIT_REFUSED_TO_MYGROUP', recnotif.extrarec.groupname, recnotif.paramsObj.circuitnameDest, username_action);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
newdescr = i18n.__('CIRCUIT_REFUSED', username_action, recnotif.paramsObj.circuitnameDest);
|
newdescr = i18n.__('CIRCUIT_REFUSED', username_action, recnotif.paramsObj.circuitnameDest);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ const cors = require('cors');
|
|||||||
// console.log(" 2) fs");
|
// console.log(" 2) fs");
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const NUOVO_METODO_TEST = false;
|
||||||
|
|
||||||
const server_constants = require('./tools/server_constants');
|
const server_constants = require('./tools/server_constants');
|
||||||
|
|
||||||
//const throttle = require('express-throttle-bandwidth');
|
//const throttle = require('express-throttle-bandwidth');
|
||||||
@@ -49,19 +51,23 @@ if ((process.env.NODE_ENV === 'production') ||
|
|||||||
|
|
||||||
var privateKey = fs.readFileSync(process.env.PATH_CERT_KEY, 'utf8');
|
var privateKey = fs.readFileSync(process.env.PATH_CERT_KEY, 'utf8');
|
||||||
var certificate = fs.readFileSync(process.env.PATH_SERVER_CRT, 'utf8');
|
var certificate = fs.readFileSync(process.env.PATH_SERVER_CRT, 'utf8');
|
||||||
/*var credentials = {
|
let credentials = {};
|
||||||
key: privateKey,
|
|
||||||
cert: certificate,
|
if (NUOVO_METODO_TEST) {
|
||||||
ca: [
|
credentials = {
|
||||||
fs.readFileSync(process.env.PATH_SSL_ROOT_PEM, 'utf8'),
|
key: privateKey,
|
||||||
fs.readFileSync(process.env.PATH_SSL_CHAIN_PEM, 'utf8'),
|
cert: certificate,
|
||||||
],
|
};
|
||||||
};
|
} else {
|
||||||
*/
|
credentials = {
|
||||||
var credentials = {
|
key: privateKey,
|
||||||
key: privateKey,
|
cert: certificate,
|
||||||
cert: certificate,
|
ca: [
|
||||||
};
|
fs.readFileSync(process.env.PATH_SSL_ROOT_PEM, 'utf8'),
|
||||||
|
fs.readFileSync(process.env.PATH_SSL_CHAIN_PEM, 'utf8'),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var https = require('https');
|
var https = require('https');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1756,6 +1756,37 @@ module.exports = {
|
|||||||
return myquery;
|
return myquery;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getGroupnameLookupPipeLine(params, proj) {
|
||||||
|
|
||||||
|
let myquery = [
|
||||||
|
{
|
||||||
|
$lookup: {
|
||||||
|
from: params.lk_tab,
|
||||||
|
let: { groupname: '$' + params.lk_LF, idapp: params.idapp },
|
||||||
|
pipeline: [
|
||||||
|
{
|
||||||
|
$match:
|
||||||
|
{
|
||||||
|
$expr:
|
||||||
|
{
|
||||||
|
$and:
|
||||||
|
[
|
||||||
|
{ $eq: ['$' + params.lk_FF, '$$' + params.lk_FF] },
|
||||||
|
{ $eq: ['$idapp', '$$idapp'] },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
as: params.lk_as,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ $project: proj },
|
||||||
|
];
|
||||||
|
|
||||||
|
return myquery;
|
||||||
|
},
|
||||||
|
|
||||||
getLookup: function (params, num, pass_proj) {
|
getLookup: function (params, num, pass_proj) {
|
||||||
const query = [];
|
const query = [];
|
||||||
|
|
||||||
@@ -2110,6 +2141,8 @@ module.exports = {
|
|||||||
}, 0, {
|
}, 0, {
|
||||||
'user.idapp': 1,
|
'user.idapp': 1,
|
||||||
'user.username': 1,
|
'user.username': 1,
|
||||||
|
'user.name': 1,
|
||||||
|
'user.surname': 1,
|
||||||
'user.profile.img': 1,
|
'user.profile.img': 1,
|
||||||
'user.profile.qualifica': 1,
|
'user.profile.qualifica': 1,
|
||||||
});
|
});
|
||||||
@@ -2180,6 +2213,83 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
} else if (params.querytype === shared_consts.QUERYTYPE_GROUP_CIRCUIT) {
|
||||||
|
|
||||||
|
const myq = this.addQueryIdMatch(params);
|
||||||
|
if (myq)
|
||||||
|
query.push(myq);
|
||||||
|
|
||||||
|
query.push({ $project: { req_groups: 1 } });
|
||||||
|
const qa1 = this.getLookup(
|
||||||
|
{
|
||||||
|
lk_tab: 'mygroups',
|
||||||
|
lk_LF: 'req_groups.groupname',
|
||||||
|
lk_FF: 'groupname',
|
||||||
|
lk_as: 'group',
|
||||||
|
}, 0, {
|
||||||
|
'group.idapp': 1,
|
||||||
|
'group.groupname': 1,
|
||||||
|
'group.photos': 1,
|
||||||
|
});
|
||||||
|
if (qa1) query = [...query, ...qa1];
|
||||||
|
query.push({ $unwind: '$group' });
|
||||||
|
|
||||||
|
query.push({
|
||||||
|
$match: {
|
||||||
|
$and: [
|
||||||
|
{ 'group.idapp': params.idapp },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
query.push({
|
||||||
|
$replaceRoot: {
|
||||||
|
newRoot: '$group',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
} else if (params.querytype === shared_consts.QUERYTYPE_REFUSED_GROUP_CIRCUIT) {
|
||||||
|
|
||||||
|
|
||||||
|
const myq = this.addQueryIdMatch(params);
|
||||||
|
if (myq)
|
||||||
|
query.push(myq);
|
||||||
|
|
||||||
|
query.push({ $project: { refused_groups: 1 } });
|
||||||
|
query.push({ $unwind: '$refused_groups' });
|
||||||
|
const qa1 = this.getGroupnameLookupPipeLine(
|
||||||
|
{
|
||||||
|
lk_tab: 'mygroups',
|
||||||
|
lk_LF: 'refused_groups.groupname',
|
||||||
|
lk_FF: 'groupname',
|
||||||
|
lk_as: 'group',
|
||||||
|
idapp,
|
||||||
|
}, {
|
||||||
|
'group.idapp': 1,
|
||||||
|
'group.groupname': 1,
|
||||||
|
'group.descr': 1,
|
||||||
|
'group.photos': 1,
|
||||||
|
});
|
||||||
|
if (qa1) query = [...query, ...qa1];
|
||||||
|
query.push({ $unwind: '$group' });
|
||||||
|
/*
|
||||||
|
query.push({
|
||||||
|
$match: {
|
||||||
|
$and: [
|
||||||
|
{'user.idapp': params.idapp},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
query.push({
|
||||||
|
$replaceRoot: {
|
||||||
|
newRoot: '$group',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
} else if (params.querytype === shared_consts.QUERYTYPE_LIST_MOVEMENTS) {
|
} else if (params.querytype === shared_consts.QUERYTYPE_LIST_MOVEMENTS) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ module.exports = {
|
|||||||
QUERYTYPE_REFUSED_USER_CIRCUIT: 12,
|
QUERYTYPE_REFUSED_USER_CIRCUIT: 12,
|
||||||
QUERYTYPE_LIST_MOVEMENTS: 15,
|
QUERYTYPE_LIST_MOVEMENTS: 15,
|
||||||
QUERYTYPE_LIST_ALLMOVEMENTS: 16,
|
QUERYTYPE_LIST_ALLMOVEMENTS: 16,
|
||||||
|
QUERYTYPE_GROUP_CIRCUIT: 20,
|
||||||
|
QUERYTYPE_REFUSED_GROUP_CIRCUIT: 22,
|
||||||
// ---------------------
|
// ---------------------
|
||||||
|
|
||||||
FILTER_EXTRALIST_NOT_REGISTERED: 1,
|
FILTER_EXTRALIST_NOT_REGISTERED: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user