@@ -376,11 +376,13 @@ function checkContestRound(helper, obj) {
376376 helper . checkNumber ( obj . roomAssignment . p , 'roomAssignment.p' ) ||
377377 helper . checkString ( obj . name , 'name' ) ||
378378 helper . checkString ( obj . status , 'status' ) ||
379- helper . checkString ( obj . short_name , 'short_name' ) ;
379+ helper . checkString ( obj . short_name , 'short_name' ) ||
380+ helper . checkBoolean ( obj . auto_end , 'auto_end' ) ;
380381 if ( ! error ) {
381382 obj . roomAssignment . isByDivision = obj . roomAssignment . isByDivision ? 1 : 0 ;
382383 obj . roomAssignment . isByRegion = obj . roomAssignment . isByRegion ? 1 : 0 ;
383384 obj . roomAssignment . isFinal = obj . roomAssignment . isFinal ? 1 : 0 ;
385+ obj . auto_end = obj . auto_end ? 1 : 0 ;
384386 }
385387 return error ;
386388}
@@ -399,7 +401,7 @@ exports.createSRMContestRound = {
399401 inputs : {
400402 required : [ 'contest_id' , 'type' , 'invitationalType' , 'region' ,
401403 'registrationLimit' , 'roomAssignment' , 'name' , 'status' , 'short_name' ] ,
402- optional : [ ]
404+ optional : [ 'auto_end' ]
403405 } ,
404406 blockedConnectionTypes : [ ] ,
405407 outputExample : { } ,
@@ -412,6 +414,9 @@ exports.createSRMContestRound = {
412414 params = connection . params || { } ,
413415 helper = api . helper ;
414416
417+ if ( _ . isUndefined ( params . auto_end ) ) {
418+ params . auto_end = false ;
419+ }
415420 if ( ! connection . dbConnectionMap ) {
416421 helper . handleNoConnection ( api , connection , next ) ;
417422 return ;
@@ -445,7 +450,8 @@ exports.createSRMContestRound = {
445450 region_id : params . region . region_id ,
446451 name : params . name ,
447452 status : params . status ,
448- short_name : params . short_name
453+ short_name : params . short_name ,
454+ auto_end : params . auto_end
449455 } ,
450456 dbConnectionMap , cbx ) ;
451457 }
0 commit comments