Documentation
¶
Index ¶
- Constants
- type Message
- type Module
- func (m *Module) AddTicketMessage(ctx context.Context, ticketID string, sender string, content string) (*Message, error)
- func (m *Module) CreateTicket(ctx context.Context, input any) (any, error)
- func (m *Module) CreateTicketResolver(ctx context.Context, customerID string, subject string, message string) (*Ticket, error)
- func (m *Module) CreateTicketStep(sCtx mdk.StepContext) mdk.StepResult
- func (m *Module) DispatchAIResponse(ctx context.Context, input any) (any, error)
- func (m *Module) DispatchAIResponseStep(sCtx mdk.StepContext) mdk.StepResult
- func (m *Module) FieldResolvers() map[string]any
- func (m *Module) GetTicket(ctx context.Context, id string) (*Ticket, error)
- func (m *Module) ID() string
- func (m *Module) Init(ctx context.Context, rt mdk.Runtime) error
- func (m *Module) ListCustomerTickets(ctx context.Context, customerID string) ([]*Ticket, error)
- func (m *Module) Models() []any
- func (m *Module) Mutations() map[string]any
- func (m *Module) Queries() map[string]any
- func (m *Module) Repo() *Repository
- func (m *Module) Routes() []mdk.Route
- func (m *Module) Shutdown(ctx context.Context) error
- type Repository
- func (r *Repository) GetTicketByID(ctx context.Context, id string) (*Ticket, error)
- func (r *Repository) ListTicketsByCustomerID(ctx context.Context, customerID string) ([]*Ticket, error)
- func (r *Repository) SaveMessage(ctx context.Context, m *Message) error
- func (r *Repository) SaveTicket(ctx context.Context, t *Ticket) error
- type SenderType
- type Ticket
- type TicketStatus
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 (*Module) AddTicketMessage ¶
func (*Module) CreateTicket ¶
func (*Module) CreateTicketResolver ¶
func (*Module) CreateTicketStep ¶
func (m *Module) CreateTicketStep(sCtx mdk.StepContext) mdk.StepResult
CreateTicketStep wraps CreateTicket to mdk.StepHandler.
func (*Module) DispatchAIResponse ¶
func (*Module) DispatchAIResponseStep ¶
func (m *Module) DispatchAIResponseStep(sCtx mdk.StepContext) mdk.StepResult
DispatchAIResponseStep wraps DispatchAIResponse to mdk.StepHandler.
func (*Module) FieldResolvers ¶
func (*Module) ListCustomerTickets ¶
func (*Module) Repo ¶
func (m *Module) Repo() *Repository
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(database *gorm.DB) *Repository
func (*Repository) GetTicketByID ¶
func (*Repository) ListTicketsByCustomerID ¶
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
Click to show internal directories.
Click to hide internal directories.