private void UpdateTerminalState(Terminal terminal) { _unitOfWork.Terminals.UpdateTerminal(terminal); var updateTerminalCommand = new UpdateTerminalStateCommand(terminal); _unitOfWork.SourceEvent(updateTerminalCommand); Clients.All.SendAsync("terminal-updated-event", terminal); }
public ActionResult <Terminal> UpdateTerminal([FromBody] Terminal terminal) { _unitOfWork.Terminals.UpdateTerminal(terminal); var updateTerminalStateCommand = new UpdateTerminalStateCommand(terminal); _unitOfWork.SourceEvent(updateTerminalStateCommand); _unitOfWork.BroadcastServerEvent("terminal-updated-event", terminal); return(Ok(terminal)); }
public Task Handle(NextPersonCalledEvent @event) { var updatedTerminal = _unitOfWork.Terminals.Get(@event.TerminalId); updatedTerminal.Status = TerminalStatus.Serving; _unitOfWork.Terminals.UpdateTerminal(updatedTerminal); UpdateTerminalStateCommand updateTerminalStateCommand = new UpdateTerminalStateCommand(updatedTerminal); _unitOfWork.SourceEvent(updateTerminalStateCommand); _unitOfWork.BroadcastServerEvent("terminal-updated-event", updatedTerminal); return(Task.CompletedTask); }