Migrate ingest and API paths to string IDs

This commit is contained in:
2026-02-14 20:10:23 +03:00
parent 6df92b7a69
commit 3ffdf9b0e1
42 changed files with 1958 additions and 437 deletions

View File

@@ -47,14 +47,14 @@ func (h ingestHandlers) handleLogBundle(w http.ResponseWriter, r *http.Request)
}
var req struct {
AssetID int64 `json:"asset_id"`
AssetID string `json:"asset_id"`
CollectedAt string `json:"collected_at"`
Source *string `json:"source"`
Components []struct {
VendorSerial string `json:"vendor_serial"`
Vendor *string `json:"vendor"`
Model *string `json:"model"`
LotID *int64 `json:"lot_id"`
LotID *string `json:"lot_id"`
Firmware *string `json:"firmware_version"`
} `json:"components"`
}
@@ -64,7 +64,7 @@ func (h ingestHandlers) handleLogBundle(w http.ResponseWriter, r *http.Request)
return
}
if req.AssetID <= 0 {
if strings.TrimSpace(req.AssetID) == "" {
writeError(w, http.StatusBadRequest, "asset_id is required")
return
}