invite

package
v0.0.0-...-9d06c01 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var I18nMessages = messages{
	InvalidUUID: "error_invite_invalid_uuid",
	Failed:      "error_invite_failed",
	NotFound:    "error_invite_not_found",
	Used:        "error_invite_used",
	Deleted:     "error_invite_deleted",
	Timeout:     "error_invite_timeout",

	InviteSubject: "invite_subject",
	EmailMismatch: "error_invite_email_mismatch",
}

Functions

This section is empty.

Types

type Entity

type Entity struct {
	UUID             string     `json:"uuid"`
	BusinessUUID     string     `json:"businessUUID"`
	BusinessNickName string     `json:"businessNickName"`
	CreatorUserName  string     `json:"creatorUserName"`
	Email            string     `json:"email"`
	IsUsed           bool       `json:"isUsed"`
	IsDeleted        bool       `json:"isDeleted"`
	CreatedAt        *time.Time `json:"createdAt"`
	UpdatedAt        *time.Time `json:"updatedAt"`
}

type Errors

type Errors interface {
	InvalidUUID() *i18np.Error
	Failed(operation string) *i18np.Error
	EmailMismatch() *i18np.Error
	NotFound() *i18np.Error
	Used() *i18np.Error
	Deleted() *i18np.Error
	Timeout() *i18np.Error
}

type EventConfig

type EventConfig struct {
	Publisher events.Publisher
	Topics    config.Topics
	Urls      config.Urls
	I18n      *i18np.I18n
}

type Events

type Events interface {
	Invite(event InviteEvent)
	Delete(event InviteDeleteEvent)
	Use(event InviteUseEvent)
}

func NewEvents

func NewEvents(cnf EventConfig) Events

type Factory

type Factory struct {
	Errors Errors
}

func NewFactory

func NewFactory() Factory

func (Factory) IsZero

func (f Factory) IsZero() bool

func (Factory) New

func (f Factory) New(email string, businessUUID string, businessName string, userName string) *Entity

type InviteDeleteEvent

type InviteDeleteEvent struct {
	InviteUUID       string `json:"inviteUUID"`
	BusinessNickName string `json:"businessNickName"`
	UserUUID         string `json:"userUUID"`
	UserName         string `json:"userName"`
}

type InviteEvent

type InviteEvent struct {
	Locale       string `json:"locale"`
	Email        string `json:"email"`
	InviteUUID   string `json:"inviteUUID"`
	BusinessUUID string `json:"businessUUID"`
	BusinessName string `json:"businessName"`
	UserUUID     string `json:"userUUID"`
	UserName     string `json:"userName"`
}

type InviteUseEvent

type InviteUseEvent struct {
	InviteUUID       string `json:"inviteUUID"`
	BusinessNickName string `json:"businessNickName"`
	UserEmail        string `json:"userEmail"`
	UserUUID         string `json:"userUUID"`
	UserName         string `json:"userName"`
}

type Repository

type Repository interface {
	Create(ctx context.Context, entity *Entity) (*Entity, *i18np.Error)
	GetByUUID(ctx context.Context, uuid string) (*Entity, *i18np.Error)
	GetByBusinessUUID(ctx context.Context, businessUUID string) ([]*Entity, *i18np.Error)
	GetByEmail(ctx context.Context, email string) ([]*Entity, *i18np.Error)
	Use(ctx context.Context, uuid string) *i18np.Error
	Delete(ctx context.Context, uuid string) *i18np.Error
}

Jump to

Keyboard shortcuts

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