ticket

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package ticket implements the ticket subdomain of the support module. Only the module facade (internal/module/support) may reach it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier added in v1.15.18

type Notifier interface {
	TicketCreated(ctx context.Context, t *entity.Ticket)
	TicketReplied(ctx context.Context, ticketID int64, from, content string)
	TicketStatusChanged(ctx context.Context, ticketID int64, status uint8)
}

Notifier mirrors ticket lifecycle into other channels — today the forum topic in the Telegram admin group. Implementations are best-effort by contract: they never fail the ticket operation, so the methods return nothing and do their own logging.

type Service

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

func NewService

func NewService(repo repository.TicketRepo, notify Notifier) *Service

NewService builds the ticket service; notify may be nil when no mirror channel is wired.

func (*Service) CreateFollow

func (s *Service) CreateFollow(ctx context.Context, req *dto.CreateTicketFollowRequest) error

CreateFollow appends an admin reply and flips the ticket back to Waiting.

func (*Service) CreateUserFollow

func (s *Service) CreateUserFollow(ctx context.Context, req *dto.CreateUserTicketFollowRequest) error

CreateUserFollow appends a user reply after verifying ticket ownership and flips the ticket to Pending.

func (*Service) CreateUserTicket

func (s *Service) CreateUserTicket(ctx context.Context, req *dto.CreateUserTicketRequest) error

func (*Service) GetDetail

func (s *Service) GetDetail(ctx context.Context, req *dto.GetTicketRequest) (*dto.Ticket, error)

func (*Service) GetUserDetail

func (s *Service) GetUserDetail(ctx context.Context, req *dto.GetUserTicketDetailRequest) (*dto.Ticket, error)

func (*Service) GetUserList

func (*Service) List

func (*Service) UpdateStatus

func (s *Service) UpdateStatus(ctx context.Context, req *dto.UpdateTicketStatusRequest) error

func (*Service) UpdateUserStatus

func (s *Service) UpdateUserStatus(ctx context.Context, req *dto.UpdateUserTicketStatusRequest) error

Jump to

Keyboard shortcuts

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