/*
DESCRIPTION:
Any functions that are used internally by the use-case
*/
package personrelative

import (
	e "simrs-vx/internal/domain/main-entities/person-relative"
)

func setData[T *e.CreateDto | *e.UpdateDto](input T, data *e.PersonRelative) {
	var inputSrc *e.CreateDto
	if inputT, ok := any(input).(*e.CreateDto); ok {
		inputSrc = inputT
	} else {
		inputTemp := any(input).(*e.UpdateDto)
		inputSrc = &inputTemp.CreateDto
	}

	data.Person_Id = inputSrc.Person_Id
	data.Relationship_Code = inputSrc.Relationship_Code
	data.Name = inputSrc.Name
	data.Address = inputSrc.Address
	data.Village_Code = inputSrc.Village_Code
	data.Gender_Code = inputSrc.Gender_Code
	data.PhoneNumber = inputSrc.PhoneNumber
	data.Education_Code = inputSrc.Education_Code
	data.Occupation_Code = inputSrc.Occupation_Code
	data.Occupation_Name = inputSrc.Occupation_Name
	data.Responsible = inputSrc.Responsible
}
