Exemplo n.º 1
0
        public async Task <IActionResult> Post([FromBody] RegisterRequest message)
        {
            var request = new RegisterCommand(message.PIN, message.Name, message.InitialAmount);
            await registerInput.Handle(request);

            return(registerPresenter.ViewModel);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Get(Guid accountId)
        {
            var request = new GetAccountDetailsCommand(accountId);

            await getAccountDetailsInput.Handle(request);

            return(getAccountDetailsPresenter.ViewModel);
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Withdraw([FromBody] WithdrawRequest message)
        {
            var request = new WithdrawCommand(message.AccountId, message.Amount);

            await withdrawInput.Handle(request);

            return(withdrawPresenter.ViewModel);
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Deposit([FromBody] DepositRequest message)
        {
            var request = new DepositCommand(message.AccountId, message.Amount);

            await depositInput.Handle(request);

            return(depositPresenter.ViewModel);
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Close(Guid accountId)
        {
            var request = new CloseCommand(accountId);

            await closeAccountInput.Handle(request);

            return(closePresenter.ViewModel);
        }