2025-08-09 18:58:22 +07:00
|
|
|
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"`
|
2025-08-15 21:17:19 +07:00
|
|
|
|
|
|
|
|
// Relationships
|
|
|
|
|
FromDepartment Department `gorm:"foreignKey:FromDepartmentID;references:ID" json:"from_department,omitempty"`
|
|
|
|
|
ToDepartment Department `gorm:"foreignKey:ToDepartmentID;references:ID" json:"to_department,omitempty"`
|
2025-08-09 18:58:22 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (DispositionRoute) TableName() string { return "disposition_routes" }
|