25 lines
739 B
Go
25 lines
739 B
Go
/*
|
|
DESCRIPTION:
|
|
Sample of a case-entity that utilized the base according to the needs. In this
|
|
sample, it imports the child entity, and uses it as an attribute. And by
|
|
separating this entity from the original entity, it avoids the circle dependency.
|
|
|
|
TODO:
|
|
replace 'parent' with the name of the package, ie: patient
|
|
replace 'Parent' with the name of the entity, ie: Patient
|
|
*/
|
|
package parent
|
|
|
|
import (
|
|
ec "simrs-vx/internal/domain/main-entities/child"
|
|
eb "simrs-vx/internal/domain/main-entities/parent/base"
|
|
// ec "simrs-vx/internal/domain/main-entities/child/minimal" // can use other case
|
|
)
|
|
|
|
type Parent struct {
|
|
Id int `json:"id"`
|
|
eb.Basic
|
|
eb.Default
|
|
Childs []ec.Child `json:"childs" gorm:"foreignKey:Parent_Id;references:Id"`
|
|
}
|