repository

package
v0.0.0-...-3687f17 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TASK_CLOSE_NOTIFICATION = 0
	NEW_REPLY_NOTIFICATION  = 10000
)
View Source
const (
	NOT_ASSIGNED_TASKS = "NOT_ASSIGNED"
	CUSTOMER_TASKS     = "CUSTOMER"
	DOER_TASKS         = "DOER"
	LIKED              = "LIKED"
	RECOMMENDATIONS    = "RECOMMENDATIONS"
	REPLIED            = "REPLIED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	ID        utils.UID        `json:"id"`
	TriggerID utils.UID        `json:"-"`
	Type      int              `json:"type"`
	Content   utils.JSONObject `json:"content"`
	CreatedAt time.Time        `json:"createdAt"`
}

type NotificationsRepository

type NotificationsRepository interface {
	GetNotifications(userID utils.UID) ([]Notification, error)
	CreateNotification(userID utils.UID, notificationType int, triggerID utils.UID) error
}

type NotificationsSQLRepository

type NotificationsSQLRepository struct {
	SQLClient *db.SQLClient
}

func (*NotificationsSQLRepository) CreateNotification

func (repo *NotificationsSQLRepository) CreateNotification(userID utils.UID, notificationType int, triggerID utils.UID) error

func (*NotificationsSQLRepository) GetNotifications

func (repo *NotificationsSQLRepository) GetNotifications(userID utils.UID) ([]Notification, error)

type ProfileRepository

type ProfileRepository interface {
	GetProfile(userID utils.UID) (*UserData, error)
	SetProfile(userID utils.UID, profile UserData) error
	GetLikedTags(userID utils.UID) ([]TaskTagLink, error)
}

type ProfileSQLRepository

type ProfileSQLRepository struct {
	SQLClient *db.SQLClient
}

func (*ProfileSQLRepository) GetLikedTags

func (repo *ProfileSQLRepository) GetLikedTags(userID utils.UID) ([]TaskTagLink, error)

func (*ProfileSQLRepository) GetProfile

func (repo *ProfileSQLRepository) GetProfile(userID utils.UID) (*UserData, error)

func (*ProfileSQLRepository) SetProfile

func (repo *ProfileSQLRepository) SetProfile(userID utils.UID, profile UserData) error

type RepliesRepository

type RepliesRepository interface {
	GetReplies(taskID utils.UID) ([]Reply, error)
	GetRepliesCount(taskID utils.UID) (int32, error)
	GetDoerReply(taskID utils.UID) (*Reply, error)
	GetUserReply(taskID utils.UID, userID utils.UID) (*Reply, error)
	GetReply(replyID utils.UID) (*Reply, error)
	CreateReply(taskID utils.UID, reply Reply) (utils.UID, error)
	HideReply(replyID utils.UID) error
}

type RepliesSQLRepository

type RepliesSQLRepository struct {
	SQLClient *db.SQLClient
}

func (*RepliesSQLRepository) CreateReply

func (repo *RepliesSQLRepository) CreateReply(taskID utils.UID, reply Reply) (utils.UID, error)

func (*RepliesSQLRepository) GetDoerReply

func (repo *RepliesSQLRepository) GetDoerReply(taskID utils.UID) (*Reply, error)

func (*RepliesSQLRepository) GetReplies

func (repo *RepliesSQLRepository) GetReplies(taskID utils.UID) ([]Reply, error)

func (*RepliesSQLRepository) GetRepliesCount

func (repo *RepliesSQLRepository) GetRepliesCount(taskID utils.UID) (int32, error)

func (*RepliesSQLRepository) GetReply

func (repo *RepliesSQLRepository) GetReply(replyID utils.UID) (*Reply, error)

func (*RepliesSQLRepository) GetUserReply

func (repo *RepliesSQLRepository) GetUserReply(taskID utils.UID, userID utils.UID) (*Reply, error)

func (*RepliesSQLRepository) HideReply

func (repo *RepliesSQLRepository) HideReply(replyID utils.UID) error

type Reply

type Reply struct {
	ID        utils.UID `json:"id"`
	Text      string    `json:"text"`
	Creator   UserData  `json:"creator"`
	TaskID    utils.UID `json:"taskId"`
	CreatedAt time.Time `json:"createdAt"`
}

type Tag

type Tag struct {
	ID   utils.UID `json:"id"`
	Text string    `json:"text"`
}

type TagsRepository

type TagsRepository interface {
	GetTaskTags(taskID utils.UID) ([]Tag, error)
	SearchTags(request string) ([]Tag, error)
	CreateTag(tag string) (utils.UID, error)
	AddTagToTask(taskID utils.UID, tagID utils.UID) error
}

type TagsSQLRepository

type TagsSQLRepository struct {
	SQLClient *db.SQLClient
}

func (*TagsSQLRepository) AddTagToTask

func (repo *TagsSQLRepository) AddTagToTask(taskID utils.UID, tagID utils.UID) error

func (*TagsSQLRepository) CreateTag

func (repo *TagsSQLRepository) CreateTag(tag string) (utils.UID, error)

func (*TagsSQLRepository) GetTaskTags

func (repo *TagsSQLRepository) GetTaskTags(taskID utils.UID) ([]Tag, error)

func (*TagsSQLRepository) SearchTags

func (repo *TagsSQLRepository) SearchTags(request string) ([]Tag, error)

type Task

type Task struct {
	ID           utils.UID        `json:"id"`
	Name         string           `json:"name"`
	Description  string           `json:"description,omitempty"`
	Customer     UserData         `json:"customer"`
	Closed       bool             `json:"closed"`
	Owns         bool             `json:"owns"`
	Liked        bool             `json:"liked"`
	RepliesCount int32            `json:"replies"`
	Tags         utils.JSONObject `json:"tags"`
	CreatedAt    time.Time        `json:"createdAt"`
}
type TaskTagLink struct {
	TaskID utils.UID
	TagID  utils.UID
}

type TasksRepository

type TasksRepository interface {
	GetTasksFeed(scope string, request string, userID utils.UID) ([]Task, error)
	GetTasksTags(userID utils.UID) ([]TaskTagLink, error)
	GetTask(userID utils.UID, taskID utils.UID) (*Task, error)
	GetTasks(userID utils.UID, tasksID []utils.UID) ([]Task, error)
	GetTaskCustomer(taskID utils.UID) (utils.UID, error)
	SetTaskLike(userID utils.UID, taskID utils.UID, value bool) error
	CreateTask(task Task) (utils.UID, error)
	CloseTask(taskID utils.UID, doerID utils.UID) error
}

type TasksSQLRepository

type TasksSQLRepository struct {
	SQLClient *db.SQLClient
}

func (*TasksSQLRepository) CloseTask

func (repo *TasksSQLRepository) CloseTask(taskID utils.UID, doerID utils.UID) error

func (*TasksSQLRepository) CreateTask

func (repo *TasksSQLRepository) CreateTask(task Task) (utils.UID, error)

func (*TasksSQLRepository) GetTask

func (repo *TasksSQLRepository) GetTask(userID utils.UID, taskID utils.UID) (*Task, error)

func (*TasksSQLRepository) GetTaskCustomer

func (repo *TasksSQLRepository) GetTaskCustomer(taskID utils.UID) (utils.UID, error)

func (*TasksSQLRepository) GetTasks

func (repo *TasksSQLRepository) GetTasks(userID utils.UID, tasksID []utils.UID) ([]Task, error)

func (*TasksSQLRepository) GetTasksFeed

func (repo *TasksSQLRepository) GetTasksFeed(scope string, request string, userID utils.UID) ([]Task, error)

func (*TasksSQLRepository) GetTasksTags

func (repo *TasksSQLRepository) GetTasksTags(userID utils.UID) ([]TaskTagLink, error)

func (*TasksSQLRepository) SetTaskLike

func (repo *TasksSQLRepository) SetTaskLike(userID utils.UID, taskID utils.UID, value bool) error

type UserData

type UserData struct {
	ID         utils.UID `json:"id"`
	Name       string    `json:"name"`
	IsCustomer *bool     `json:"customer,omitempty"`
}

Jump to

Keyboard shortcuts

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