package models

import (
	"time"

	"github.com/google/uuid"
)

// Experience model structure
// Represents a resume experience entry.
type Experience struct {
	ID           uuid.UUID  `gorm:"type:uuid;default:gen_random_uuid();primaryKey" json:"id"`
	BetweenYears string     `gorm:"type:varchar(50);not null" json:"between_years"`
	Title        string     `gorm:"type:varchar(100);not null" json:"title"`
	Content      string     `gorm:"type:varchar(150);not null" json:"content"`
	ResumeID     *uuid.UUID `gorm:"type:uuid" json:"resume_id,omitempty"`
	IsActive     bool       `gorm:"default:false" json:"is_active"`
	CreatedAt    time.Time  `json:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at"`
}

// TableName overrides the table name used by Experience to `experience`
func (Experience) TableName() string {
	return "experience"
}
