package entity

import "time"

// Company represents a Tenant in the system.
type Company struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Document  *string   `json:"document,omitempty"` // CNPJ, EIN, VAT
	Contact   *string   `json:"contact,omitempty"`
	Status    string    `json:"status"` // "ACTIVE", "INACTIVE"
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

// NewCompany creates a new Company instance with defaults.
func NewCompany(id, name string, document, contact *string) *Company {
	return &Company{
		ID:        id,
		Name:      name,
		Document:  document,
		Contact:   contact,
		Status:    "ACTIVE",
		CreatedAt: time.Now(),
		UpdatedAt: time.Now(),
	}
}

func (c *Company) Activate() {
	c.Status = "ACTIVE"
	c.UpdatedAt = time.Now()
}

func (c *Company) Deactivate() {
	c.Status = "INACTIVE"
	c.UpdatedAt = time.Now()
}
