Backend: - Password reset flow (forgot/reset endpoints, tokens table) - Profile management (PUT /users/me, skills, experience, education) - Tickets system (CRUD, messages, stats) - Activity logs (list, stats) - Document validator (CNPJ, CPF, EIN support) - Input sanitizer (XSS prevention) - Full-text search em vagas (plainto_tsquery) - Filtros avançados (location, salary, workMode) - Ordenação (date, salary, relevance) Frontend: - Forgot/Reset password pages - Candidate profile edit page - Sanitize utilities (sanitize.ts) Backoffice: - TicketsModule proxy - ActivityLogsModule proxy - Dockerfile otimizado (multi-stage, non-root, healthcheck) Migrations: - 013: Profile fields to users - 014: Password reset tokens - 015: Tickets table - 016: Activity logs table
67 lines
2.3 KiB
Go
67 lines
2.3 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
// Ticket represents a support ticket
|
|
type Ticket struct {
|
|
ID int `json:"id" db:"id"`
|
|
UserID *int `json:"userId,omitempty" db:"user_id"`
|
|
CompanyID *int `json:"companyId,omitempty" db:"company_id"`
|
|
Subject string `json:"subject" db:"subject"`
|
|
Description string `json:"description" db:"description"`
|
|
Category string `json:"category" db:"category"`
|
|
Priority string `json:"priority" db:"priority"`
|
|
Status string `json:"status" db:"status"`
|
|
AssignedTo *int `json:"assignedTo,omitempty" db:"assigned_to"`
|
|
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
|
UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
|
|
ResolvedAt *time.Time `json:"resolvedAt,omitempty" db:"resolved_at"`
|
|
|
|
// Joined fields
|
|
UserName *string `json:"userName,omitempty"`
|
|
CompanyName *string `json:"companyName,omitempty"`
|
|
AssigneeName *string `json:"assigneeName,omitempty"`
|
|
}
|
|
|
|
// TicketMessage represents a message within a ticket
|
|
type TicketMessage struct {
|
|
ID int `json:"id" db:"id"`
|
|
TicketID int `json:"ticketId" db:"ticket_id"`
|
|
UserID *int `json:"userId,omitempty" db:"user_id"`
|
|
Message string `json:"message" db:"message"`
|
|
IsInternal bool `json:"isInternal" db:"is_internal"`
|
|
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
|
|
|
// Joined fields
|
|
UserName *string `json:"userName,omitempty"`
|
|
}
|
|
|
|
// CreateTicketRequest for creating a new ticket
|
|
type CreateTicketRequest struct {
|
|
Subject string `json:"subject"`
|
|
Description string `json:"description"`
|
|
Category string `json:"category"`
|
|
Priority string `json:"priority"`
|
|
}
|
|
|
|
// UpdateTicketRequest for updating a ticket
|
|
type UpdateTicketRequest struct {
|
|
Status *string `json:"status,omitempty"`
|
|
Priority *string `json:"priority,omitempty"`
|
|
AssignedTo *int `json:"assignedTo,omitempty"`
|
|
}
|
|
|
|
// AddTicketMessageRequest for adding a message to a ticket
|
|
type AddTicketMessageRequest struct {
|
|
Message string `json:"message"`
|
|
IsInternal bool `json:"isInternal"`
|
|
}
|
|
|
|
// TicketStats for dashboard
|
|
type TicketStats struct {
|
|
Total int `json:"total"`
|
|
Open int `json:"open"`
|
|
InProgress int `json:"inProgress"`
|
|
Resolved int `json:"resolved"`
|
|
AvgResponse float64 `json:"avgResponseTime"` // in hours
|
|
}
|