예제 #1
0
        public async Task Update(CancellationToken token)
        {
            switch (Type)
            {
            case OperationType.Budget:
            {
                var request = new UpdateBudgetOperationRequest
                {
                    Amount     = Amount,
                    Comment    = Comment,
                    CategoryId = CategoryId,
                    AccountId  = AccountId
                };

                await _service.UpdateBudgetOperation(Id, request, token);

                break;
            }

            case OperationType.Transfer:
            {
                var request = new UpdateTransferOperationRequest()
                {
                    Amount  = Amount,
                    Comment = Comment,
                    From    = AccountId,
                    To      = ToAccountId
                };

                await _service.UpdateTransferOperation(Id, request, token);

                break;
            }
            }
        }
예제 #2
0
 public Task <bool> UpdateTransferOperation(int id, UpdateTransferOperationRequest request, CancellationToken token)
 => Put($"operations/transfer/{id}", request, token);