This commit is contained in:
2022-10-02 08:03:49 -05:00
parent 153f2da1f7
commit b4a5db028e
8 changed files with 568 additions and 2 deletions

22
models/ahorros.js Executable file
View File

@@ -0,0 +1,22 @@
const mongoose = require('mongoose');
const {Schema} =mongoose;
const itemSchema = new Schema({
detalle:{type:String},
valor:{type:Number},
tipo:{type:String, required:true}
})
const AhorroSchema=new Schema({
date: {type: Date, default: Date.now},
nombreAhorro: {type:String,required:true},
detalleAhorro:{type:String,required:true},
datos:[itemSchema],
user:{type:String, required:true},
child:itemSchema
});
module.exports.Ahorro=mongoose.model('ahorro',AhorroSchema);
module.exports.itemAhorro=mongoose.model('itemAhorro',itemSchema);