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

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

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

	data.Name = inputSrc.Name
	data.FrontTitle = inputSrc.FrontTitle
	data.EndTitle = inputSrc.EndTitle
	data.BirthDate = inputSrc.BirthDate
	data.BirthRegency_Code = inputSrc.BirthRegency_Code
	data.Gender_Code = inputSrc.Gender_Code
	data.ResidentIdentityNumber = inputSrc.ResidentIdentityNumber
	data.DrivingLicenseNumber = inputSrc.DrivingLicenseNumber
	data.PassportNumber = inputSrc.PassportNumber
	data.Religion_Code = inputSrc.Religion_Code
	data.Education_Code = inputSrc.Education_Code
	data.Ocupation_Code = inputSrc.Ocupation_Code
	data.Ocupation_Name = inputSrc.Ocupation_Name
	data.MaritalStatus_Code = inputSrc.MaritalStatus_Code
	data.Confidence = inputSrc.Confidence
	data.Nationality = inputSrc.Nationality
	data.Ethnic_Code = inputSrc.Ethnic_Code
	data.Language_Code = inputSrc.Language_Code
	data.CommunicationIssueStatus = inputSrc.CommunicationIssueStatus
	data.Disability = inputSrc.Disability
}
