Files
zeekay 4532862f22 fix: use query-param format for crypto bars (sandbox single path 404s)
Same issue as snapshots — Alpaca sandbox returns 404 for
/v1beta3/crypto/us/{sym}/bars but works with
/v1beta3/crypto/us/bars?symbols={sym}. Also handle the wrapped
response format {"bars":{"BTC/USD":[...]}} vs stock {"bars":[...]}.
2025-12-24 00:57:08 -07:00

49 lines
1.3 KiB
Go

package compliance
import (
"net/http"
"time"
)
// reportsHandler holds reports HTTP handler state.
type reportsHandler struct{}
// reportType describes an available report.
type reportType struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
LastGenerated string `json:"lastGenerated"`
}
func (h *reportsHandler) handleListReports(w http.ResponseWriter, r *http.Request) {
now := time.Now().UTC().Format(time.RFC3339)
reports := []reportType{
{
ID: "monthly-statement",
Name: "Monthly Statement",
Description: "Comprehensive monthly account statement with all activity",
LastGenerated: now,
},
{
ID: "form-8949",
Name: "Form 8949",
Description: "IRS Form 8949 for reporting capital gains and losses",
LastGenerated: now,
},
{
ID: "form-1099b",
Name: "1099-B",
Description: "Broker proceeds from securities and barter exchange transactions",
LastGenerated: now,
},
{
ID: "transaction-history",
Name: "Transaction History",
Description: "Complete transaction history export for audit and compliance",
LastGenerated: now,
},
}
writeJSON(w, http.StatusOK, reports)
}