Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
C4Ai_DR-P
public-service-provider
Commits
2265cbc9
Commit
2265cbc9
authored
Jul 09, 2020
by
Mahdi Sellami
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more logic in POST Application
parent
31b28ac0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
models/application.js
models/application.js
+10
-10
service/ApplicationService.js
service/ApplicationService.js
+11
-0
No files found.
models/application.js
View file @
2265cbc9
...
...
@@ -7,16 +7,16 @@ var DataObjectSchema = require('./dataObject').schema
var
Schema
=
mongoose
.
Schema
;
var
ApplicationSchema
=
new
Schema
({
verfahrensId
:
String
,
leikaId
:
String
,
responsibleAuthority
:
String
,
statusId
:
String
,
statusDescription
:
String
,
statusLastChangeDate
:
String
,
decisionDate
:
String
,
decisionJustification
:
String
,
applicant
:
PersonSchema
,
dataObjects
:
[
DataObjectSchema
]
verfahrensId
:
String
,
leikaId
:
String
,
responsibleAuthority
:
String
,
statusId
:
String
,
statusDescription
:
String
,
statusLastChangeDate
:
String
,
decisionDate
:
String
,
decisionJustification
:
String
,
applicant
:
PersonSchema
,
dataObjects
:
[
DataObjectSchema
]
});
//Export function to create "Application" model class
...
...
service/ApplicationService.js
View file @
2265cbc9
...
...
@@ -18,6 +18,17 @@ exports.postCaseApplication = function(body) {
}
else
{
var
applicationRecord
=
Application
.
create
(
body
).
then
(
function
(
doc
)
{
doc
.
verfahrensId
=
doc
.
id
doc
.
responsibleAuthority
=
serviceRecord
.
responsibleAuthority
doc
.
statusId
=
'
eingereicht
'
doc
.
statusDescription
=
'
Ihr Antrag wird in den nächsten Tagen bearbeitet.
'
doc
.
statusLastChangeDate
=
new
Date
().
toLocaleDateString
(
'
de-DE
'
)
doc
.
decisionDate
=
''
doc
.
decisionJustification
=
''
for
(
const
dataObject
of
doc
.
dataObjects
)
{
dataObject
.
dataObjectId
=
dataObject
.
id
dataObject
.
leikaId
=
doc
.
leikaId
dataObject
.
verfahrensId
=
doc
.
verfahrensId
}
doc
.
save
()
return
doc
});
...
...
Write
Preview
Markdown
is supported
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