email improvements

This commit is contained in:
Hayden 2024-03-02 12:02:41 -06:00
parent 6fd8457e5a
commit 29e30bfaba
No known key found for this signature in database
GPG key ID: 17CF79474E257545
47 changed files with 3710 additions and 95 deletions

View file

@ -40,6 +40,8 @@ const (
EdgeAuthTokens = "auth_tokens"
// EdgeNotifiers holds the string denoting the notifiers edge name in mutations.
EdgeNotifiers = "notifiers"
// EdgeActionTokens holds the string denoting the action_tokens edge name in mutations.
EdgeActionTokens = "action_tokens"
// Table holds the table name of the user in the database.
Table = "users"
// GroupTable is the table that holds the group relation/edge.
@ -63,6 +65,13 @@ const (
NotifiersInverseTable = "notifiers"
// NotifiersColumn is the table column denoting the notifiers relation/edge.
NotifiersColumn = "user_id"
// ActionTokensTable is the table that holds the action_tokens relation/edge.
ActionTokensTable = "action_tokens"
// ActionTokensInverseTable is the table name for the ActionToken entity.
// It exists in this package in order to avoid circular dependency with the "actiontoken" package.
ActionTokensInverseTable = "action_tokens"
// ActionTokensColumn is the table column denoting the action_tokens relation/edge.
ActionTokensColumn = "user_id"
)
// Columns holds all SQL columns for user fields.
@ -234,6 +243,20 @@ func ByNotifiers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
sqlgraph.OrderByNeighborTerms(s, newNotifiersStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByActionTokensCount orders the results by action_tokens count.
func ByActionTokensCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newActionTokensStep(), opts...)
}
}
// ByActionTokens orders the results by action_tokens terms.
func ByActionTokens(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newActionTokensStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newGroupStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
@ -255,3 +278,10 @@ func newNotifiersStep() *sqlgraph.Step {
sqlgraph.Edge(sqlgraph.O2M, false, NotifiersTable, NotifiersColumn),
)
}
func newActionTokensStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ActionTokensInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ActionTokensTable, ActionTokensColumn),
)
}

View file

@ -530,6 +530,29 @@ func HasNotifiersWith(preds ...predicate.Notifier) predicate.User {
})
}
// HasActionTokens applies the HasEdge predicate on the "action_tokens" edge.
func HasActionTokens() predicate.User {
return predicate.User(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ActionTokensTable, ActionTokensColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasActionTokensWith applies the HasEdge predicate on the "action_tokens" edge with a given conditions (other predicates).
func HasActionTokensWith(preds ...predicate.ActionToken) predicate.User {
return predicate.User(func(s *sql.Selector) {
step := newActionTokensStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.User) predicate.User {
return predicate.User(sql.AndPredicates(predicates...))