Versions in this module Expand all Collapse all v1 v1.0.0 Dec 23, 2021 Changes in this version + type AccountRecord struct + AccountNumber string + Alignment string + Balance int64 + Coa string + CreatedAt time.Time + CreatedBy string + CurrencyCode string + Description string + Name string + UpdatedAt time.Time + UpdatedBy string + type CurrenciesRecord struct + Code string + CreatedAt time.Time + CreatedBy string + Exchange float64 + Name string + UpdatedAt time.Time + UpdatedBy string + type DBRepository interface + ClearTables func(ctx context.Context) error + Connect func(ctx context.Context) error + CountAccountByCoa func(ctx context.Context, coa string) (int, error) + CountAccountByName func(ctx context.Context, nameLike string) (int, error) + CountAccounts func(ctx context.Context) (int, error) + CountJournalByTimeRange func(ctx context.Context, timeFrom, timeTo time.Time) (int, error) + CountTransactionByAccountNumber func(ctx context.Context, accountNumber string, timeFrom, timeTo time.Time) (int, error) + DB func() *sqlx.DB + DeleteAccount func(ctx context.Context, accountNumber string) error + DeleteCurrency func(ctx context.Context, currencyCode string) error + DeleteJournal func(ctx context.Context, journalID string) error + DeleteTransaction func(ctx context.Context, transactionID string) error + Disconnect func() error + FindAccountByName func(ctx context.Context, nameLike string, sort string, offset, length int) ([]*AccountRecord, error) + GetAccount func(ctx context.Context, accountNumber string) (*AccountRecord, error) + GetCurrency func(ctx context.Context, code string) (*CurrenciesRecord, error) + GetJournal func(ctx context.Context, journalID string) (*JournalRecord, error) + GetJournalByReversalID func(ctx context.Context, journalID string) (*JournalRecord, error) + GetTransaction func(ctx context.Context, transactionID string) (*TransactionRecord, error) + InsertAccount func(ctx context.Context, rec *AccountRecord) (string, error) + InsertCurrency func(ctx context.Context, rec *CurrenciesRecord) (string, error) + InsertJournal func(ctx context.Context, rec *JournalRecord) (string, error) + InsertTransaction func(ctx context.Context, rec *TransactionRecord) (string, error) + IsConnected func() bool + ListAccount func(ctx context.Context, sort string, offset, length int) ([]*AccountRecord, error) + ListAccountByCoa func(ctx context.Context, coa string, sort string, offset, length int) ([]*AccountRecord, error) + ListCurrency func(ctx context.Context, sort string, offset, length int) ([]*CurrenciesRecord, error) + ListJournal func(ctx context.Context, sort string, offset, length int) ([]*JournalRecord, error) + ListJournalByTimeRange func(ctx context.Context, timeFrom, timeTo time.Time, sort string, ...) ([]*JournalRecord, error) + ListTransaction func(ctx context.Context, sort string, offset, length int) ([]*TransactionRecord, error) + ListTransactionByAccountNumber func(ctx context.Context, accountNumber string, timeFrom, timeTo time.Time, ...) ([]*TransactionRecord, error) + ListTransactionByJournalID func(ctx context.Context, journalID string) ([]*TransactionRecord, error) + UpdateAccount func(ctx context.Context, rec *AccountRecord) error + UpdateCurrency func(ctx context.Context, rec *CurrenciesRecord) error + UpdateJournal func(ctx context.Context, rec *JournalRecord) error + UpdateTransaction func(ctx context.Context, rec *TransactionRecord) error + type JournalRecord struct + CreatedAt time.Time + CreatedBy string + Description string + IsReversal bool + JournalID string + JournalingTime time.Time + ReversedJournalID string + TotalAmount int64 + type MySQLDBRepository struct + func (repo *MySQLDBRepository) ClearTables(ctx context.Context) error + func (repo *MySQLDBRepository) Connect(ctx context.Context) error + func (repo *MySQLDBRepository) CountAccountByCoa(ctx context.Context, coa string) (int, error) + func (repo *MySQLDBRepository) CountAccountByName(ctx context.Context, nameLike string) (int, error) + func (repo *MySQLDBRepository) CountAccounts(ctx context.Context) (int, error) + func (repo *MySQLDBRepository) CountJournalByTimeRange(ctx context.Context, timeFrom, timeTo time.Time) (int, error) + func (repo *MySQLDBRepository) CountTransactionByAccountNumber(ctx context.Context, accountNumber string, timeFrom, timeTo time.Time) (int, error) + func (repo *MySQLDBRepository) DB() *sqlx.DB + func (repo *MySQLDBRepository) DeleteAccount(ctx context.Context, accountNumber string) error + func (repo *MySQLDBRepository) DeleteCurrency(ctx context.Context, currencyCode string) error + func (repo *MySQLDBRepository) DeleteJournal(ctx context.Context, journalID string) error + func (repo *MySQLDBRepository) DeleteTransaction(ctx context.Context, transactionID string) error + func (repo *MySQLDBRepository) Disconnect() error + func (repo *MySQLDBRepository) FindAccountByName(ctx context.Context, nameLike string, sort string, offset, length int) ([]*AccountRecord, error) + func (repo *MySQLDBRepository) GetAccount(ctx context.Context, accountNumber string) (*AccountRecord, error) + func (repo *MySQLDBRepository) GetCurrency(ctx context.Context, code string) (*CurrenciesRecord, error) + func (repo *MySQLDBRepository) GetJournal(ctx context.Context, journalID string) (*JournalRecord, error) + func (repo *MySQLDBRepository) GetJournalByReversalID(ctx context.Context, journalID string) (*JournalRecord, error) + func (repo *MySQLDBRepository) GetTransaction(ctx context.Context, transactionID string) (*TransactionRecord, error) + func (repo *MySQLDBRepository) InsertAccount(ctx context.Context, rec *AccountRecord) (string, error) + func (repo *MySQLDBRepository) InsertCurrency(ctx context.Context, rec *CurrenciesRecord) (string, error) + func (repo *MySQLDBRepository) InsertJournal(ctx context.Context, rec *JournalRecord) (string, error) + func (repo *MySQLDBRepository) InsertTransaction(ctx context.Context, rec *TransactionRecord) (string, error) + func (repo *MySQLDBRepository) IsConnected() bool + func (repo *MySQLDBRepository) ListAccount(ctx context.Context, sort string, offset, length int) ([]*AccountRecord, error) + func (repo *MySQLDBRepository) ListAccountByCoa(ctx context.Context, coa string, sort string, offset, length int) ([]*AccountRecord, error) + func (repo *MySQLDBRepository) ListCurrency(ctx context.Context, sort string, offset, length int) ([]*CurrenciesRecord, error) + func (repo *MySQLDBRepository) ListJournal(ctx context.Context, sort string, offset, length int) ([]*JournalRecord, error) + func (repo *MySQLDBRepository) ListJournalByTimeRange(ctx context.Context, timeFrom, timeTo time.Time, sort string, ...) ([]*JournalRecord, error) + func (repo *MySQLDBRepository) ListTransaction(ctx context.Context, sort string, offset, length int) ([]*TransactionRecord, error) + func (repo *MySQLDBRepository) ListTransactionByAccountNumber(ctx context.Context, accountNumber string, timeFrom, timeTo time.Time, ...) ([]*TransactionRecord, error) + func (repo *MySQLDBRepository) ListTransactionByJournalID(ctx context.Context, journalID string) ([]*TransactionRecord, error) + func (repo *MySQLDBRepository) UpdateAccount(ctx context.Context, rec *AccountRecord) error + func (repo *MySQLDBRepository) UpdateCurrency(ctx context.Context, rec *CurrenciesRecord) error + func (repo *MySQLDBRepository) UpdateJournal(ctx context.Context, rec *JournalRecord) error + func (repo *MySQLDBRepository) UpdateTransaction(ctx context.Context, rec *TransactionRecord) error + type TransactionRecord struct + AccountNumber string + Alignment string + Amount int64 + Balance int64 + CreatedAt time.Time + CreatedBy string + Description string + JournalID string + TransactionID string + TransactionTime time.Time