package discovery

type HealthParams struct {
	IntervalSec int `json:"intervalSec"`
	TimeoutSec  int `json:"timeoutSec"`
}

type Limits struct {
	MinAmount     string            `json:"minAmount,omitempty"`
	MaxAmount     string            `json:"maxAmount,omitempty"`
	VolumeLimit   map[string]string `json:"volumeLimit,omitempty"`
	VelocityLimit map[string]int    `json:"velocityLimit,omitempty"`
}

type Announcement struct {
	ID              string       `json:"id"`
	InstanceID      string       `bson:"instanceId" json:"instanceId"`
	Service         string       `json:"service"`
	Rail            string       `json:"rail,omitempty"`
	Network         string       `json:"network,omitempty"`
	Operations      []string     `json:"operations,omitempty"`
	Currencies      []string     `json:"currencies,omitempty"`
	Limits          *Limits      `json:"limits,omitempty"`
	InvokeURI       string       `json:"invokeURI,omitempty"`
	RoutingPriority int          `json:"routingPriority,omitempty"`
	Version         string       `json:"version,omitempty"`
	Health          HealthParams `json:"health,omitempty"`
}

type Heartbeat struct {
	ID         string `json:"id"`
	InstanceID string `json:"instanceId"`
	Status     string `json:"status"`
	TS         int64  `json:"ts"`
}

type RefreshEvent struct {
	InstanceID string `json:"instanceId,omitempty"`
	Service    string `json:"service,omitempty"`
	Rail       string `json:"rail,omitempty"`
	Network    string `json:"network,omitempty"`
	Message    string `json:"message,omitempty"`
}
