package global

const TIME_TEMPLATE = "2006-01-02 15:04:05"

type Response struct {
	Code       int         `json:"code,omitempty"`
	ErrMessage string      `json:"err_message,omitempty"`
	Data       interface{} `json:"data,omitempty"`
}

type Request struct {
	TenantID  string `json:"tenant_id"`
	ProjectID string `json:"project_id,omitempty"`
	//Environment string `json:"environment"`
	StartTime string `json:"start_time"`
	EndTime   string `json:"end_time"`
	// default to old version cost plan, use v2 for the new cost plan
	DataVersion string `json:"data_version,omitempty"`
}

type Labels struct {
	TenantID    string `json:"tenant_id,omitempty"`
	ProjectID   string `json:"project_id,omitempty"`
	ClusterID   string `json:"cluster_id,omitempty"`
	ComponentID string `json:"component_id,omitempty"`
	UsedBy      string `json:"usedby,omitempty"`
	ServiceType string `json:"servicetype,omitempty"`
	Provider    string `json:"provider,omitempty"` // cloud provider
}

type Item struct {
	Labels          Labels  `json:"labels"`
	Amount          float64 `json:"amount"`
	Unit            string  `json:"unit"`
	Cost            float64 `json:"cost"`
	ResourceType    string  `json:"resource_type"`
	ResourceSubtype string  `json:"resource_subtype,omitempty"`
	DataVersion     string  `json:"data_version"`
	ServiceName     string  `json:"service_name"`
	Description     string  `json:"description"`
	Location        string  `json:"location"`

	StartTime string `json:"start_time"`
	EndTime   string `json:"end_time"`
}

type Bill struct {
	Request
	Data []Item `json:"data"`
}
