Basic bank account and transaction structures.
This commit is contained in:
parent
739d663f6d
commit
b0969ec182
2 changed files with 27 additions and 6 deletions
15
Makefile
15
Makefile
|
@ -45,25 +45,26 @@ BBSTOOL-DEPS=bbstool.scm testing.import.scm listing.import.scm \
|
|||
progress.import.scm table.import.scm cards.import.scm \
|
||||
member-parser.import.scm members-print.import.scm \
|
||||
member-fees.import.scm members-dir.import.scm \
|
||||
csv-simple.import.scm
|
||||
csv-simple.import.scm bank-account.import.scm
|
||||
|
||||
BBSTOOL-SOURCES=bbstool.scm testing.scm listing.scm dictionary.scm \
|
||||
month.scm period.scm ansi.scm command-line.scm \
|
||||
members-base.scm utils.scm primes.scm member-record.scm \
|
||||
configuration.scm progress.scm table.scm cards.scm \
|
||||
members-print.scm member-parser.scm member-fees.scm \
|
||||
members-dir.scm csv-simple.scm
|
||||
members-dir.scm csv-simple.scm bank-account.scm
|
||||
|
||||
BBSTOOL-OBJS=testing.o listing.o month.o period.o ansi.o dictionary.o \
|
||||
command-line.o members-base.o utils.o primes.o \
|
||||
member-record.o configuration.o progress.o table.o cards.o \
|
||||
members-print.o member-fees.o members-dir.o csv-simple.o
|
||||
members-print.o member-fees.o members-dir.o csv-simple.o \
|
||||
bank-account.o
|
||||
|
||||
BBSTOOL-SHARED=testing.so listing.so month.so period.so ansi.so \
|
||||
dictionary.so command-line.so members-base.so utils.so \
|
||||
primes.so member-record.so configuration.so progress.so \
|
||||
table.so cards.so members-print.so member-fees.so \
|
||||
members-dir.so csv-simple.so
|
||||
members-dir.so csv-simple.so bank-account.so
|
||||
|
||||
.PHONY: imports
|
||||
imports: $(BBSTOOL-DEPS)
|
||||
|
@ -232,3 +233,9 @@ CSV-SIMPLE-SOURCES=csv-simple.scm testing.import.scm
|
|||
csv-simple.so: csv-simple.o
|
||||
csv-simple.o: csv-simple.import.scm
|
||||
csv-simple.import.scm: $(CSV-SIMPLE-SOURCES)
|
||||
|
||||
BANK-ACCOUNT-SOURCES=bank-account.scm
|
||||
|
||||
bank-account.so: bank-account.o
|
||||
bank-account.o: bank-account.import.scm
|
||||
bank-account.import.scm: $(BANK-ACCOUNT-SOURCES)
|
||||
|
|
|
@ -26,12 +26,19 @@
|
|||
(declare (unit bank-account))
|
||||
|
||||
(module
|
||||
bank-account
|
||||
(
|
||||
make-bank-account
|
||||
bank-account-insert
|
||||
|
||||
make-bank-transaction
|
||||
bank-transaction-varsym
|
||||
bank-transaction-amount
|
||||
bank-transaction-currency
|
||||
)
|
||||
|
||||
(import scheme)
|
||||
(import scheme
|
||||
(chicken base))
|
||||
|
||||
;; Bank account is represented as a list with list with the following
|
||||
;; elements: list of transactions, account number, bank code. This
|
||||
|
@ -46,7 +53,14 @@
|
|||
(cons (cons transaction (car account))
|
||||
(cdr account)))
|
||||
|
||||
;; Creates a new bank transaction. The order of elements is
|
||||
;; well-suited for fast access to commonly used fields.
|
||||
(define (make-bank-transaction id date amount currency varsym)
|
||||
#f)
|
||||
(list varsym amount currency date id))
|
||||
|
||||
;; Accessors for the fields actually used
|
||||
(define bank-transaction-varsym car)
|
||||
(define bank-transaction-amount cadr)
|
||||
(define bank-transaction-currency caddr)
|
||||
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue