package models

import "time"

type AstrologerProfessional struct {
	ID uint `gorm:"primaryKey" json:"id"`

	AstrologerID uint `gorm:"column:astrologer_id;not null;index" json:"astrologer_id"`

	Occupation string `gorm:"column:occupation;type:varchar(150);not null" json:"occupation"`

	EmploymentType string `gorm:"column:employment_type;type:varchar(100)" json:"employment_type"`

	CurrentCompany string `gorm:"column:current_company;type:varchar(255)" json:"current_company"`

	ConsultationMode string `gorm:"column:consultation_mode;type:varchar(100)" json:"consultation_mode"`

	JoiningDate *time.Time `gorm:"column:joining_date" json:"joining_date"`

	// Decimal years. The column is a DECIMAL(4,1) as of
	// migrations/2026_09_07_astrologer_professional_experience_decimal.sql; it
	// was an INT, which rounded 2.5 to 3 on the way in.
	ExperienceYears float64 `gorm:"column:experience_years;type:decimal(4,1);default:0" json:"experience_years"`

	ExperienceCertificate string `gorm:"column:experience_certificate;type:varchar(255)" json:"experience_certificate"`

	Status string `gorm:"column:status;type:enum('PENDING','APPROVED','REJECTED');default:'PENDING'" json:"status"`

	StartYear int `gorm:"column:start_year" json:"start_year"`

	EndYear int `gorm:"column:end_year" json:"end_year"`

	CurrentlyWorking bool `gorm:"column:currently_working" json:"currently_working"`

	CreatedAt *time.Time `gorm:"column:created_at;autoCreateTime" json:"created_at"`

	UpdatedAt *time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updated_at"`

	// Relationship
	Astrologer Astrologer `gorm:"foreignKey:AstrologerID;references:ID" json:"-"`
}

func (AstrologerProfessional) TableName() string {

	return "astrologer_professionals"

}
