package personaddress

import (
	ecore "simrs-vx/internal/domain/base-entities/core"
	epr "simrs-vx/internal/domain/main-entities/postal-region"
	ev "simrs-vx/internal/domain/main-entities/village"

	erp "simrs-vx/internal/domain/references/person"
)

type PersonAddress struct {
	ecore.Main                                    // adjust this according to the needs
	Person_Id         uint                        `json:"person_id"`
	Address           string                      `json:"address" gorm:"size:150"`
	LocationType_Code erp.AddressLocationTypeCode `json:"locationType_code" gorm:"size:10"`
	Rt                string                      `json:"rt" gorm:"size:2"`
	Rw                string                      `json:"rw" gorm:"size:2"`
	PostalRegion_Code *string                     `json:"postalRegion_code" gorm:"size:6"`
	PostalRegion      *epr.PostalRegion           `json:"postalRegion,omitempty" gorm:"foreignKey:PostalRegion_Code;references:Code"`
	Village_Code      *string                     `json:"village_code" gorm:"size:10"`
	Village           *ev.Village                 `json:"village,omitempty" gorm:"foreignKey:Village_Code;references:Code"`
}
