public AccountsController(
     IDepositUseCase depositUseCase,
     Presenter presenter)
 {
     _depositUseCase = depositUseCase;
     _presenter      = presenter;
 }
Exemplo n.º 2
0
 public TransactionController(INotifiable notifiable, IWithdrawalUseCase withdrawalUseCase, IDepositUseCase depositUseCase, IPayUseCase payUseCase,
                              IGetBankStatementUseCase getBankStatementUseCase) : base(notifiable)
 {
     _withdrawalUseCase       = withdrawalUseCase;
     _depositUseCase          = depositUseCase;
     _payUseCase              = payUseCase;
     _getBankStatementUseCase = getBankStatementUseCase;
 }
        public async Task <IActionResult> Deposit(
            [FromServices] IDepositUseCase useCase,
            [FromRoute][Required] Guid accountId,
            [FromForm][Required] decimal amount,
            [FromForm][Required] string currency)
        {
            useCase.SetOutputPort(this);

            await useCase.Execute(accountId, amount, currency)
            .ConfigureAwait(false);

            return(this._viewModel !);
        }
#pragma warning disable SCS0016 // Controller method is potentially vulnerable to Cross Site Request Forgery (CSRF).
        public async Task <IActionResult> Deposit(
#pragma warning restore SCS0016 // Controller method is potentially vulnerable to Cross Site Request Forgery (CSRF).
            [FromServices] IDepositUseCase useCase,
            [FromRoute][Required] Guid accountId,
            [FromForm][Required] decimal amount,
            [FromForm][Required] string currency)
        {
            useCase.SetOutputPort(this);

            await useCase.Execute(accountId, amount, currency)
            .ConfigureAwait(false);

            return(this._viewModel !);
        }
Exemplo n.º 5
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="DepositValidationUseCase" /> class.
 /// </summary>
 /// <param name="useCase"></param>
 public DepositValidationUseCase(IDepositUseCase useCase)
 {
     this._useCase = useCase;
 }
Exemplo n.º 6
0
 public AccountsController(
     IDepositUseCase depositService)
 {
     this.depositService = depositService;
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="DepositValidationUseCase" /> class.
 /// </summary>
 /// <param name="useCase"></param>
 /// <param name="notification"></param>
 public DepositValidationUseCase(IDepositUseCase useCase, Notification notification)
 {
     this._useCase = useCase;
     this._notification = notification;
     this._outputPort = new DepositPresenter();
 }