@@ -87,12 +87,13 @@ public async Task<IActionResult> Launch(string id, CancellationToken token)
8787 }
8888 }
8989
90- [ HttpGet ( "{id}/suspend" ) ]
90+ [ HttpPost ( "{id}/suspend" ) ]
9191 [ Authorize ( "suspend_caseplaninstance" ) ]
92- public async Task < IActionResult > Suspend ( string id , CancellationToken token )
92+ public async Task < IActionResult > Suspend ( string id , [ FromBody ] SuspendCommand suspendCommand , CancellationToken token )
9393 {
9494 try
9595 {
96+ suspendCommand . CasePlanInstanceId = id ;
9697 await _mediator . Send ( new SuspendCommand ( id , null ) , token ) ;
9798 return new OkResult ( ) ;
9899 }
@@ -123,13 +124,15 @@ public async Task<IActionResult> Suspend(string id, CancellationToken token)
123124 }
124125 }
125126
126- [ HttpGet ( "{id}/suspend/{elt}" ) ]
127+ [ HttpPost ( "{id}/suspend/{elt}" ) ]
127128 [ Authorize ( "suspend_caseplaninstance" ) ]
128- public async Task < IActionResult > Suspend ( string id , string elt , CancellationToken token )
129+ public async Task < IActionResult > Suspend ( string id , string elt , [ FromBody ] SuspendCommand suspendCommand , CancellationToken token )
129130 {
130131 try
131132 {
132- await _mediator . Send ( new SuspendCommand ( id , elt ) , token ) ;
133+ suspendCommand . CasePlanInstanceId = id ;
134+ suspendCommand . CasePlanInstanceElementId = elt ;
135+ await _mediator . Send ( suspendCommand , token ) ;
133136 return new OkResult ( ) ;
134137 }
135138 catch ( UnknownCasePlanInstanceException )
@@ -159,13 +162,14 @@ public async Task<IActionResult> Suspend(string id, string elt, CancellationToke
159162 }
160163 }
161164
162- [ HttpGet ( "{id}/reactivate" ) ]
165+ [ HttpPost ( "{id}/reactivate" ) ]
163166 [ Authorize ( "reactivate_caseplaninstance" ) ]
164- public async Task < IActionResult > Reactivate ( string id , CancellationToken token )
167+ public async Task < IActionResult > Reactivate ( string id , [ FromBody ] ReactivateCommand reactivateCommand , CancellationToken token )
165168 {
166169 try
167170 {
168- await _mediator . Send ( new ReactivateCommand ( id , null ) , token ) ;
171+ reactivateCommand . CaseInstanceId = id ;
172+ await _mediator . Send ( reactivateCommand , token ) ;
169173 return new OkResult ( ) ;
170174 }
171175 catch ( UnknownCasePlanInstanceException )
@@ -195,13 +199,15 @@ public async Task<IActionResult> Reactivate(string id, CancellationToken token)
195199 }
196200 }
197201
198- [ HttpGet ( "{id}/reactivate/{elt}" ) ]
202+ [ HttpPost ( "{id}/reactivate/{elt}" ) ]
199203 [ Authorize ( "reactivate_caseplaninstance" ) ]
200- public async Task < IActionResult > Reactivate ( string id , string elt , CancellationToken token )
204+ public async Task < IActionResult > Reactivate ( string id , string elt , [ FromBody ] ReactivateCommand reactivateCommand , CancellationToken token )
201205 {
202206 try
203207 {
204- await _mediator . Send ( new ReactivateCommand ( id , elt ) , token ) ;
208+ reactivateCommand . CaseInstanceId = id ;
209+ reactivateCommand . CaseInstanceElementId = elt ;
210+ await _mediator . Send ( reactivateCommand , token ) ;
205211 return new OkResult ( ) ;
206212 }
207213 catch ( UnknownCasePlanInstanceException )
@@ -231,13 +237,14 @@ public async Task<IActionResult> Reactivate(string id, string elt, CancellationT
231237 }
232238 }
233239
234- [ HttpGet ( "{id}/resume" ) ]
240+ [ HttpPost ( "{id}/resume" ) ]
235241 [ Authorize ( "resume_caseplaninstance" ) ]
236- public async Task < IActionResult > Resume ( string id , CancellationToken token )
242+ public async Task < IActionResult > Resume ( string id , [ FromBody ] ResumeCommand resumeCommand , CancellationToken token )
237243 {
238244 try
239245 {
240- await _mediator . Send ( new ResumeCommand ( id , null ) , token ) ;
246+ resumeCommand . CasePlanInstanceId = id ;
247+ await _mediator . Send ( resumeCommand , token ) ;
241248 return new OkResult ( ) ;
242249 }
243250 catch ( UnknownCasePlanInstanceException )
@@ -260,13 +267,15 @@ public async Task<IActionResult> Resume(string id, CancellationToken token)
260267 }
261268 }
262269
263- [ HttpGet ( "{id}/resume/{elt}" ) ]
270+ [ HttpPost ( "{id}/resume/{elt}" ) ]
264271 [ Authorize ( "resume_caseplaninstance" ) ]
265- public async Task < IActionResult > Resume ( string id , string elt , CancellationToken token )
272+ public async Task < IActionResult > Resume ( string id , string elt , [ FromBody ] ResumeCommand resumeCommand , CancellationToken token )
266273 {
267274 try
268275 {
269- await _mediator . Send ( new ResumeCommand ( id , elt ) , token ) ;
276+ resumeCommand . CasePlanInstanceId = id ;
277+ resumeCommand . CasePlanInstanceElementId = elt ;
278+ await _mediator . Send ( resumeCommand , token ) ;
270279 return new OkResult ( ) ;
271280 }
272281 catch ( UnknownCasePlanInstanceException )
@@ -327,13 +336,14 @@ public async Task<IActionResult> Complete(string id, string elt, [FromBody] Comp
327336 }
328337 }
329338
330- [ HttpGet ( "{id}/terminate" ) ]
339+ [ HttpPost ( "{id}/terminate" ) ]
331340 [ Authorize ( "terminate_caseplaninstance" ) ]
332- public async Task < IActionResult > Terminate ( string id , CancellationToken token )
341+ public async Task < IActionResult > Terminate ( string id , [ FromBody ] TerminateCommand terminateCommand , CancellationToken token )
333342 {
334343 try
335344 {
336- await _mediator . Send ( new TerminateCommand ( id , null ) , token ) ;
345+ terminateCommand . CaseInstanceId = id ;
346+ await _mediator . Send ( terminateCommand , token ) ;
337347 return new OkResult ( ) ;
338348 }
339349 catch ( UnknownCasePlanInstanceException )
@@ -363,13 +373,15 @@ public async Task<IActionResult> Terminate(string id, CancellationToken token)
363373 }
364374 }
365375
366- [ HttpGet ( "{id}/terminate/{elt}" ) ]
376+ [ HttpPost ( "{id}/terminate/{elt}" ) ]
367377 [ Authorize ( "terminate_caseplaninstance" ) ]
368- public async Task < IActionResult > Terminate ( string id , string elt , CancellationToken token )
378+ public async Task < IActionResult > Terminate ( string id , string elt , [ FromBody ] TerminateCommand terminateCommand , CancellationToken token )
369379 {
370380 try
371381 {
372- await _mediator . Send ( new TerminateCommand ( id , elt ) , token ) ;
382+ terminateCommand . CaseInstanceId = id ;
383+ terminateCommand . CaseInstanceElementId = elt ;
384+ await _mediator . Send ( terminateCommand , token ) ;
373385 return new OkResult ( ) ;
374386 }
375387 catch ( UnknownCasePlanInstanceException )
@@ -399,13 +411,14 @@ public async Task<IActionResult> Terminate(string id, string elt, CancellationTo
399411 }
400412 }
401413
402- [ HttpGet ( "{id}/close" ) ]
414+ [ HttpPost ( "{id}/close" ) ]
403415 [ Authorize ( "close_caseplaninstance" ) ]
404- public async Task < IActionResult > Close ( string id , CancellationToken token )
416+ public async Task < IActionResult > Close ( string id , [ FromBody ] CloseCommand closeCommand , CancellationToken token )
405417 {
406418 try
407419 {
408- await _mediator . Send ( new CloseCommand ( id ) , token ) ;
420+ closeCommand . CasePlanInstanceId = id ;
421+ await _mediator . Send ( closeCommand , token ) ;
409422 return new OkResult ( ) ;
410423 }
411424 catch ( UnknownCasePlanInstanceException )
@@ -428,13 +441,15 @@ public async Task<IActionResult> Close(string id, CancellationToken token)
428441 }
429442 }
430443
431- [ HttpGet ( "{id}/activate/{elt}" ) ]
444+ [ HttpPost ( "{id}/activate/{elt}" ) ]
432445 [ Authorize ( "activate_caseplaninstance" ) ]
433- public async Task < IActionResult > Activate ( string id , string elt , CancellationToken token )
446+ public async Task < IActionResult > Activate ( string id , string elt , [ FromBody ] ActivateCommand activateCommand , CancellationToken token )
434447 {
435448 try
436449 {
437- await _mediator . Send ( new ActivateCommand ( id , elt ) , token ) ;
450+ activateCommand . CasePlanInstanceId = id ;
451+ activateCommand . CasePlanElementInstanceId = elt ;
452+ await _mediator . Send ( activateCommand , token ) ;
438453 return new OkResult ( ) ;
439454 }
440455 catch ( UnknownCasePlanInstanceException )
@@ -461,13 +476,15 @@ public async Task<IActionResult> Activate(string id, string elt, CancellationTok
461476 }
462477 }
463478
464- [ HttpGet ( "{id}/disable/{elt}" ) ]
479+ [ HttpPost ( "{id}/disable/{elt}" ) ]
465480 [ Authorize ( "disable_caseplaninstance" ) ]
466- public async Task < IActionResult > Disable ( string id , string elt , CancellationToken token )
481+ public async Task < IActionResult > Disable ( string id , string elt , [ FromBody ] DisableCommand disableCommand , CancellationToken token )
467482 {
468483 try
469484 {
470- await _mediator . Send ( new DisableCommand ( id , elt ) , token ) ;
485+ disableCommand . CasePlanInstanceId = id ;
486+ disableCommand . CasePlanElementInstanceId = elt ;
487+ await _mediator . Send ( disableCommand , token ) ;
471488 return new OkResult ( ) ;
472489 }
473490 catch ( UnknownCasePlanInstanceException )
@@ -494,13 +511,15 @@ public async Task<IActionResult> Disable(string id, string elt, CancellationToke
494511 }
495512 }
496513
497- [ HttpGet ( "{id}/reenable/{elt}" ) ]
514+ [ HttpPost ( "{id}/reenable/{elt}" ) ]
498515 [ Authorize ( "reenable_caseplaninstance" ) ]
499- public async Task < IActionResult > Reenable ( string id , string elt , CancellationToken token )
516+ public async Task < IActionResult > Reenable ( string id , string elt , [ FromBody ] ReenableCommand reenableCommand , CancellationToken token )
500517 {
501518 try
502519 {
503- await _mediator . Send ( new ReenableCommand ( id , elt ) , token ) ;
520+ reenableCommand . CasePlanInstanceId = id ;
521+ reenableCommand . CasePlanElementInstanceId = elt ;
522+ await _mediator . Send ( reenableCommand , token ) ;
504523 return new OkResult ( ) ;
505524 }
506525 catch ( UnknownCasePlanInstanceException )
0 commit comments