# README
ACCCORE - Accounting Core in Go
A core accounting library made in golang. Using this library, you quicly enable Double Entry Book Keeping which usefull to maintain your internal application point and reward system. Manage GOLD, POINT, DIAMONDS you distribute to your user have them accountable, controlled and traced.
=== RUN TestAccounting_CreateNewJournal
Accounting_test.go:105: Journal Entry : 5274YX3Y65
Journal Date : 2021-07-02 10:59:45.0173345 +0700 +07 m=+0.002096401
Description : Creditor Topup Gold
+------------+------------+--------------------+---------+---------+
| TRX ID | ACCOUNT | DESCRIPTION | DEBIT | CREDIT |
+------------+------------+--------------------+---------+---------+
| ZTUMIZQ565 | T5Z05Z0IX6 | Added Gold Reserve | 1000000 | |
| 506O592P3Z | 09TI0ZZZ6U | Added Gold Equity | | 1000000 |
+------------+------------+--------------------+---------+---------+
| 1000000 | 1000000 |
+------------+------------+--------------------+---------+---------+
Accounting_test.go:126: Journal Entry : 25P8ZVZZOZ
Journal Date : 2021-07-02 10:59:45.017858 +0700 +07 m=+0.002619901
Description : GOLD purchase transaction
+------------+------------+-------------------+--------+--------+
| TRX ID | ACCOUNT | DESCRIPTION | DEBIT | CREDIT |
+------------+------------+-------------------+--------+--------+
| 050LTUIIZX | T0PTZZ70KX | Add debitor AR | 200000 | |
| Q9MUW650YN | T5Z05Z0IX6 | Gold Disbursement | | 200000 |
+------------+------------+-------------------+--------+--------+
| 200000 | 200000 |
+------------+------------+-------------------+--------+--------+
Accounting_test.go:137: Account Number : T5Z05Z0IX6
Account Name : Gold Loan
Description : Gold base loan reserve
Currency : GOLD
COA : 1.1
Transactions From : 2021-07-02 08:59:45.017858 +0700 +07 m=-7199.997380099
To : 2021-07-02 12:59:45.017858 +0700 +07 m=+7200.002619901
#Transactions : 2
Showing page : 1/1
+------------+--------------------------------+------------+--------------------+---------+--------+---------+
| TRX ID | TIME | JOURNAL ID | DESCRIPTION | DEBIT | CREDIT | BALANCE |
+------------+--------------------------------+------------+--------------------+---------+--------+---------+
| ZTUMIZQ565 | 2021-07-02 10:59:45.0173345 | 5274YX3Y65 | Added Gold Reserve | 1000000 | | 1000000 |
| | +0700 +07 m=+0.002096401 | | | | | |
| Q9MUW650YN | 2021-07-02 10:59:45.017858 | 25P8ZVZZOZ | Gold Disbursement | | 200000 | 800000 |
| | +0700 +07 m=+0.002619901 | | | | | |
+------------+--------------------------------+------------+--------------------+---------+--------+---------+
--- PASS: TestAccounting_CreateNewJournal (0.00s)
PASS
# Functions
ClearInMemoryTables initializes the memory tables.
GetTotalCredit returns sum of all transaction in the CREDIT Alignment.
GetTotalDebit returns sum of all transaction in the DEBIT Alignment.
NewAccounting instantiate new Accounting logic modules.
NewInMemoryExchangeManager initializes a new excahnge manager in memory.
PageResultFor will calculate proper pagination result on a request with total rows in the result set.
# Constants
CREDIT is enum transaction type CREDIT.
DEBIT is enum transaction type DEBIT.
LowerAlphabet list of lowercase letters.
Numbers is not letters.
Symbols non-letters non-numbers.
UpperAlphabet list of upprcase letters.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
InMemoryAccountTable the simulated Account table.
InMemoryCurrencyTable the simulated Currency table.
InMemoryJournalTable the simulated Journal table.
InMemoryTransactionTable the simulated Transaction table.
# Structs
Accounting is the account detail structure.
BaseAccount is the base implementation of Account.
BaseCurrency is the currency object.
BaseJournal is the base implementation of Journal.
BaseTransaction is the base implementation of Transaction.
InMemoryAccountManager implementation of AccountManager using inmemory Account table map.
InMemoryAccountRecord is simulating records in Account table.
InMemoryCurrencyRecords is the in memory data structure.
InMemoryExchangeManager is a base implementation of ExchangeManager.
InMemoryJournalManager implementation of JournalManager using inmemory Journal table map.
InMemoryJournalRecords simulates records in Journal table.
InMemoryTransactionManager implementation of TransactionManager using inmemory Account table map.
InMemoryTransactionRecords is simulating records in Transaction table.
NanoSecondUniqueIDGenerator the unique ID generator using NANO second number.
PageRequest define the pagination request when listing a huge dataset.
PageResult define the pagination result that returned together with the listing.
RandomGenUniqueIDGenerator the unique ID generator using NANO second number.
Sort define a sorting information, it specifies the column should be sorted and whether it should be ASCENDING or DESCENDING.
TransactionInfo transaction info details.
UUIDUniqueIDGenerator the unique ID generator using UUID.
# Interfaces
Account interface provides base structure of Account.
AccountManager interface is used for managing Accounts.
Currency interface provides base structure of Currency.
ExchangeManager will define functions to be implemented for Currency exchanges.
Journal interface define a base Journal structure.
JournalManager is interface used of managing journals.
Transaction interface define a base Transaction structure A transaction is a unit of transaction element that involved within a journal.
TransactionManager is interface used for managing transaction data/table.
UniqueIDGenerator define the unique string generator.
# Type aliases
Alignment is the enum type of transaction type, DEBIT and CREDIT.