summaryrefslogtreecommitdiff
path: root/internal/db/admin.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/admin.go')
-rw-r--r--internal/db/admin.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/internal/db/admin.go b/internal/db/admin.go
index fcae928f6..1f24c7932 100644
--- a/internal/db/admin.go
+++ b/internal/db/admin.go
@@ -19,6 +19,7 @@ package db
import (
"context"
+ "time"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
)
@@ -36,7 +37,7 @@ type Admin interface {
// C) something went wrong in the db
IsEmailAvailable(ctx context.Context, email string) (bool, error)
- // NewSignup creates a new user in the database with the given parameters.
+ // NewSignup creates a new user + account in the database with the given parameters.
// By the time this function is called, it should be assumed that all the parameters have passed validation!
NewSignup(ctx context.Context, newSignup gtsmodel.NewSignup) (*gtsmodel.User, error)
@@ -50,6 +51,23 @@ type Admin interface {
// This is needed for things like serving instance information through /api/v1/instance
CreateInstanceInstance(ctx context.Context) error
+ // CreateInstanceApplication creates an application in the database
+ // for use in processing signups etc through the sign-up form.
+ CreateInstanceApplication(ctx context.Context) error
+
+ // GetInstanceApplication gets the instance application
+ // (ie., the application owned by the instance account).
+ GetInstanceApplication(ctx context.Context) (*gtsmodel.Application, error)
+
+ // CountApprovedSignupsSince counts the number of new account
+ // sign-ups approved on this instance since the given time.
+ CountApprovedSignupsSince(ctx context.Context, since time.Time) (int, error)
+
+ // CountUnhandledSignups counts the number of account sign-ups
+ // that have not yet been approved or denied. In other words,
+ // the number of pending sign-ups sitting in the backlog.
+ CountUnhandledSignups(ctx context.Context) (int, error)
+
/*
ACTION FUNCS
*/