no found
This commit is contained in:
23
models/credito.js
Executable file
23
models/credito.js
Executable file
@@ -0,0 +1,23 @@
|
||||
const mongoose = require('mongoose');
|
||||
const {Schema} =mongoose;
|
||||
|
||||
const itemSchema = new Schema({
|
||||
fecha:{type: String, required:true},
|
||||
detalle:{type:String},
|
||||
valor:{type:Number},
|
||||
tipo:{type:String, required:true}
|
||||
})
|
||||
|
||||
const CreditoSchema=new Schema({
|
||||
date: {type: Date, default: Date.now},
|
||||
nombreCredito: {type:String,required:true},
|
||||
datos:[itemSchema],
|
||||
valor: {type:Number, default:0},
|
||||
tasa_interes:{type:Number, default:0},
|
||||
user:{type:String, required:true},
|
||||
child:itemSchema
|
||||
|
||||
});
|
||||
|
||||
module.exports.Credito=mongoose.model('creditos',CreditoSchema);
|
||||
module.exports.itemCredito=mongoose.model('itemCredito',itemSchema);
|
||||
Reference in New Issue
Block a user