package models

import (
	"time"

	"gorm.io/gorm"
)

type Client struct {
	ID           string         `json:"id" gorm:"primaryKey"`            // Unique identifier
	Name         string         `json:"name" gorm:"not null"`            // Client name
	ContactEmail string         `json:"contactEmail" gorm:"index"`       // Client contact email
	ContactPhone string         `json:"contactPhone,omitempty"`          // Optional contact phone
	Organization string         `json:"organization"`                    // Client organization name
	Plan         PlanType       `json:"plan" gorm:"default:'basic'"`     // Client plan type (basic, pro, enterprise)
	CreatedAt    time.Time      `json:"createdAt" gorm:"autoCreateTime"` // Creation timestamp
	UpdatedAt    time.Time      `json:"updatedAt" gorm:"autoUpdateTime"` // Last update timestamp
	DeletedAt    gorm.DeletedAt `json:"deletedAt" gorm:"index"`          // Soft delete support

	// GORM relationships
	Deployments []Deployment `json:"deployments" gorm:"foreignKey:ClientID"` // Deployments belonging to this client
}

// PlanType represents the type of plan a client can have
type PlanType string

const (
	Basic      PlanType = "basic"      // Basic plan
	Pro        PlanType = "pro"        // Pro plan
	Enterprise PlanType = "enterprise" // Enterprise plan
)
