feat: complete charge
This commit is contained in:
@@ -8,15 +8,17 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"backend/pkg/pg"
|
||||
"time"
|
||||
)
|
||||
|
||||
type UserBalanceHistories struct {
|
||||
ID int64 `sql:"primary_key" json:"id"`
|
||||
UserID int64 `json:"user_id"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
Balance int64 `json:"balance"`
|
||||
Target *string `json:"target"`
|
||||
Type string `json:"type"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ID int64 `sql:"primary_key" json:"id"`
|
||||
UserID int64 `json:"user_id"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
Balance int64 `json:"balance"`
|
||||
Target pg.BalanceTarget `json:"target"`
|
||||
Type pg.BalanceType `json:"type"`
|
||||
Code string `json:"code"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ type userBalanceHistoriesTable struct {
|
||||
Balance postgres.ColumnInteger
|
||||
Target postgres.ColumnString
|
||||
Type postgres.ColumnString
|
||||
Code postgres.ColumnString
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
@@ -70,9 +71,10 @@ func newUserBalanceHistoriesTableImpl(schemaName, tableName, alias string) userB
|
||||
BalanceColumn = postgres.IntegerColumn("balance")
|
||||
TargetColumn = postgres.StringColumn("target")
|
||||
TypeColumn = postgres.StringColumn("type")
|
||||
CodeColumn = postgres.StringColumn("code")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, UserIDColumn, TenantIDColumn, BalanceColumn, TargetColumn, TypeColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, TenantIDColumn, BalanceColumn, TargetColumn, TypeColumn, CreatedAtColumn}
|
||||
allColumns = postgres.ColumnList{IDColumn, UserIDColumn, TenantIDColumn, BalanceColumn, TargetColumn, TypeColumn, CodeColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, TenantIDColumn, BalanceColumn, TargetColumn, TypeColumn, CodeColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return userBalanceHistoriesTable{
|
||||
@@ -85,6 +87,7 @@ func newUserBalanceHistoriesTableImpl(schemaName, tableName, alias string) userB
|
||||
Balance: BalanceColumn,
|
||||
Target: TargetColumn,
|
||||
Type: TypeColumn,
|
||||
Code: CodeColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
|
||||
Reference in New Issue
Block a user