package models

import "time"

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

	UserID uint `gorm:"column:user_id" json:"user_id"`

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

	CurrentStep int `gorm:"column:current_step;default:1" json:"current_step"`

	CompletionPercentage int `gorm:"column:completion_percentage;default:0" json:"completion_percentage"`

	ProfileCompleted bool `gorm:"column:profile_completed;default:false" json:"profile_completed"`

	Submitted bool `gorm:"column:submitted;default:false" json:"submitted"`

	SubmittedAt *time.Time `gorm:"column:submitted_at" json:"submitted_at,omitempty"`

	AdminStatus string `gorm:"column:admin_status;type:enum('IN_PROGRESS','NOT_SUBMITTED','PENDING','UNDER_REVIEW','ROUND1','ROUND2','APPROVED','REJECTED','INTERVIEW_ROUND_1','INTERVIEW_ROUND_2','DOCUMENTS_VERIFIED','SUBMITTED','BLOCKED');default:'NOT_SUBMITTED'" json:"admin_status"`

	ApprovedAt *time.Time `gorm:"column:approved_at" json:"approved_at,omitempty"`

	RejectedAt *time.Time `gorm:"column:rejected_at" json:"rejected_at,omitempty"`

	Remarks string `gorm:"column:remarks;type:text" json:"remarks"`

	IsCompleted bool `gorm:"column:is_completed;default:false" json:"is_completed"`

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

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

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

func (AstrologerProfileProgress) TableName() string {

	return "astrologer_profile_progress"

}
