From e364e31e25bd1d4b8d801c845a96d6be708f0a18 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 19 Jan 2023 09:27:16 +0100 Subject: Implement signup approval in server --- shared/models/users/registration/index.ts | 5 ++++ .../users/registration/user-register.model.ts | 12 +++++++++ .../user-registration-request.model.ts | 5 ++++ .../registration/user-registration-state.model.ts | 5 ++++ .../user-registration-update-state.model.ts | 3 +++ .../users/registration/user-registration.model.ts | 29 ++++++++++++++++++++++ 6 files changed, 59 insertions(+) create mode 100644 shared/models/users/registration/index.ts create mode 100644 shared/models/users/registration/user-register.model.ts create mode 100644 shared/models/users/registration/user-registration-request.model.ts create mode 100644 shared/models/users/registration/user-registration-state.model.ts create mode 100644 shared/models/users/registration/user-registration-update-state.model.ts create mode 100644 shared/models/users/registration/user-registration.model.ts (limited to 'shared/models/users/registration') diff --git a/shared/models/users/registration/index.ts b/shared/models/users/registration/index.ts new file mode 100644 index 000000000..593740c4f --- /dev/null +++ b/shared/models/users/registration/index.ts @@ -0,0 +1,5 @@ +export * from './user-register.model' +export * from './user-registration-request.model' +export * from './user-registration-state.model' +export * from './user-registration-update-state.model' +export * from './user-registration.model' diff --git a/shared/models/users/registration/user-register.model.ts b/shared/models/users/registration/user-register.model.ts new file mode 100644 index 000000000..cf9a43a67 --- /dev/null +++ b/shared/models/users/registration/user-register.model.ts @@ -0,0 +1,12 @@ +export interface UserRegister { + username: string + password: string + email: string + + displayName?: string + + channel?: { + name: string + displayName: string + } +} diff --git a/shared/models/users/registration/user-registration-request.model.ts b/shared/models/users/registration/user-registration-request.model.ts new file mode 100644 index 000000000..6c38817e0 --- /dev/null +++ b/shared/models/users/registration/user-registration-request.model.ts @@ -0,0 +1,5 @@ +import { UserRegister } from './user-register.model' + +export interface UserRegistrationRequest extends UserRegister { + registrationReason: string +} diff --git a/shared/models/users/registration/user-registration-state.model.ts b/shared/models/users/registration/user-registration-state.model.ts new file mode 100644 index 000000000..e4c835f78 --- /dev/null +++ b/shared/models/users/registration/user-registration-state.model.ts @@ -0,0 +1,5 @@ +export const enum UserRegistrationState { + PENDING = 1, + REJECTED = 2, + ACCEPTED = 3 +} diff --git a/shared/models/users/registration/user-registration-update-state.model.ts b/shared/models/users/registration/user-registration-update-state.model.ts new file mode 100644 index 000000000..636e22c32 --- /dev/null +++ b/shared/models/users/registration/user-registration-update-state.model.ts @@ -0,0 +1,3 @@ +export interface UserRegistrationUpdateState { + moderationResponse: string +} diff --git a/shared/models/users/registration/user-registration.model.ts b/shared/models/users/registration/user-registration.model.ts new file mode 100644 index 000000000..0d74dc28b --- /dev/null +++ b/shared/models/users/registration/user-registration.model.ts @@ -0,0 +1,29 @@ +import { UserRegistrationState } from './user-registration-state.model' + +export interface UserRegistration { + id: number + + state: { + id: UserRegistrationState + label: string + } + + registrationReason: string + moderationResponse: string + + username: string + email: string + emailVerified: boolean + + accountDisplayName: string + + channelHandle: string + channelDisplayName: string + + createdAt: Date + updatedAt: Date + + user?: { + id: number + } +} -- cgit v1.2.3