Files
juwan-backend/app/wallet/rpc/internal/models/schema/wallettransactions.go
T
wwweww 19cc7a778c Refactor: Remove deprecated gRPC service files and implement new API structure
- Deleted old gRPC service definitions in `game_grpc.pb.go` and `public.go`.
- Added new API server implementations for objectstory, player, and shop services.
- Introduced configuration files for new APIs in `etc/*.yaml`.
- Created main entry points for each service in `objectstory.go`, `player.go`, and `shop.go`.
- Removed unused user update handler and user API files.
- Added utility functions for context management and HTTP header parsing.
- Introduced PostgreSQL backup configuration in `backup/postgreSql.yaml`.
2026-02-28 18:35:56 +08:00

40 lines
1020 B
Go

package schema
import (
"entgo.io/ent"
"entgo.io/ent/dialect"
"entgo.io/ent/schema/field"
"github.com/shopspring/decimal"
)
// WalletTransactions holds the schema definition for the WalletTransactions entity.
type WalletTransactions struct {
ent.Schema
}
// Fields of the WalletTransactions.
func (WalletTransactions) Fields() []ent.Field {
return []ent.Field{
field.String("id").Immutable().Unique(),
field.Int64("user_id").Immutable().Unique(),
field.String("type"),
field.Other("amount", decimal.Decimal{}).
SchemaType(map[string]string{
dialect.Postgres: "decimal(12,2",
}).Unique().Immutable(),
field.Other("balance_after", decimal.Decimal{}).
SchemaType(map[string]string{
dialect.Postgres: "decimal(12,2)",
}).Unique().Immutable(),
field.Strings("description"),
field.Int64("order_id").Immutable().Unique(),
field.Time("created_at"),
field.String("search_text"),
}
}
// Edges of the WalletTransactions.
func (WalletTransactions) Edges() []ent.Edge {
return nil
}