support

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TicketOpen     TicketStatus = "OPEN"
	TicketResolved TicketStatus = "RESOLVED"
	TicketClosed   TicketStatus = "CLOSED"

	SenderHuman SenderType = "HUMAN"
	SenderAI    SenderType = "AI"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	ID        string         `gorm:"primaryKey" json:"id"`
	TicketID  string         `gorm:"index;not null" json:"ticket_id"`
	Sender    SenderType     `gorm:"not null" json:"sender"`
	Content   string         `gorm:"not null" json:"content"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}

Message is a single entry in a support ticket conversation.

type Module

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

Module implements the mdk.Module interface for Support.

func NewModule

func NewModule() *Module

func (*Module) AddTicketMessage

func (m *Module) AddTicketMessage(ctx context.Context, ticketID string, sender string, content string) (*Message, error)

func (*Module) CreateTicket

func (m *Module) CreateTicket(ctx context.Context, input any) (any, error)

func (*Module) CreateTicketResolver

func (m *Module) CreateTicketResolver(ctx context.Context, customerID string, subject string, message string) (*Ticket, error)

func (*Module) CreateTicketStep

func (m *Module) CreateTicketStep(sCtx mdk.StepContext) mdk.StepResult

CreateTicketStep wraps CreateTicket to mdk.StepHandler.

func (*Module) DispatchAIResponse

func (m *Module) DispatchAIResponse(ctx context.Context, input any) (any, error)

func (*Module) DispatchAIResponseStep

func (m *Module) DispatchAIResponseStep(sCtx mdk.StepContext) mdk.StepResult

DispatchAIResponseStep wraps DispatchAIResponse to mdk.StepHandler.

func (*Module) FieldResolvers

func (m *Module) FieldResolvers() map[string]any

func (*Module) GetTicket

func (m *Module) GetTicket(ctx context.Context, id string) (*Ticket, error)

func (*Module) ID

func (m *Module) ID() string

func (*Module) Init

func (m *Module) Init(ctx context.Context, rt mdk.Runtime) error

func (*Module) ListCustomerTickets

func (m *Module) ListCustomerTickets(ctx context.Context, customerID string) ([]*Ticket, error)

func (*Module) Models

func (m *Module) Models() []any

func (*Module) Mutations

func (m *Module) Mutations() map[string]any

func (*Module) Queries

func (m *Module) Queries() map[string]any

func (*Module) Repo

func (m *Module) Repo() *Repository

func (*Module) Routes

func (m *Module) Routes() []mdk.Route

func (*Module) Shutdown

func (m *Module) Shutdown(ctx context.Context) error

type Repository

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

func NewRepository

func NewRepository(database *gorm.DB) *Repository

func (*Repository) GetTicketByID

func (r *Repository) GetTicketByID(ctx context.Context, id string) (*Ticket, error)

func (*Repository) ListTicketsByCustomerID

func (r *Repository) ListTicketsByCustomerID(ctx context.Context, customerID string) ([]*Ticket, error)

func (*Repository) SaveMessage

func (r *Repository) SaveMessage(ctx context.Context, m *Message) error

func (*Repository) SaveTicket

func (r *Repository) SaveTicket(ctx context.Context, t *Ticket) error

type SenderType

type SenderType string

type Ticket

type Ticket struct {
	ID         string         `gorm:"primaryKey" json:"id"`
	CustomerID string         `gorm:"index;not null" json:"customer_id"`
	Subject    string         `gorm:"not null" json:"subject"`
	Status     TicketStatus   `gorm:"not null" json:"status"`
	Messages   []Message      `gorm:"foreignKey:TicketID" json:"messages"`
	CreatedAt  time.Time      `json:"created_at"`
	UpdatedAt  time.Time      `json:"updated_at"`
	DeletedAt  gorm.DeletedAt `gorm:"index" json:"-"`
}

Ticket represents a customer support request.

type TicketStatus

type TicketStatus string

Jump to

Keyboard shortcuts

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