add employee id into division-position

This commit is contained in:
dpurbosakti
2025-10-06 11:12:00 +07:00
parent 0c2ad54b58
commit c262947d3f
4 changed files with 9 additions and 2 deletions

No files matched your search

@@ -9,6 +9,7 @@ type CreateDto struct {
Division_Id *uint16 `json:"division_id"`
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Employee_Id *uint `json:"employee_id"`
}
type ReadListDto struct {
@@ -3,6 +3,7 @@ package divisionposition
import (
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/division"
ee "simrs-vx/internal/domain/main-entities/employee"
)
type DivisionPosition struct {
@@ -11,4 +12,6 @@ type DivisionPosition struct {
Division *ed.Division `json:"division" gorm:"foreignKey:Division_Id"`
Code string `json:"code" gorm:"unique;size:10"`
Name string `json:"name" gorm:"size:50"`
Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
}