removed unneeded field, fixed not setting spent amount
This commit is contained in:
125
ent/mutation.go
125
ent/mutation.go
@@ -54,23 +54,16 @@ type MatchMutation struct {
|
||||
max_rounds *int
|
||||
addmax_rounds *int
|
||||
demo_parsed *bool
|
||||
eco *struct {
|
||||
Rounds []*struct {
|
||||
Team int "json:\"team\""
|
||||
Bank int "json:\"bank\""
|
||||
Equipment int "json:\"equipment\""
|
||||
} "json:\"rounds\""
|
||||
}
|
||||
clearedFields map[string]struct{}
|
||||
stats map[int]struct{}
|
||||
removedstats map[int]struct{}
|
||||
clearedstats bool
|
||||
players map[uint64]struct{}
|
||||
removedplayers map[uint64]struct{}
|
||||
clearedplayers bool
|
||||
done bool
|
||||
oldValue func(context.Context) (*Match, error)
|
||||
predicates []predicate.Match
|
||||
clearedFields map[string]struct{}
|
||||
stats map[int]struct{}
|
||||
removedstats map[int]struct{}
|
||||
clearedstats bool
|
||||
players map[uint64]struct{}
|
||||
removedplayers map[uint64]struct{}
|
||||
clearedplayers bool
|
||||
done bool
|
||||
oldValue func(context.Context) (*Match, error)
|
||||
predicates []predicate.Match
|
||||
}
|
||||
|
||||
var _ ent.Mutation = (*MatchMutation)(nil)
|
||||
@@ -644,73 +637,6 @@ func (m *MatchMutation) ResetDemoParsed() {
|
||||
m.demo_parsed = nil
|
||||
}
|
||||
|
||||
// SetEco sets the "eco" field.
|
||||
func (m *MatchMutation) SetEco(s struct {
|
||||
Rounds []*struct {
|
||||
Team int "json:\"team\""
|
||||
Bank int "json:\"bank\""
|
||||
Equipment int "json:\"equipment\""
|
||||
} "json:\"rounds\""
|
||||
}) {
|
||||
m.eco = &s
|
||||
}
|
||||
|
||||
// Eco returns the value of the "eco" field in the mutation.
|
||||
func (m *MatchMutation) Eco() (r struct {
|
||||
Rounds []*struct {
|
||||
Team int "json:\"team\""
|
||||
Bank int "json:\"bank\""
|
||||
Equipment int "json:\"equipment\""
|
||||
} "json:\"rounds\""
|
||||
}, exists bool) {
|
||||
v := m.eco
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldEco returns the old "eco" field's value of the Match entity.
|
||||
// If the Match object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *MatchMutation) OldEco(ctx context.Context) (v struct {
|
||||
Rounds []*struct {
|
||||
Team int "json:\"team\""
|
||||
Bank int "json:\"bank\""
|
||||
Equipment int "json:\"equipment\""
|
||||
} "json:\"rounds\""
|
||||
}, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, fmt.Errorf("OldEco is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, fmt.Errorf("OldEco requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldEco: %w", err)
|
||||
}
|
||||
return oldValue.Eco, nil
|
||||
}
|
||||
|
||||
// ClearEco clears the value of the "eco" field.
|
||||
func (m *MatchMutation) ClearEco() {
|
||||
m.eco = nil
|
||||
m.clearedFields[match.FieldEco] = struct{}{}
|
||||
}
|
||||
|
||||
// EcoCleared returns if the "eco" field was cleared in this mutation.
|
||||
func (m *MatchMutation) EcoCleared() bool {
|
||||
_, ok := m.clearedFields[match.FieldEco]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetEco resets all changes to the "eco" field.
|
||||
func (m *MatchMutation) ResetEco() {
|
||||
m.eco = nil
|
||||
delete(m.clearedFields, match.FieldEco)
|
||||
}
|
||||
|
||||
// AddStatIDs adds the "stats" edge to the Stats entity by ids.
|
||||
func (m *MatchMutation) AddStatIDs(ids ...int) {
|
||||
if m.stats == nil {
|
||||
@@ -838,7 +764,7 @@ func (m *MatchMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *MatchMutation) Fields() []string {
|
||||
fields := make([]string, 0, 11)
|
||||
fields := make([]string, 0, 10)
|
||||
if m.share_code != nil {
|
||||
fields = append(fields, match.FieldShareCode)
|
||||
}
|
||||
@@ -869,9 +795,6 @@ func (m *MatchMutation) Fields() []string {
|
||||
if m.demo_parsed != nil {
|
||||
fields = append(fields, match.FieldDemoParsed)
|
||||
}
|
||||
if m.eco != nil {
|
||||
fields = append(fields, match.FieldEco)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@@ -900,8 +823,6 @@ func (m *MatchMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.MaxRounds()
|
||||
case match.FieldDemoParsed:
|
||||
return m.DemoParsed()
|
||||
case match.FieldEco:
|
||||
return m.Eco()
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
@@ -931,8 +852,6 @@ func (m *MatchMutation) OldField(ctx context.Context, name string) (ent.Value, e
|
||||
return m.OldMaxRounds(ctx)
|
||||
case match.FieldDemoParsed:
|
||||
return m.OldDemoParsed(ctx)
|
||||
case match.FieldEco:
|
||||
return m.OldEco(ctx)
|
||||
}
|
||||
return nil, fmt.Errorf("unknown Match field %s", name)
|
||||
}
|
||||
@@ -1012,19 +931,6 @@ func (m *MatchMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetDemoParsed(v)
|
||||
return nil
|
||||
case match.FieldEco:
|
||||
v, ok := value.(struct {
|
||||
Rounds []*struct {
|
||||
Team int "json:\"team\""
|
||||
Bank int "json:\"bank\""
|
||||
Equipment int "json:\"equipment\""
|
||||
} "json:\"rounds\""
|
||||
})
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetEco(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Match field %s", name)
|
||||
}
|
||||
@@ -1124,9 +1030,6 @@ func (m *MatchMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(match.FieldReplayURL) {
|
||||
fields = append(fields, match.FieldReplayURL)
|
||||
}
|
||||
if m.FieldCleared(match.FieldEco) {
|
||||
fields = append(fields, match.FieldEco)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@@ -1147,9 +1050,6 @@ func (m *MatchMutation) ClearField(name string) error {
|
||||
case match.FieldReplayURL:
|
||||
m.ClearReplayURL()
|
||||
return nil
|
||||
case match.FieldEco:
|
||||
m.ClearEco()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Match nullable field %s", name)
|
||||
}
|
||||
@@ -1188,9 +1088,6 @@ func (m *MatchMutation) ResetField(name string) error {
|
||||
case match.FieldDemoParsed:
|
||||
m.ResetDemoParsed()
|
||||
return nil
|
||||
case match.FieldEco:
|
||||
m.ResetEco()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Match field %s", name)
|
||||
}
|
||||
|
Reference in New Issue
Block a user