package entity

import "time"

type ShadowPool struct {
	ID   uint64 `gorm:"primaryKey"`
	Name string

	CreatedAt time.Time
	UpdatedAt time.Time

	OrganizationID uint64
	ProjectID      uint64
	Region         string
	CloudProvider  string
	ServicePlan    string

	Priority uint64
	Enabled  bool

	MinCapacity int
	MaxCapacity int

	AutoScalingConfig AutoScalingConfig
	InstanceDemand    InstanceDemand
	InitSQLs          []string
}

type AutoScalingConfig struct {
	MaxBatchSize      int           // Maximum number of instances to prepare or free in one period operation
	TimeToFreeInHours int           // Time (in hours) after which instance can be freed
	FreeStates        []ShadowState // FreeStates defines the shadow states that are eligible for freeing when they exceed TimeToFreeInHours
}

type InstanceDemand struct {
	MonthlySpendingLimit uint64
	DailySpendingLimit   uint64
	MinRcu               uint64
	MaxRcu               uint64
}
