package models

type MonthlyProportionSum struct {
	Timestamp     int64   `gorm:"column:timestamp;type:bigint;not null"`
	Month         string  `gorm:"column:month;type:varchar(7);not null"`
	Provider      string  `gorm:"column:provider;type:varchar(50);not null"`
	Env           string  `gorm:"column:env;type:varchar(255);not null"`
	MeteringGroup string  `gorm:"column:metering_group;type:varchar(255);not null"`
	Tenant        string  `gorm:"column:tenant;type:varchar(255);not null"`
	Proportion    float64 `gorm:"column:proportion;type:double;not null"`
}

func (MonthlyProportionSum) TableName() string {
	return "monthly_proportion_sum"
}

type AggregatedCost struct {
	Provider      string  `gorm:"column:provider"`
	MeteringGroup string  `gorm:"column:metering_group"`
	TotalCost     float64 `gorm:"column:total_cost"`
}

type ProviderSummary struct {
	Provider                           string  `gorm:"column:provider"`
	DedicatedDataplaneCost             float64 `gorm:"column:dedicated_dataplane_cost"`
	DedicatedRegionalCost              float64 `gorm:"column:dedicated_regional_cost"`
	ProviderTotalCostExcludingRegional float64 `gorm:"column:provider_total_cost_excluding_regional"`
}

type FinalProportionData struct {
	Timestamp            int64
	Month                string
	Provider             string
	Env                  string
	MeteringGroup        string
	Tenant               string
	Cost                 float64
	AmplificationFactor  float64
	TotalCostDenominator float64
}

func IsGCPRegion(region string) bool {
	gcpRegions := map[string]bool{
		"us-central1":     true,
		"us-west1":        true,
		"asia-east1":      true,
		"asia-northeast1": true,
		"asia-southeast1": true,
	}
	return gcpRegions[region]
}
