addtocash using sendcoins Circuit

This commit is contained in:
Surya Paolo
2024-01-03 15:46:42 +01:00
parent 75ef581635
commit 66e4c577c7
6 changed files with 97 additions and 44 deletions

View File

@@ -36,6 +36,7 @@ const MovementSchema = new Schema({
accountToId: {
type: String,
},
idOrdersCart: { type: Schema.Types.ObjectId, ref: 'OrdersCart' },
causal_table: {
type: String,
},
@@ -56,6 +57,10 @@ const MovementSchema = new Schema({
expiringDate: {
type: Date,
},
confirmed: {
type: Boolean,
default: false,
},
});
MovementSchema.statics.findAllIdApp = async function (idapp) {
@@ -90,7 +95,7 @@ MovementSchema.statics.executeQueryTable = function (idapp, params) {
return tools.executeQueryTable(this, 0, params);
};
MovementSchema.statics.addMov = async function (idapp, accountFromIdTable, accountToIdTable, amount, causal, notifId) {
MovementSchema.statics.addMov = async function (idapp, accountFromIdTable, accountToIdTable, amount, causal, notifId, idOrdersCart) {
try {
// Only positive values
@@ -102,6 +107,7 @@ MovementSchema.statics.addMov = async function (idapp, accountFromIdTable, accou
transactionDate: new Date(),
accountFromId: accountFromIdTable._id,
accountToId: accountToIdTable._id,
idOrdersCart: idOrdersCart._id ?? null,
amount,
causal,
residual: 0,