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,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user