// FES = From External Source
package userfes

import (
	ecore "simrs-vx/internal/domain/base-entities/core"
	eap "simrs-vx/internal/domain/main-entities/auth-partner"
	eau "simrs-vx/internal/domain/main-entities/user"
)

type UserFes struct {
	ecore.Main                        // adjust this according to the needs
	Name             string           `json:"name" gorm:"size:100;uniqueIndex:idx-userFes-name-authPartner_code"`
	AuthPartner_Code string           `json:"authPartner_code" gorm:"size:50;uniqueIndex:idx-userFes-name-authPartner_code"`
	AuthPartner      *eap.AuthPartner `json:"authPartner,omitempty" gorm:"foreignKey:AuthPartner_Code;references:Code"`
	// Even tried this one, still failed to preload
	// AuthPartner_Id uint16           `json:"authPartner_id"`
	// AuthPartner    *eap.AuthPartner `json:"authPartner,omitempty" gorm:"foreignKey:AuthPartner_Id;references:Id"`
	User_Name string    `json:"user_name" gorm:"size:50"`
	User      *eau.User `json:"user,omitempty" gorm:"foreignKey:User_Name;references:Name"`
}
