Beispiel #1
0
        public async Task Process(CloseInput input)
        {
            Account account = await accountReadOnlyRepository.Get(input.AccountId);

            account.Close();

            await accountWriteOnlyRepository.Delete(account);

            CloseOutput output = outputConverter.Map <CloseOutput>(account);

            this.outputBoundary.Populate(output);
        }
Beispiel #2
0
        public async Task Process(CloseInput input)
        {
            Account account = await accountReadOnlyRepository.Get(input.AccountId);

            if (account == null)
            {
                throw new AccountNotFoundException($"The account {input.AccountId} does not exists or is already closed.");
            }

            account.Close();

            await accountWriteOnlyRepository.Delete(account);

            CloseOutput output = outputConverter.Map <CloseOutput>(account);

            this.outputBoundary.Populate(output);
        }