package division

import (
	ecore "simrs-vx/internal/domain/base-entities/core"
	edpb "simrs-vx/internal/domain/main-entities/division-position/base"
)

type Division struct {
	ecore.SmallMain                // adjust this according to the needs
	Code              string       `json:"code" gorm:"uniqueIndex;size:10"`
	Name              string       `json:"name" gorm:"size:50"`
	Parent_Code       *string      `json:"parent_code" gorm:"size:10"`
	Parent            *Division    `json:"parent" gorm:"foreignKey:Parent_Code;references:Code"`
	Childrens         []Division   `json:"childrens" gorm:"foreignKey:Parent_Code;references:Code"` // may need references to self
	DivisionPositions []edpb.Basic `json:"divisionPositions,omitempty" gorm:"foreignKey:Division_Code;references:Code"`
}
