forked from mirrors/homebox
refactor: remove empty services (#116)
* remove empty services * remove old factory * remove old static files * cleanup more duplicate service code * file/folder reorg
This commit is contained in:
parent
6529549289
commit
cd82fe0d89
179 changed files with 514 additions and 582 deletions
42
backend/internal/data/ent/schema/group_invitation_token.go
Normal file
42
backend/internal/data/ent/schema/group_invitation_token.go
Normal file
|
@ -0,0 +1,42 @@
|
|||
package schema
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/edge"
|
||||
"entgo.io/ent/schema/field"
|
||||
"github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins"
|
||||
)
|
||||
|
||||
// GroupInvitationToken holds the schema definition for the GroupInvitationToken entity.
|
||||
type GroupInvitationToken struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (GroupInvitationToken) Mixin() []ent.Mixin {
|
||||
return []ent.Mixin{
|
||||
mixins.BaseMixin{},
|
||||
}
|
||||
}
|
||||
|
||||
// Fields of the GroupInvitationToken.
|
||||
func (GroupInvitationToken) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Bytes("token").
|
||||
Unique(),
|
||||
field.Time("expires_at").
|
||||
Default(func() time.Time { return time.Now().Add(time.Hour * 24 * 7) }),
|
||||
field.Int("uses").
|
||||
Default(0),
|
||||
}
|
||||
}
|
||||
|
||||
// Edges of the GroupInvitationToken.
|
||||
func (GroupInvitationToken) Edges() []ent.Edge {
|
||||
return []ent.Edge{
|
||||
edge.From("group", Group.Type).
|
||||
Ref("invitation_tokens").
|
||||
Unique(),
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue