add coms, and disabillty column into person

This commit is contained in:
dpurbosakti
2025-10-06 11:57:31 +07:00
parent c262947d3f
commit 7966cd11e1
3 changed files with 33 additions and 28 deletions
@@ -0,0 +1,2 @@
-- Modify "Person" table
ALTER TABLE "public"."Person" ADD COLUMN "CommunicationIssueStatus" boolean NULL, ADD COLUMN "Disabillity" character varying(100) NULL;
+3 -2
View File
@@ -1,4 +1,4 @@
h1:cZd+VVhnt5FF4se9KNDa0hoFlY3AMn3nN7apKGwyPf4=
h1:JsKC89Hpwk3JTQjwLwPRlSPOwsFDWgb5NZ1roR6HyL4=
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
@@ -24,4 +24,5 @@ h1:cZd+VVhnt5FF4se9KNDa0hoFlY3AMn3nN7apKGwyPf4=
20251002085604.sql h1:3xZ68eYp4urXRnvotNH1XvG2mYOSDV/j3zHEZ/txg5E=
20251003032030.sql h1:HB+mQ2lXMNomHDpaRhB/9IwYI9/YiDO5eOJ+nAQH/jw=
20251005060450.sql h1:LbtCE2b+8osM3CvnmQJH1uCPtn+d7WchsslBOz8bL3Q=
20251006041122.sql h1:XQh6G6ZbkpiKXpMy6xe1pJRD+vvyQ1IEw+1JOIRU7Cg=
20251006041122.sql h1:MlS7f21z06sutnf9dIekt5fuHJr4lgcQ4uCuCXAGsfc=
20251006045658.sql h1:Frqb7wni/OVZT3jVYOE4ff/3MmWccWJJj4yMxvWUHbs=
+28 -26
View File
@@ -13,32 +13,34 @@ import (
)
type Person struct {
ecore.Main // adjust this according to the needs
Name string `json:"name" gorm:"not null;size:150"`
FrontTitle *string `json:"frontTitle" gorm:"size:50"`
EndTitle *string `json:"endTitle" gorm:"size:50"`
BirthDate *time.Time `json:"birthDate,omitempty"`
BirthRegency_Code *string `json:"birthRegency_code" gorm:"size:4"`
Gender_Code *erp.GenderCode `json:"gender_code" gorm:"size:10"`
ResidentIdentityNumber *string `json:"residentIdentityNumber" gorm:"unique;size:16"`
PassportNumber *string `json:"passportNumber" gorm:"unique;size:20"`
DrivingLicenseNumber *string `json:"drivingLicenseNumber" gorm:"unique;size:20"`
Religion_Code *erp.ReligionCode `json:"religion_code" gorm:"size:10"`
Education_Code *erp.EducationCode `json:"education_code" gorm:"size:10"`
Ocupation_Code *erp.OcupationCode `json:"occupation_code" gorm:"size:15"`
Ocupation_Name *string `json:"occupation_name" gorm:"size:50"`
Nationality *string `json:"nationality": gorm:"size:50"`
Ethnic_Code *string `json:"ethnic_code" gorm:"size:20"`
Ethnic *ee.Ethnic `json:"ethnic,omitempty" gorm:"foreignKey:Ethnic_Code;references:Code"`
Addresses *[]epa.PersonAddress `json:"addresses" gorm:"foreignKey:Person_Id"`
Contacts *[]epc.PersonContact `json:"contacts" gorm:"foreignKey:Person_Id"`
Relatives *[]epr.PersonRelative `json:"relatives" gorm:"foreignKey:Person_Id"`
Language_Code *string `json:"language_code" gorm:"size:10"`
Language *el.Language `json:"language,omitempty" gorm:"foreignKey:Language_Code;references:Code"`
ResidentIdentityFileUrl *string `json:"residentIdentityFileUrl" gorm:"size:1024"`
PassportFileUrl *string `json:"passportFileUrl" gorm:"size:1024"`
DrivingLicenseFileUrl *string `json:"drivingLicenseFileUrl" gorm:"size:1024"`
FamilyIdentityFileUrl *string `json:"familyIdentityFileUrl" gorm:"size:1024"`
ecore.Main // adjust this according to the needs
Name string `json:"name" gorm:"not null;size:150"`
FrontTitle *string `json:"frontTitle" gorm:"size:50"`
EndTitle *string `json:"endTitle" gorm:"size:50"`
BirthDate *time.Time `json:"birthDate,omitempty"`
BirthRegency_Code *string `json:"birthRegency_code" gorm:"size:4"`
Gender_Code *erp.GenderCode `json:"gender_code" gorm:"size:10"`
ResidentIdentityNumber *string `json:"residentIdentityNumber" gorm:"unique;size:16"`
PassportNumber *string `json:"passportNumber" gorm:"unique;size:20"`
DrivingLicenseNumber *string `json:"drivingLicenseNumber" gorm:"unique;size:20"`
Religion_Code *erp.ReligionCode `json:"religion_code" gorm:"size:10"`
Education_Code *erp.EducationCode `json:"education_code" gorm:"size:10"`
Ocupation_Code *erp.OcupationCode `json:"occupation_code" gorm:"size:15"`
Ocupation_Name *string `json:"occupation_name" gorm:"size:50"`
Nationality *string `json:"nationality": gorm:"size:50"`
Ethnic_Code *string `json:"ethnic_code" gorm:"size:20"`
Ethnic *ee.Ethnic `json:"ethnic,omitempty" gorm:"foreignKey:Ethnic_Code;references:Code"`
Addresses *[]epa.PersonAddress `json:"addresses" gorm:"foreignKey:Person_Id"`
Contacts *[]epc.PersonContact `json:"contacts" gorm:"foreignKey:Person_Id"`
Relatives *[]epr.PersonRelative `json:"relatives" gorm:"foreignKey:Person_Id"`
Language_Code *string `json:"language_code" gorm:"size:10"`
Language *el.Language `json:"language,omitempty" gorm:"foreignKey:Language_Code;references:Code"`
CommunicationIssueStatus bool `json:"communicationIssueStatus"`
Disabillity *string `json:"disabillity" gorm:"size:100"`
ResidentIdentityFileUrl *string `json:"residentIdentityFileUrl" gorm:"size:1024"`
PassportFileUrl *string `json:"passportFileUrl" gorm:"size:1024"`
DrivingLicenseFileUrl *string `json:"drivingLicenseFileUrl" gorm:"size:1024"`
FamilyIdentityFileUrl *string `json:"familyIdentityFileUrl" gorm:"size:1024"`
}
func (d Person) IsSameResidentIdentityNumber(input *string) bool {