Commit 538fd66a authored by Mahdi Sellami's avatar Mahdi Sellami

added person and person adress to case application

parent 9581c0dd
//Require Mongoose
var mongoose = require('mongoose');
var PersonSchema = require('./person').schema
//Define a schema
var Schema = mongoose.Schema;
......@@ -13,7 +14,7 @@ var ApplicationSchema = new Schema({
statusLastChangeDate : String,
decisionDate : String,
decisionJustification : String,
//applicant : {type: Schema.Types.ObjectId, ref: 'Person'}
applicant : PersonSchema
});
//Export function to create "Application" model class
......
//Require Mongoose
var mongoose = require('mongoose');
var PersonAdressSchema = require('./personAdress').schema
//Define a schema
var Schema = mongoose.Schema;
......@@ -9,8 +10,8 @@ var PersonSchema = new Schema({
prename : String,
surname : String,
email : String,
//address : {type: Schema.Types.ObjectId, ref: 'PersonAdress'}
address : PersonAdressSchema
});
//Export function to create "Person" model class
module.exports = mongoose.model('Person', PersonSchema );
\ No newline at end of file
module.exports = Person = mongoose.model('Person', PersonSchema );
\ No newline at end of file
......@@ -13,4 +13,4 @@ var PersonAdressSchema = new Schema({
});
//Export function to create "PersonAdress" model class
module.exports = mongoose.model('PersonAdress', PersonAdressSchema );
\ No newline at end of file
module.exports = PersonAdress = mongoose.model('PersonAdress', PersonAdressSchema );
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment