ahorros
This commit is contained in:
22
models/ahorros.js
Executable file
22
models/ahorros.js
Executable 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);
|
||||
Reference in New Issue
Block a user