Added measurements, and devices statsh
Added stats endpoints
This commit is contained in:
@@ -265,6 +265,12 @@ type Status struct {
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
type ActiveContractsResponse struct {
|
||||
ActiveCount int64 `json:"active"`
|
||||
ExecutedCount int64 `json:"executed"`
|
||||
MonthlyContracts map[string]map[string]int64 `json:"monthly"`
|
||||
}
|
||||
|
||||
func GetContractStatuses() []Status {
|
||||
return []Status{
|
||||
{Value: "Active", Key: "active"},
|
||||
|
||||
@@ -36,6 +36,12 @@ type DeviceInfoResponse struct {
|
||||
ExternalDeviceID string `json:"externalDeviceId"`
|
||||
}
|
||||
|
||||
type NormalAndBreachedDevicesResponse struct {
|
||||
Breached int64 `json:"breached"`
|
||||
Normal int64 `json:"normal"`
|
||||
MonthlyCounts map[string]map[string]int64 `json:"monthly_counts"`
|
||||
}
|
||||
|
||||
func ConvertDeviceInfoToResponse(deviceInfos []DeviceInfo) []DeviceInfoResponse {
|
||||
var deviceInfoResponses []DeviceInfoResponse
|
||||
for _, deviceInfo := range deviceInfos {
|
||||
|
||||
@@ -110,6 +110,12 @@ type KeyValue struct {
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
type ActiveInvoiceResponse struct {
|
||||
Claimed int64 `json:"issued"`
|
||||
Issued int64 `json:"claimed"`
|
||||
MonthlyInvoices map[string]map[string]int64 `json:"monthly"`
|
||||
}
|
||||
|
||||
func GetInvoiceStatuses() []Status {
|
||||
return []Status{
|
||||
{Key: "Insurance claimed", Value: "insurance_claimed"},
|
||||
|
||||
Reference in New Issue
Block a user