type transaction_type = 
  | Debit
  | Credit

type transaction = {
  trans_type : transaction_type;
  from_account : string;
  to_account : string;
  amount : real;
}

let create_transaction trans_type from_account to_account amount = {
  trans_type = trans_type;
  from_account = from_account;
  to_account = to_account;
  amount = amount;
}

let from_account t = t.from_account

let to_account t = t.to_account

let transaction_equal t1 t2 =
  t1.trans_type = t2.trans_type && t1.amount = t2.amount

let create_debit_transaction from_account to_account amount =
  create_transaction Debit from_account to_account amount

let create_credit_transaction from_account to_account amount =
  create_transaction Credit from_account to_account amount

let main () =
  let d = create_debit_transaction "123456789" "987654321" 100.0 in
  let c = create_credit_transaction "987654321" "123456789" 100.0 in
  (d, c)
