v0.1.48 v0.1.47
Vernon Keenan 2021-02-01 21:13:14 -08:00
parent 50901b818f
commit 9a90f18d58
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package app
import (
"code.tnxs.net/taxnexus/lib/api/ledger/ledger_client/journal_entry"
"code.tnxs.net/taxnexus/lib/api/ledger/ledger_models"
)
// PostJournalEntries is a first class object helper method
func PostJournalEntries(objList []*ledger_models.JournalEntry, principal *User) error {
sugar.Debugf("ops.postJournalEntries: 📥 len=%d", len(objList))
params := journal_entry.NewPostJournalEntriesParamsWithTimeout(postTimeout)
params.JournalEntryRequest = &ledger_models.JournalEntryRequest{
Data: objList,
}
sugar.Debugf("ops.postJournalEntries: ⏱ wait for ledger")
_, err := ledgerClient.JournalEntry.PostJournalEntries(params, principal.Auth)
if err != nil {
return err
}
sugar.Infof("ops.postJournalEntries: 👍 📤")
return nil
}