package entity

import (
	"campaign-pool-be/app/database/entity/users"
	"time"
)

type WorkHistory struct {
	ID          uint         `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
	UserID      uint         `json:"user_id" gorm:"type:int4;not null;index"`
	JobTitle    string       `json:"job_title" gorm:"type:varchar;not null"`
	CompanyName string       `json:"company_name" gorm:"type:varchar;not null"`
	StartDate   time.Time    `json:"start_date" gorm:"not null"`
	EndDate     *time.Time   `json:"end_date"`
	CreatedAt   time.Time    `json:"created_at" gorm:"default:now()"`
	UpdatedAt   time.Time    `json:"updated_at" gorm:"default:now()"`
	User        *users.Users `json:"user" gorm:"foreignKey:UserID;references:ID"`
}
