Refactor order and tenant ledger models to use consts for Currency and Type fields; add new UserStatus values; implement comprehensive test cases for content, creator, order, super, and wallet services.

This commit is contained in:
2025-12-29 14:21:20 +08:00
parent d648a1e45b
commit 8fa3d18a9c
30 changed files with 2251 additions and 85 deletions

View File

@@ -29,7 +29,7 @@ func newTenantLedger(db *gorm.DB, opts ...gen.DOOption) tenantLedgerQuery {
_tenantLedgerQuery.TenantID = field.NewInt64(tableName, "tenant_id")
_tenantLedgerQuery.UserID = field.NewInt64(tableName, "user_id")
_tenantLedgerQuery.OrderID = field.NewInt64(tableName, "order_id")
_tenantLedgerQuery.Type = field.NewString(tableName, "type")
_tenantLedgerQuery.Type = field.NewField(tableName, "type")
_tenantLedgerQuery.Amount = field.NewInt64(tableName, "amount")
_tenantLedgerQuery.BalanceBefore = field.NewInt64(tableName, "balance_before")
_tenantLedgerQuery.BalanceAfter = field.NewInt64(tableName, "balance_after")
@@ -56,7 +56,7 @@ type tenantLedgerQuery struct {
TenantID field.Int64
UserID field.Int64
OrderID field.Int64
Type field.String
Type field.Field
Amount field.Int64
BalanceBefore field.Int64
BalanceAfter field.Int64
@@ -89,7 +89,7 @@ func (t *tenantLedgerQuery) updateTableName(table string) *tenantLedgerQuery {
t.TenantID = field.NewInt64(table, "tenant_id")
t.UserID = field.NewInt64(table, "user_id")
t.OrderID = field.NewInt64(table, "order_id")
t.Type = field.NewString(table, "type")
t.Type = field.NewField(table, "type")
t.Amount = field.NewInt64(table, "amount")
t.BalanceBefore = field.NewInt64(table, "balance_before")
t.BalanceAfter = field.NewInt64(table, "balance_after")