aggio numtransaction
This commit is contained in:
@@ -30,6 +30,9 @@ const AccountSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
numtransactions: {
|
||||
type: Number,
|
||||
},
|
||||
username: {
|
||||
type: String,
|
||||
},
|
||||
@@ -232,6 +235,11 @@ AccountSchema.statics.addtoSaldo = async function (myaccount, amount, mitt) {
|
||||
myaccount.totTransato = 0;
|
||||
}
|
||||
myaccount.totTransato += Math.abs(amount);
|
||||
|
||||
if (!myaccount.numtransactions)
|
||||
myaccount.numtransactions = 0;
|
||||
myaccount.numtransactions++;
|
||||
|
||||
myaccount.date_updated = new Date();
|
||||
|
||||
myaccountupdate.saldo = myaccount.saldo;
|
||||
@@ -308,6 +316,7 @@ AccountSchema.statics.getAccountByUsernameAndCircuitId = async function (idapp,
|
||||
fidoConcesso: 0,
|
||||
qta_maxConcessa: 0,
|
||||
totTransato: 0,
|
||||
numtransactions: 0,
|
||||
totTransato_pend: 0,
|
||||
});
|
||||
|
||||
|
||||
@@ -716,7 +716,6 @@ module.exports.updateCmd = async function (ordersCart, status, value, req, optio
|
||||
} else if (status === shared_consts.OrderStatus.PAYED) {
|
||||
|
||||
if (value) {
|
||||
// myOrderCart.pagato = false;
|
||||
if (!myOrderCart.pagato) { // Se ancora non è stato confermato:
|
||||
await OrdersCart.addOrderToMovement(myOrderCart, usernameStore, groupnameStore, req);
|
||||
|
||||
|
||||
@@ -646,7 +646,7 @@ router.post('/login', (req, res) => {
|
||||
console.error('ERRORE IN LOGIN: ' + e.message);
|
||||
if (!resalreadysent)
|
||||
res.status(400).
|
||||
send({ code: server_constants.RIS_CODE_LOGIN_ERR_GENERIC });
|
||||
send({ code: server_constants.RIS_CODE_LOGIN_ERR_GENERIC, msgerr: e.message });
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user