26 lines
718 B
Go
26 lines
718 B
Go
// Package analytics implements Phase 9 — aggregate reporting for
|
|
// owner/manager: revenue and order volume over time, operational metrics
|
|
// (turnaround, master workload, device mix), stock/cartridge health, and an
|
|
// AI-generated narrative summary layered on top of the same aggregates.
|
|
// Every endpoint is read-only — no schema changes, no new tables, just
|
|
// queries over what Phases 1/3/5/7 already wrote.
|
|
package analytics
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/jackc/pgx/v5/pgxpool"
|
|
)
|
|
|
|
type Handler struct {
|
|
db *pgxpool.Pool
|
|
httpClient *http.Client
|
|
}
|
|
|
|
func NewHandler(db *pgxpool.Pool) *Handler {
|
|
return &Handler{
|
|
db: db,
|
|
httpClient: &http.Client{Timeout: summaryRequestTimeout},
|
|
}
|
|
}
|