- Visu Saldo su Home

- SendRisTo
- Movimenti conto Comunitario
- Profilo
This commit is contained in:
Surya Paolo
2023-03-17 19:07:31 +01:00
parent e705594294
commit 7482b65743
10 changed files with 70 additions and 18 deletions

View File

@@ -692,7 +692,13 @@ CircuitSchema.statics.sendCoins = async function (onlycheck, idapp, usernameOrig
extrarec.saldoOrig = accountorigTable.saldo;
extrarec.saldoDest = accountdestTable.saldo;
let orig = usernameOrig + (extrarec.grouporig ? extrarec.grouporig : '') + (extrarec.contoComOrig ? extrarec.contoComOrig : '');
let orig = usernameOrig;
if (extrarec.grouporig) {
orig = extrarec.grouporig + ' (' + usernameOrig + ')'
}
if (extrarec.contoComOrig) {
orig = extrarec.contoComOrig + ' (' + usernameOrig + ')'
}
let dest = (extrarec.dest ? extrarec.dest : '') + (extrarec.groupDest ? extrarec.groupDest : '') + (extrarec.contoComDest ? extrarec.contoComDest : '');
ris.result = true;

View File

@@ -122,13 +122,13 @@ MovementSchema.statics.addMov = async function (idapp, accountFromIdTable, accou
}
};
MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username, circuitId) {
MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username, groupname, contocom, circuitId) {
try {
if (!circuitId) {
return [];
}
const myaccount = await Account.getAccountByUsernameAndCircuitId(idapp, username, circuitId, '');
const myaccount = await Account.getAccountByUsernameAndCircuitId(idapp, username, circuitId, false, groupname, contocom);
if (myaccount) {
@@ -363,10 +363,10 @@ MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username
'userto.username': 1,
'userto.profile.img': 1,
'groupfrom.groupname': 1,
'groupfrom.descr': 1,
'groupfrom.title': 1,
'groupfrom.photos': 1,
'groupto.groupname': 1,
'groupto.descr': 1,
'groupto.title': 1,
'groupto.photos': 1,
'contocomfrom.path': 1,
'contocomfrom.name': 1,
@@ -387,6 +387,7 @@ MovementSchema.statics.getQueryMovsByCircuitId = async function (idapp, username
return [];
};
MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function (idapp, circuitId) {
try {
@@ -635,13 +636,15 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function (idapp,
'userto.username': 1,
'userto.profile.img': 1,
'groupfrom.groupname': 1,
'groupfrom.descr': 1,
'groupfrom.title': 1,
'groupto.groupname': 1,
'groupto.descr': 1,
'groupto.title': 1,
'contocomfrom.path': 1,
'contocomfrom.name': 1,
'contocomfrom.title': 1,
'contocomto.path': 1,
'contocomto.name': 1,
'contocomto.title': 1,
},
},
@@ -659,7 +662,7 @@ MovementSchema.statics.getQueryAllUsersMovsByCircuitId = async function (idapp,
MovementSchema.statics.getMovsByCircuitId = async function (idapp, username, circuitId) {
const MyMovement = this;
const myquery = await MyMovement.getQueryMovsByCircuitId(idapp, username, circuitId);
const myquery = await MyMovement.getQueryMovsByCircuitId(idapp, username, '', '', circuitId);
if (myquery && myquery.length > 0) {
ris = await MyMovement.aggregate(myquery);

View File

@@ -384,9 +384,9 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = async function (recnotif, us
newdescr = i18n.__('CIRCUIT_SENDCOINSREQ_GROUP', tools.getAhref(username_action, await tools.getLinkUserTelegram(recnotif.idapp, username_action)), qty,
symbol, strtipocontoDest, groupOComdest);
} else if (groupOComorig && (sender === recnotif.paramsObj.usernameDest)) {
newdescr = i18n.__('CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_YOU', strtipocontoOrig, groupOComorig, qty, symbol, recnotif.paramsObj.extrarec.dest);
newdescr = i18n.__('CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_YOU', strtipocontoOrig, groupOComorig, username_action, qty, symbol, recnotif.paramsObj.extrarec.dest);
} else if (groupOComorig) {
newdescr = i18n.__('CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_USER', strtipocontoOrig, groupOComorig, qty, symbol, recnotif.paramsObj.extrarec.dest);
newdescr = i18n.__('CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_USER', strtipocontoOrig, groupOComorig, username_action, qty, symbol, recnotif.paramsObj.extrarec.dest);
} else {
newdescr = i18n.__('CIRCUIT_SENDCOINSREQ', tools.getAhref(username_action, await tools.getLinkUserTelegram(recnotif.idapp, username_action)), qty,
symbol);
@@ -398,9 +398,9 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = async function (recnotif, us
if (myorig) {
if (groupOComdest) {
newdescr = i18n.__('CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_GROUP', strtipocontoOrig, myorig, qty, symbol, strtipocontoDest, groupOComdest);
newdescr = i18n.__('CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_GROUP', strtipocontoOrig, myorig, username_action, qty, symbol, strtipocontoDest, groupOComdest);
} else {
newdescr = i18n.__('CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_USER', strtipocontoOrig, myorig, qty, symbol, mydest);
newdescr = i18n.__('CIRCUIT_SENDCOINSREQ_FROM_GROUP_TO_USER', strtipocontoOrig, myorig, username_action, qty, symbol, mydest);
}
} else {
if (groupOComdest) {
@@ -440,9 +440,13 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = async function (recnotif, us
if (!destinatario) {
destinatario = username_action
}
let saldostr = i18n.__('SALDO_UPDATE', recnotif.paramsObj.extrarec.saldoOrig, symbol);
if (groupOComorig) {
saldostr = i18n.__('SALDO_UPDATE_WHO', groupOComorig, recnotif.paramsObj.extrarec.saldoOrig, symbol);
}
newdescr = i18n.__('ID_CIRCUIT_COINS_ACCEPTED_TO_ME', qty, symbol, destinatario)
+ `\n` + i18n.__('SALDO_UPDATE', recnotif.paramsObj.extrarec.saldoOrig, symbol);
+ `\n` + saldostr;
tag = 'sendcoin';
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_COINS_REFUSED) {
newdescr = i18n.__('ID_CIRCUIT_COINS_REFUSED', qty, symbol, username_action);

View File

@@ -443,6 +443,9 @@ const UserSchema = new mongoose.Schema({
},
noNameSurname: {
type: Boolean,
},
noFoto: {
type: Boolean,
}
},
});
@@ -1578,6 +1581,7 @@ UserSchema.statics.getUserProfileByUsername = async function (
'profile.born_city_id': 1,
'profile.born_province': 1,
'profile.born_country': 1,
'profile.resid_province': 1,
'profile.calc': 1,
'profile.handshake': 1,
'profile.friends': 1,
@@ -1621,6 +1625,7 @@ UserSchema.statics.getUserProfileByUsername = async function (
'profile.born_city_id': 1,
'profile.born_province': 1,
'profile.born_country': 1,
'profile.resid_province': 1,
'profile.calc': 1,
'profile.handshake': 1,
'profile.friends': 1,
@@ -1665,6 +1670,7 @@ UserSchema.statics.getUserProfileByUsername = async function (
'profile.born_city_id': 1,
'profile.born_province': 1,
'profile.born_country': 1,
'profile.resid_province': 1,
'profile.calc': 1,
'profile.handshake': 1,
'profile.friends': 1,
@@ -2705,6 +2711,7 @@ function getWhatToShow(idapp, username) {
'profile.born_city_id': 1,
'profile.born_province': 1,
'profile.born_country': 1,
'profile.resid_province': 1,
'profile.calc': 1,
email: 1,
date_reg: 1,
@@ -2728,6 +2735,7 @@ function getWhatToShow_Unknown(idapp, username) {
'profile.sex': 1,
'profile.born_province': 1,
'profile.born_country': 1,
'profile.resid_province': 1,
'profile.calc': 1,
date_reg: 1,
'profile.handshake': 1,
@@ -2749,6 +2757,7 @@ UserSchema.statics.getWhatToShow_IfFriends = async function (idapp, username) {
'profile.sex': 1,
'profile.born_province': 1,
'profile.born_country': 1,
'profile.resid_province': 1,
'profile.calc': 1,
reported: 1,
date_report: 1,