Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

2.1 KB
Raw Blame
package cmd

import (
	"time"

	"github.com/getfider/fider/app/models/dto"
	"github.com/getfider/fider/app/models/entity"
	"github.com/getfider/fider/app/models/enum"
)

type CreateTenant struct {
	Name      string
	Subdomain string
	Status    enum.TenantStatus

	Result *entity.Tenant
}

type UpdateTenantPrivacySettings struct {
	IsPrivate           bool
	IsFeedEnabled       bool
	IsModerationEnabled bool
	IsSignUpDisabled    bool
}

type UpdateTenantEmailAuthAllowedSettings struct {
	IsEmailAuthAllowed bool
}

type UpdateTenantSettings struct {
	Logo                *dto.ImageUpload
	Title               string
	Invitation          string
	WelcomeMessage      string
	WelcomeHeader       string
	DescriptionTemplate string
	CNAME               string
	Locale              string
}

type UpdateTenantAdvancedSettings struct {
	CustomCSS      string
	AllowedSchemes string
}

type ActivateTenant struct {
	TenantID int
}

type SaveVerificationKey struct {
	Key      string
	Code     string
	Duration time.Duration
	Request  NewEmailVerification
}

// NewEmailVerification is used to define an email verification process
type NewEmailVerification interface {
	GetEmail() string
	GetName() string
	GetUser() *entity.User
	GetKind() enum.EmailVerificationKind
}

type SetKeyAsVerified struct {
	Key string
}

type IncrementVerificationAttempts struct {
	Key string
}

type InvalidateVerificationsByEmail struct {
	Email string
	Kind  enum.EmailVerificationKind
}

type InvalidatePreviousSignUpKeys struct {
}

// ScheduleTenantDeletion records the account owner's request to delete the whole site.
// The tenant stays active during the grace window; a background job performs the hard
// delete once ScheduledAt passes. CancelKey authorises the email cancel link.
type ScheduleTenantDeletion struct {
	TenantID          int
	RequestedByUserID int
	CancelKey         string
	ScheduledAt       time.Time
}

// CancelTenantDeletion clears a pending deletion schedule, leaving the tenant untouched.
type CancelTenantDeletion struct {
	TenantID int
}

// DeleteTenant permanently removes a tenant and all of its data. Irreversible.
type DeleteTenant struct {
	TenantID int
}