Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
C4Ai_DR-P
public-service-provider
Commits
538fd66a
Commit
538fd66a
authored
Jul 02, 2020
by
Mahdi Sellami
Browse files
added person and person adress to case application
parent
9581c0dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
models/application.js
View file @
538fd66a
//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
...
...
models/person.js
View file @
538fd66a
//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
:
PersonAdress
Schema
});
//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
models/personAdress.js
View file @
538fd66a
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment