/**
  * Cancel booked ticket.
  *
  * @param string $ticketId
  * @param string $movieId
  *
  * @return JsonResponse
  */
 public function cancelAction($ticketId, $movieId)
 {
     $command = new CancelTicketCommand(TicketId::fromString($ticketId), MovieId::fromString($movieId));
     $response = $this->invoke($command);
     return $this->response(!empty($response) ? $response[0][0] : null);
 }
Ejemplo n.º 2
0
 /**
  * Reschedule movie.
  *
  * @param string  $id
  * @param Request $request
  *
  * @return JsonResponse
  */
 public function rescheduleAction($id, Request $request)
 {
     $command = new RescheduleMovieCommand(MovieId::fromString($id), new DateTime($request->get('schedule')));
     $response = $this->invoke($command);
     return $this->response(!empty($response) ? $response[0][0] : null);
 }