createQueueCopy creates a new copy of a transaction specifically for queueing. It generates new identifiers and maintains the relationship with the original transaction. Parameters: - persistedTxn *model.Transaction: The persisted transaction to copy. - originalRef string: The original reference to
(persistedTxn *model.Transaction, originalRef string)
| 2062 | // Returns: |
| 2063 | // - *model.Transaction: A pointer to the new queue copy of the transaction. |
| 2064 | func createQueueCopy(persistedTxn *model.Transaction, originalRef string) *model.Transaction { |
| 2065 | queueTxn := *persistedTxn |
| 2066 | queueTxn.TransactionID = model.GenerateUUIDWithSuffix("txn") |
| 2067 | queueTxn.ParentTransaction = persistedTxn.TransactionID |
| 2068 | queueTxn.Reference = fmt.Sprintf("%s_q", originalRef) |
| 2069 | return &queueTxn |
| 2070 | } |
| 2071 | |
| 2072 | // updateSplitTransactions updates the metadata of split transactions to maintain their relationships. |
| 2073 | // It sets the parent transaction ID and creates linked references for each split transaction. |