main
 1namespace solidware.financials.service.domain.accounting
 2{
 3    public class Potential<Transaction> : PotentialEntry where Transaction : TransactionType, new()
 4    {
 5        static public Potential<Transaction> New(DetailAccount destination, Quantity amount)
 6        {
 7            return new Potential<Transaction>
 8                   {
 9                       account = destination,
10                       amount = amount,
11                   };
12        }
13
14        public Quantity combined_with(Quantity other)
15        {
16            return new Transaction().adjust(other, amount);
17        }
18
19        public void commit()
20        {
21            account.add(Entry.New<Transaction>(amount));
22        }
23
24        DetailAccount account;
25        Quantity amount;
26    }
27}