invite

package
v1.202405300917.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Field_Roles = "Roles"

	Field_Login                 = "Login"
	Field_InvitingWorkspaceWSID = "InvitingWorkspaceWSID"

	Field_SubjectKind = "SubjectKind"
	Field_ProfileWSID = "ProfileWSID"
	Field_SubjectID   = "SubjectID"
	Field_LoginHash   = "LoginHash"
)
View Source
const (
	State_Null int32 = iota
	State_ToBeInvited
	State_Invited
	State_ToBeJoined
	State_Joined
	State_ToUpdateRoles
	State_ToBeCancelled
	State_Cancelled
	State_ToBeLeft
	State_Left
	State_FakeLast
)
View Source
const (
	EmailTemplatePlaceholder_VerificationCode = "${VerificationCode}"
	EmailTemplatePlaceholder_InviteID         = "${InviteID}"
	EmailTemplatePlaceholder_WSID             = "${WSID}"
	EmailTemplatePlaceholder_Roles            = "${Roles}"
	EmailTemplatePlaceholder_WSName           = "${WSName}"
	EmailTemplatePlaceholder_Email            = "${Email}"
)

Variables

View Source
var (
	QNameViewJoinedWorkspaceIndex      = appdef.NewQName(appdef.SysPackage, "JoinedWorkspaceIndexView")
	QNameProjectorJoinedWorkspaceIndex = appdef.NewQName(appdef.SysPackage, "ProjectorJoinedWorkspaceIndex")

	QNameCDocJoinedWorkspace  = appdef.NewQName(appdef.SysPackage, "JoinedWorkspace")
	QNameCDocSubject          = appdef.NewQName(appdef.SysPackage, "Subject")
	QNameViewSubjectsIdx      = appdef.NewQName(appdef.SysPackage, "ViewSubjectsIdx")
	QNameApplyViewSubjectsIdx = appdef.NewQName(appdef.SysPackage, "ApplyViewSubjectsIdx")
)

TODO improvements 1. Do all numeric constants start from 1 and set type for it 2. Add QName validation in RecordStorage GetBatch method 3. Add projector names via appstructs for validation

View Source
var (
	ErrInviteNotExists = errors.New("invite not exists")

	ErrInviteStateInvalid   = errors.New("invite state invalid")
	ErrSubjectAlreadyExists = errors.New("subject already exists")
)

Functions

func GetCDocJoinedWorkspace

func GetCDocJoinedWorkspace(st istructs.IState, invitingWorkspaceWSID int64) (svbCDocJoinedWorkspace istructs.IStateValue, skb istructs.IStateKeyBuilder, ok bool, err error)

func GetCDocJoinedWorkspaceForUpdate

func GetCDocJoinedWorkspaceForUpdate(st istructs.IState, intents istructs.IIntents, invitingWorkspaceWSID int64) (svbCDocJoinedWorkspace istructs.IStateValueBuilder, ok bool, err error)

func GetCDocJoinedWorkspaceForUpdateRequired

func GetCDocJoinedWorkspaceForUpdateRequired(st istructs.IState, intents istructs.IIntents, invitingWorkspaceWSID int64) (svbCDocJoinedWorkspace istructs.IStateValueBuilder, err error)

func GetSubjectIdxViewKeyBuilder

func GetSubjectIdxViewKeyBuilder(login string, s istructs.IState) (istructs.IStateKeyBuilder, error)

func Provide

func Provide(cfg *istructsmem.AppConfigType, timeFunc coreutils.TimeFunc,
	federation federation.IFederation, itokens itokens.ITokens, smtpCfg smtp.Cfg)

func SubjectExistByBothLogins

func SubjectExistByBothLogins(login string, st istructs.IState) (ok bool, actualLogin string, _ error)

checks cdoc.sys.SubjectIdx existence by login as cdoc.sys.Invite.EMail and as token.Login

func SubjectExistsByLogin

func SubjectExistsByLogin(login string, state istructs.IState) (ok bool, _ error)

Types

type State

type State int32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL