remove ids fk
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
type Basic struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Specialist_Id *uint16 `json:"specialist_id" gorm:"not null"`
|
||||
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
|
||||
Code string `json:"code" gorm:"unique;size:10;not null"`
|
||||
Name string `json:"name" gorm:"size:30;not null"`
|
||||
|
||||
@@ -7,5 +7,5 @@ import (
|
||||
|
||||
type SpecialistPosition struct {
|
||||
esb.Basic
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
}
|
||||
|
||||
@@ -11,9 +11,8 @@ type Specialist struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
Unit_Code *string `json:"unit_code" gorm:"size:10"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Id"`
|
||||
SpecialistPositions []eub.Basic `json:"specialistPositions,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"`
|
||||
Subspecialists []essb.Basic `json:"subspecialists,omitempty" gorm:"foreignKey:Specialist_Id;references:Id"`
|
||||
Unit *eu.Unit `json:"unit,omitempty" gorm:"foreignKey:Unit_Code;references:Code"`
|
||||
SpecialistPositions []eub.Basic `json:"specialistPositions,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
Subspecialists []essb.Basic `json:"subspecialists,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
type Basic struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Subspecialist_Id *uint16 `json:"subspecialist_id" gorm:"not null"`
|
||||
Subspecialist_Code *string `json:"subspecialist_code" gorm:"size:10"`
|
||||
Code string `json:"code" gorm:"unique;size:10;not null"`
|
||||
Name string `json:"name" gorm:"size:30;not null"`
|
||||
|
||||
@@ -7,5 +7,5 @@ import (
|
||||
|
||||
type SubspecialistPosition struct {
|
||||
esb.Basic
|
||||
Subspecialist *es.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Id;references:Id"`
|
||||
Subspecialist *es.Subspecialist `json:"subspecialist,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ type Basic struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Specialist_Code *string `json:"specialist_code" gorm:"size:10"`
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Specialist_Id *uint16 `json:"specialist_id"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
@@ -20,10 +20,10 @@ type ReadListDto struct {
|
||||
}
|
||||
|
||||
type FilterDto struct {
|
||||
Code *string `json:"code"`
|
||||
Name *string `json:"name"`
|
||||
Specialist_Id *uint16 `json:"specialist-id"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
Code *string `json:"code"`
|
||||
Name *string `json:"name"`
|
||||
Specialist_Code *string `json:"specialist-code"`
|
||||
Search string `json:"search" gormhelper:"searchColumns=Code,Name"`
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
@@ -52,7 +52,7 @@ type ResponseDto struct {
|
||||
ecore.SmallMain
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Specialist_Code *string `json:"specialist_ccode"`
|
||||
Specialist_Code *string `json:"specialist_code"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty"`
|
||||
Subspecialist []espb.Basic `json:"subspecialistPositions,omitempty"`
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ import (
|
||||
|
||||
type Subspecialist struct {
|
||||
esb.Basic
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Id"`
|
||||
SubspecialistPositions []espb.Basic `json:"subspecialistPositions,omitempty" gorm:"foreignKey:Subspecialist_Id;references:Id"`
|
||||
Specialist *es.Specialist `json:"specialist,omitempty" gorm:"foreignKey:Specialist_Code;references:Code"`
|
||||
SubspecialistPositions []espb.Basic `json:"subspecialistPositions,omitempty" gorm:"foreignKey:Subspecialist_Code;references:Code"`
|
||||
}
|
||||
|
||||
@@ -19,5 +19,5 @@ func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.Subspecialist) {
|
||||
|
||||
data.Code = inputSrc.Code
|
||||
data.Name = inputSrc.Name
|
||||
data.Specialist_Id = inputSrc.Specialist_Id
|
||||
data.Specialist_Code = inputSrc.Specialist_Code
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user