Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var States = states{
Open: "open",
Answered: "answered",
Closed: "closed",
Deleted: "deleted",
}
Functions ¶
This section is empty.
Types ¶
type AdminDto ¶
type AdminDto struct { UUID string `json:"uuid"` User User `json:"user"` Subject string `json:"subject"` Messages []*Message `json:"messages"` State State `json:"state"` IsUserClosed bool `json:"isUserClosed"` ClosedAt *time.Time `json:"closedAt"` UpdatedAt *time.Time `json:"updatedAt"` CreatedAt time.Time `json:"createdAt"` }
type AdminListDto ¶
type Entity ¶
type Entity struct { UUID string `json:"uuid" bson:"_id,omitempty"` User *User `json:"user" bson:"user"` Subject string `json:"subject" bson:"subject"` Messages []*Message `json:"messages" bson:"messages"` State State `json:"state" bson:"state"` IsUserClosed bool `json:"isUserClosed" bson:"is_user_closed"` ClosedAt *time.Time `json:"closedAt" bson:"closed_at"` UpdatedAt *time.Time `json:"updatedAt" bson:"updated_at"` CreatedAt time.Time `json:"createdAt" bson:"created_at"` }
func (*Entity) ToAdminList ¶
func (e *Entity) ToAdminList() AdminListDto
type FilterEntity ¶
type Message ¶
type Message struct { UUID string `json:"uuid" bson:"uuid"` InterestUUID string `json:"interest_uuid,omitempty" bson:"interest_uuid,omitempty"` Text string `json:"text" bson:"text"` IsAdmin bool `json:"is_admin" bson:"is_admin"` IsDeleted bool `json:"is_deleted" bson:"is_deleted"` Date time.Time `json:"date" bson:"date"` }
type Repo ¶
type Repo interface { // admin actions AdminFilter(ctx context.Context, filter FilterEntity, listConfig list.Config) (*list.Result[*Entity], *i18np.Error) AdminGet(ctx context.Context, uuid string) (*Entity, *i18np.Error) AdminClose(ctx context.Context, uuid string) *i18np.Error AdminDelete(ctx context.Context, uuid string) *i18np.Error AdminAddMessage(ctx context.Context, uuid string, adminId string, message string) *i18np.Error AdminUpdate(ctx context.Context, uuid string, subject string) *i18np.Error AdminRemoveMessage(ctx context.Context, uuid string, messageId string) *i18np.Error // user actions Create(ctx context.Context, entity *Entity) (*Entity, *i18np.Error) AddMessage(ctx context.Context, uuid string, message string, user WithUser) *i18np.Error Close(ctx context.Context, uuid string, user WithUser) *i18np.Error Delete(ctx context.Context, uuid string, user WithUser) *i18np.Error Get(ctx context.Context, uuid string, user WithUser) (*Entity, *i18np.Error) Filter(ctx context.Context, user WithUser, filter FilterEntity, listConfig list.Config) (*list.Result[*Entity], *i18np.Error) }
type UserMessageDto ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.