MCPcopy Index your code
hub / github.com/devaccuracy/ledgerforge / updateSplitTransactions

Function updateSplitTransactions

transaction.go:2079–2084  ·  view source on GitHub ↗

updateSplitTransactions updates the metadata of split transactions to maintain their relationships. It sets the parent transaction ID and creates linked references for each split transaction. Parameters: - transactions []*model.Transaction: The split transactions to update. - parentID string: The I

(transactions []*model.Transaction, parentID, originalRef string)

Source from the content-addressed store, hash-verified

2077// - parentID string: The ID of the parent transaction.
2078// - originalRef string: The original reference to base the new references on.
2079func updateSplitTransactions(transactions []*model.Transaction, parentID, originalRef string) {
2080 for i, txn := range transactions {
2081 txn.ParentTransaction = parentID
2082 txn.Reference = fmt.Sprintf("%s_%d", originalRef, i+1)
2083 }
2084}
2085
2086// enqueueTransactions enqueues the original transaction or its split transactions into the provided queue.
2087// It starts by determining which transactions to enqueue, then iterates through them and enqueues each one.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected