//Accessible only through a user with Support role on controller public void AssignSupport(AssignSupportCommand command) { command.Validate(); if (AddNotifications(command)) { return; } Ticket ticket = _ticketRepository.GetById(command.TicketId); LedgerIdentityUser user = _identityResolver.GetUser(); if (NotifyNullTicket(ticket)) { return; } ticket.AssignSupportUser(user.Id); if (AddNotifications(ticket)) { return; } _ticketRepository.Update(ticket); if (Commit()) { PublishLocal(new AssignedTicketSupportEvent(ticket.Id, user.Id)); } }
//[Authorize(Policy = "SupportAccount")] public IActionResult AssignSupport(Guid id, [FromBody] AssignSupportCommand command) { command.TicketId = id; _ticketApplicationService.AssignSupport(command); return(CreateResponse()); }