package entities

import (
	"time"

	"github.com/google/uuid"
)

type DispositionRoute struct {
	ID               uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
	FromDepartmentID uuid.UUID `gorm:"type:uuid;not null" json:"from_department_id"`
	ToDepartmentID   uuid.UUID `gorm:"type:uuid;not null" json:"to_department_id"`
	IsActive         bool      `gorm:"not null;default:true" json:"is_active"`
	AllowedActions   JSONB     `gorm:"type:jsonb" json:"allowed_actions,omitempty"`
	CreatedAt        time.Time `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt        time.Time `gorm:"autoUpdateTime" json:"updated_at"`

	// Relationships
	FromDepartment Department `gorm:"foreignKey:FromDepartmentID;references:ID" json:"from_department,omitempty"`
	ToDepartment   Department `gorm:"foreignKey:ToDepartmentID;references:ID" json:"to_department,omitempty"`
}

func (DispositionRoute) TableName() string { return "disposition_routes" }
