BudgetAnalyser.Engine.Services.TransactionManagerService.SplitTransaction C# (CSharp) Method

SplitTransaction() public method

Splits the provided transaction into two. The provided transactions is removed, and two new transactions are created. Both transactions must add up to the existing transaction amount.
///
public SplitTransaction ( BudgetAnalyser.Engine.Statement.Transaction originalTransaction, decimal splinterAmount1, decimal splinterAmount2, BudgetBucket splinterBucket1, BudgetBucket splinterBucket2 ) : void
originalTransaction BudgetAnalyser.Engine.Statement.Transaction
splinterAmount1 decimal
splinterAmount2 decimal
splinterBucket1 BudgetAnalyser.Engine.Budget.BudgetBucket
splinterBucket2 BudgetAnalyser.Engine.Budget.BudgetBucket
return void
        public void SplitTransaction(Transaction originalTransaction, decimal splinterAmount1, decimal splinterAmount2,
                                     BudgetBucket splinterBucket1, BudgetBucket splinterBucket2)
        {
            if (originalTransaction == null)
            {
                throw new ArgumentNullException(nameof(originalTransaction));
            }

            if (splinterBucket1 == null)
            {
                throw new ArgumentNullException(nameof(splinterBucket1));
            }

            if (splinterBucket2 == null)
            {
                throw new ArgumentNullException(nameof(splinterBucket2));
            }

            StatementModel.SplitTransaction(
                originalTransaction,
                splinterAmount1,
                splinterAmount2,
                splinterBucket1,
                splinterBucket2);
        }