优化订单结算金额展示和钱包流水号

This commit is contained in:
yml2213
2026-06-05 00:37:50 +08:00
parent 064abb6621
commit 498e3d7bde
7 changed files with 148 additions and 15 deletions
@@ -1,6 +1,7 @@
package wallet
import (
"regexp"
"testing"
"hfb_sys/backend/internal/model"
@@ -29,3 +30,14 @@ func TestApplyEntryRoundsMoneyBeforeComparing(t *testing.T) {
t.Fatalf("FrozenBalance = %v, want 0", account.FrozenBalance)
}
}
func TestNewLedgerNoUsesReadableFormat(t *testing.T) {
ledgerNo, err := newLedgerNo()
if err != nil {
t.Fatalf("newLedgerNo() error = %v", err)
}
matched := regexp.MustCompile(`^WL\d{21}$`).MatchString(ledgerNo)
if !matched {
t.Fatalf("ledgerNo = %q, want WL + 21 digits", ledgerNo)
}
}