package domain

import "time"

// DatabaseCredentials represents isolated database access for a project.
// Each project gets its own database and user in CockroachDB.
type DatabaseCredentials struct {
	ProjectID    string    `json:"project_id" db:"project_id"`
	DatabaseName string    `json:"database_name" db:"database_name"` // project_{id}
	Username     string    `json:"username" db:"username"`           // project_{id}
	Password     string    `json:"password" db:"password"`           // generated (stored encrypted)
	Host         string    `json:"host" db:"host"`                   // cockroachdb-public.databases.svc
	Port         int       `json:"port" db:"port"`                   // 26257
	SSLMode      string    `json:"ssl_mode" db:"ssl_mode"`           // disable (insecure mode)
	URL          string    `json:"url" db:"url"`                     // full connection string
	URLStaging   string    `json:"url_staging" db:"url_staging"`     // staging connection (same for now)
	CreatedAt    time.Time `json:"created_at" db:"created_at"`
}

// DatabaseConfig holds database provisioning configuration.
type DatabaseConfig struct {
	// Host is the CockroachDB host for provisioning operations
	Host string
	// Port is the CockroachDB port
	Port int
	// User is the admin user for provisioning (typically "root" in insecure mode)
	User string
	// SSLMode is the SSL mode (typically "disable" for insecure mode)
	SSLMode string
}
