team

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package team handles the management of teams and their members.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles team-related operations.

func New

func New(opts Opts) (*Manager, error)

New creates and returns a new instance of the Manager.

func (*Manager) Create

func (u *Manager) Create(name, timezone, conversationAssignmentType string, businessHrsID, slaPolicyID null.Int, emoji string, maxAutoAssignedConversations int) (models.Team, error)

Create creates a new team.

func (*Manager) Delete

func (u *Manager) Delete(id int) error

Delete deletes a team by ID also deletes all the team members and unassigns all the conversations belonging to the team.

func (*Manager) Get

func (u *Manager) Get(id int) (models.Team, error)

Get retrieves a team by ID.

func (*Manager) GetAll

func (u *Manager) GetAll() ([]models.Team, error)

GetAll retrieves all teams.

func (*Manager) GetAllCompact

func (u *Manager) GetAllCompact() ([]models.TeamCompact, error)

GetAllCompact retrieves all teams with limited fields.

func (*Manager) GetMembers

func (u *Manager) GetMembers(id int) ([]models.TeamMember, error)

GetMembers retrieves members of a team.

func (*Manager) GetUserTeams

func (u *Manager) GetUserTeams(userID int) ([]models.Team, error)

GetUserTeams retrieves teams of a user by user ID.

func (*Manager) Update

func (u *Manager) Update(id int, name, timezone, conversationAssignmentType string, businessHrsID, slaPolicyID null.Int, emoji string, maxAutoAssignedConversations int) (models.Team, error)

Update updates an existing team.

func (*Manager) UpsertUserTeams

func (u *Manager) UpsertUserTeams(id int, teamNames []string) error

UpsertUserTeams updates/inserts exists user teams

func (*Manager) UserBelongsToTeam

func (u *Manager) UserBelongsToTeam(teamID, userID int) (bool, error)

UserBelongsToTeam returns true if the user belongs to the team.

type Opts

type Opts struct {
	DB   *sqlx.DB
	Lo   *logf.Logger
	I18n *i18n.I18n
}

Opts contains options for initializing the Manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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