Merge branch 'migration-vanilia' of https://github.com/dikstub-rssa/simrs-be into feat/functional-position-100

This commit is contained in:
vanilia
2025-10-24 15:42:10 +07:00
3 changed files with 11 additions and 11 deletions

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
h1:XE6wCH2XnIm3XpP9itgkMFv8CCrc2SOb51W/bA5h3Uk= h1:ieMeKh35/dro1YBBO11ZP0nZan9aJ5aFSqnEAi+T+WQ=
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
@@ -57,4 +57,4 @@ h1:XE6wCH2XnIm3XpP9itgkMFv8CCrc2SOb51W/bA5h3Uk=
20251021075552.sql h1:8gfSMAglflNO6L0sSzxFNEubYN8/O4thT7OQT+WH+3M= 20251021075552.sql h1:8gfSMAglflNO6L0sSzxFNEubYN8/O4thT7OQT+WH+3M=
20251023044432.sql h1:MkvajJs3bfk9+wHvQ43/ccAluJEBARm1gWr1u92ccLA= 20251023044432.sql h1:MkvajJs3bfk9+wHvQ43/ccAluJEBARm1gWr1u92ccLA=
20251024034832.sql h1:x3s3VEVYLOSKLAFxJGb2+c1FyTMMvPE+9k4Ew7rKQaI= 20251024034832.sql h1:x3s3VEVYLOSKLAFxJGb2+c1FyTMMvPE+9k4Ew7rKQaI=
20251024074315.sql h1:GkocUmXpU1QiZpjvELK4e6sKASxiS3kZTk+35Iux2ds= 20251024074315.sql h1:EjAjelgi5qAfcRq/8vPTlGGYHvAKxNTllm8f0SzZDns=
@@ -2,15 +2,17 @@ package base
import ( import (
ecore "simrs-vx/internal/domain/base-entities/core" ecore "simrs-vx/internal/domain/base-entities/core"
ee "simrs-vx/internal/domain/main-entities/employee"
) )
type Basic struct { type Basic struct {
ecore.SmallMain // adjust this according to the needs ecore.SmallMain // adjust this according to the needs
Unit_Id *uint16 `json:"unit_id" gorm:"not null"` Unit_Id *uint16 `json:"unit_id" gorm:"not null"`
Code string `json:"code" gorm:"unique;size:10;not null"` Code string `json:"code" gorm:"unique;size:10;not null"`
Name string `json:"name" gorm:"size:30;not null"` Name string `json:"name" gorm:"size:30;not null"`
HeadStatus bool `json:"headStatus"` HeadStatus bool `json:"headStatus"`
Employee_Id *uint `json:"employee_id"` Employee_Id *uint `json:"employee_id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
} }
func (Basic) TableName() string { func (Basic) TableName() string {
@@ -1,13 +1,11 @@
package unit_position package unit_position
import ( import (
ee "simrs-vx/internal/domain/main-entities/employee"
eu "simrs-vx/internal/domain/main-entities/unit" eu "simrs-vx/internal/domain/main-entities/unit"
eub "simrs-vx/internal/domain/main-entities/unit-position/base" eub "simrs-vx/internal/domain/main-entities/unit-position/base"
) )
type UnitPosition struct { type UnitPosition struct {
eub.Basic eub.Basic
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"` Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id;references:Id"`
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
} }