package models

import (
	"time"
)

type Deployment struct {
	ID            string    `json:"id"`
	ClientID      string    `json:"client_id"`
	ProviderID    string    `json:"provider_id"`
	TemplateID    string    `json:"template_id"`
	Status        string    `json:"status"` // Pending, Running, Failed, Terminated
	Region        string    `json:"region"`
	VPSID         string    `json:"vps_id"` // ID assigned by provider
	IPAddress     string    `json:"ip_address"`
	Configuration string    `json:"configuration"` // JSON configuration
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
	DeployedAt    time.Time `json:"deployed_at,omitempty"`
	TerminatedAt  time.Time `json:"terminated_at,omitempty"`
}

type AutoDeployConfig struct {
	ID        string    `json:"id"`
	ProjectID string    `json:"project_id"`
	Branch    string    `json:"branch"`
	Trigger   string    `json:"trigger"`
	Enabled   bool      `json:"enabled"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type AutoDeployHistory struct {
	ID        string    `json:"id"`
	ProjectID string    `json:"project_id"`
	Branch    string    `json:"branch"`
	Trigger   string    `json:"trigger"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}
