
package domain

// AppKey uniquely identifies an application
type AppKey struct {
	Organization string
	Name         string
	Version      string
}

// CloudletKey uniquely identifies a cloudlet
type CloudletKey struct {
	Organization string
	Name         string
}

// AppInstanceKey uniquely identifies an application instance
type AppInstanceKey struct {
	Organization string
	Name         string
	CloudletKey  CloudletKey
}

// Flavor defines resource allocation for instances
type Flavor struct {
	Name string
}

// SecurityRule defines network access rules
type SecurityRule struct {
	PortRangeMax int
	PortRangeMin int
	Protocol     string
	RemoteCIDR   string
}

// App represents an application definition
type App struct {
	Key                         AppKey
	Deployment                  string
	ImageType                   string
	ImagePath                   string
	AllowServerless             bool
	DefaultFlavor               Flavor
	ServerlessConfig            interface{}
	DeploymentGenerator         string
	DeploymentManifest          string
	RequiredOutboundConnections []SecurityRule
	Fields                      []string
}

// AppInstance represents a deployed application instance
type AppInstance struct {
	Key        AppInstanceKey
	AppKey     AppKey
	Flavor     Flavor
	State      string
	PowerState string
	Fields     []string
}

// Cloudlet represents edge infrastructure
type Cloudlet struct {
	Key           CloudletKey
	Location      Location
	IpSupport     string
	NumDynamicIps int32
	State         string
	Flavor        Flavor
	PhysicalName  string
	Region        string
	NotifySrvAddr string
}

// Location represents geographical coordinates
type Location struct {
	Latitude  float64
	Longitude float64
}
