package event

import (
	"time"

	"github.com/shopspring/decimal"
)

// The user create pay-method at billing and is payable @Nizheming
const TenantPayableEventType = "tenant-payable"

type TenantPayableDataStructure struct {
	// the tenant who has been payable
	TenantID uint64 `json:"tenant_id"`
}

// Triggered on user tenant plan changed
const TenantPlanEventType = "tenant_plan"

type TenantPlanEvent struct {
	TenantID      uint64 `json:"tenant_id"`
	ChangedPlan   string `json:"changed_plan"`
	ChangedStatus string `json:"changed_status"`
	EffectivePlan string `json:"effective_plan"`
}

// Triggered on user spend limit changed
const SpendLimitEventType = "spend-limit"

type SpendLimitEvent struct {
	SpendLimitSettingID uint            `json:"spendlimit_setting_id"`
	TenantID            uint64          `json:"tenant_id"`
	Interval            string          `json:"interval"`   // monthly
	CostType            string          `json:"cost_type"`  // credits /
	RangeType           string          `json:"range_type"` // tenant / cluster / project
	RangeID             uint64          `json:"range_id"`   // tenant_id / cluster_id / project_id
	Status              string          `json:"status"`     // excessive / fit / deprecated
	BizType             string          `json:"biz_type"`   // now it is empty or `serverless_cluster`
	Limit               decimal.Decimal `json:"limit"`
	Costs               decimal.Decimal `json:"costs"`
	StartDate           time.Time       `json:"start_date"`
}
