Reapply "feat(loyalty): EnakPoint & EnakCoin" (#32)

This reverts commit 4e24f9bbb0.
This commit is contained in:
efrilm
2026-09-30 15:31:44 +07:00
parent 4e24f9bbb0
commit 582dc75543
195 changed files with 20058 additions and 2177 deletions
+7
View File
@@ -50,3 +50,10 @@ func (m *TxManager) WithTransactionOptions(ctx context.Context, opts *sql.TxOpti
return fn(ctxTx)
}, opts)
}
// DetachTransaction returns ctx without the caller's transaction, so work started from
// it (such as loyalty earning after a payment) reads committed data and commits on its
// own, whatever happens to the caller's transaction.
func DetachTransaction(ctx context.Context) context.Context {
return context.WithValue(ctx, txKey, (*gorm.DB)(nil))
}