File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ const ProcedureSchema = new Schema(
21
21
lastUpdateDate : Date ,
22
22
subjectGroups : [ String ] ,
23
23
importantDocuments : [ Document ] ,
24
+ voteResults : {
25
+ yes : { type : Number , required : true } ,
26
+ no : { type : Number , required : true } ,
27
+ abstination : { type : Number , required : true } ,
28
+ } ,
24
29
} ,
25
30
{ timestamps : true } ,
26
31
) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,20 @@ export default async (procedureIds) => {
21
21
} else if ( newBIoProcedure . currentStatus === 'Zurückgezogen' ) {
22
22
newBIoProcedure . voteDate = lastHistory . date ;
23
23
}
24
+ let voteResults = false ;
25
+ procedures . history . forEach ( ( h ) => {
26
+ if ( h . decision ) {
27
+ return h . decision . forEach ( ( decision ) => {
28
+ if ( decision . type === 'Namentliche Abstimmung' ) {
29
+ return ( voteResults = {
30
+ yes : decision . comment ,
31
+ no : decision . comment ,
32
+ abstination : decision . comment ,
33
+ } ) ;
34
+ }
35
+ } ) ;
36
+ }
37
+ } ) ;
24
38
25
39
newBIoProcedure . lastUpdateDate = lastHistory . date ;
26
40
You can’t perform that action at this time.
0 commit comments