add several columns for file url person
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
-- Modify "Person" table
|
||||||
|
ALTER TABLE "public"."Person" ADD COLUMN "ResidentIdentityFileUrl" character varying(1024) NULL, ADD COLUMN "PassportFileUrl" character varying(1024) NULL, ADD COLUMN "DrivingLicenseFileUrl" character varying(1024) NULL, ADD COLUMN "FamilyIdentityFileUrl" character varying(1024) NULL;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
h1:0Hvo3AS2yMsS60eDIKnU5B2qvjDhNWHSDHcMxKKYJTk=
|
h1:n2YbCQPYchOWsVSLUNPCl29Xx3RMTi7vdulwPRHXL4E=
|
||||||
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
||||||
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
||||||
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
||||||
@@ -15,4 +15,5 @@ h1:0Hvo3AS2yMsS60eDIKnU5B2qvjDhNWHSDHcMxKKYJTk=
|
|||||||
20250918073552.sql h1:RJ1SvMzP6aeWnoPVD3eVAmIQOkcp6Php8z3QRri6v4g=
|
20250918073552.sql h1:RJ1SvMzP6aeWnoPVD3eVAmIQOkcp6Php8z3QRri6v4g=
|
||||||
20250918073742.sql h1:+cEsnJTJFybe2fR69ZoOiX2R6c6iITl4m6WTZ1hjyzY=
|
20250918073742.sql h1:+cEsnJTJFybe2fR69ZoOiX2R6c6iITl4m6WTZ1hjyzY=
|
||||||
20250918074745.sql h1:2hNVQCXF/dVYXAh+T/7oBFgERGWxzVb2FXJjwkFWGCI=
|
20250918074745.sql h1:2hNVQCXF/dVYXAh+T/7oBFgERGWxzVb2FXJjwkFWGCI=
|
||||||
20250923025134.sql h1:q1bndJguAqjnTjXr6Jpnsrj4d8zMseR2tf02h0h6ArE=
|
20250923025134.sql h1:Ykz/qpHiGDXPsCsWTjydQFVSibZP2D+h2fIeb2h2JGA=
|
||||||
|
20250924051317.sql h1:vbbuylW434V23raIl6Y6Ima6aZVItLrdIpk+xehVsJc=
|
||||||
|
|||||||
@@ -81,48 +81,56 @@ type MetaDto struct {
|
|||||||
|
|
||||||
type ResponseDto struct {
|
type ResponseDto struct {
|
||||||
ecore.Main
|
ecore.Main
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
FrontTitle *string `json:"frontTitle"`
|
FrontTitle *string `json:"frontTitle"`
|
||||||
EndTitle *string `json:"endTitle"`
|
EndTitle *string `json:"endTitle"`
|
||||||
BirthDate *time.Time `json:"birthDate,omitempty"`
|
BirthDate *time.Time `json:"birthDate,omitempty"`
|
||||||
BirthRegency_Code *string `json:"birthRegency_code"`
|
BirthRegency_Code *string `json:"birthRegency_code"`
|
||||||
Gender_Code *erp.GenderCode `json:"gender_code"`
|
Gender_Code *erp.GenderCode `json:"gender_code"`
|
||||||
ResidentIdentityNumber *string `json:"residentIdentityNumber"`
|
ResidentIdentityNumber *string `json:"residentIdentityNumber"`
|
||||||
PassportNumber *string `json:"passportNumber"`
|
PassportNumber *string `json:"passportNumber"`
|
||||||
DrivingLicenseNumber *string `json:"drivingLicenseNumber"`
|
DrivingLicenseNumber *string `json:"drivingLicenseNumber"`
|
||||||
Religion_Code *erp.ReligionCode `json:"religion_code"`
|
Religion_Code *erp.ReligionCode `json:"religion_code"`
|
||||||
Education_Code *erp.EducationCode `json:"education_code"`
|
Education_Code *erp.EducationCode `json:"education_code"`
|
||||||
Ocupation_Code *erp.OcupationCode `json:"occupation_code"`
|
Ocupation_Code *erp.OcupationCode `json:"occupation_code"`
|
||||||
Ocupation_Name *string `json:"occupation_name"`
|
Ocupation_Name *string `json:"occupation_name"`
|
||||||
Ethnic_Code *string `json:"ethnic_code"`
|
Ethnic_Code *string `json:"ethnic_code"`
|
||||||
Ethnic *ee.Ethnic `json:"ethnic,omitempty"`
|
Ethnic *ee.Ethnic `json:"ethnic,omitempty"`
|
||||||
Addresses *[]epa.PersonAddress `json:"addresses,omitempty"`
|
Addresses *[]epa.PersonAddress `json:"addresses,omitempty"`
|
||||||
Contacts *[]epc.PersonContact `json:"contacts,omitempty"`
|
Contacts *[]epc.PersonContact `json:"contacts,omitempty"`
|
||||||
Relatives *[]epr.PersonRelative `json:"relatives,omitempty"`
|
Relatives *[]epr.PersonRelative `json:"relatives,omitempty"`
|
||||||
Language_Code *string `json:"language_code"`
|
Language_Code *string `json:"language_code"`
|
||||||
|
ResidentIdentityFileUrl *string `json:"residentIdentityFileUrl"`
|
||||||
|
PassportFileUrl *string `json:"passportFileUrl"`
|
||||||
|
DrivingLicenseFileUrl *string `json:"drivingLicenseFileUrl"`
|
||||||
|
FamilyIdentityFileUrl *string `json:"familyIdentityFileUrl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Person) ToResponse() ResponseDto {
|
func (d *Person) ToResponse() ResponseDto {
|
||||||
resp := ResponseDto{
|
resp := ResponseDto{
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
FrontTitle: d.FrontTitle,
|
FrontTitle: d.FrontTitle,
|
||||||
EndTitle: d.EndTitle,
|
EndTitle: d.EndTitle,
|
||||||
BirthDate: d.BirthDate,
|
BirthDate: d.BirthDate,
|
||||||
BirthRegency_Code: d.BirthRegency_Code,
|
BirthRegency_Code: d.BirthRegency_Code,
|
||||||
Gender_Code: d.Gender_Code,
|
Gender_Code: d.Gender_Code,
|
||||||
ResidentIdentityNumber: d.ResidentIdentityNumber,
|
ResidentIdentityNumber: d.ResidentIdentityNumber,
|
||||||
PassportNumber: d.PassportNumber,
|
PassportNumber: d.PassportNumber,
|
||||||
DrivingLicenseNumber: d.DrivingLicenseNumber,
|
DrivingLicenseNumber: d.DrivingLicenseNumber,
|
||||||
Religion_Code: d.Religion_Code,
|
Religion_Code: d.Religion_Code,
|
||||||
Education_Code: d.Education_Code,
|
Education_Code: d.Education_Code,
|
||||||
Ocupation_Code: d.Ocupation_Code,
|
Ocupation_Code: d.Ocupation_Code,
|
||||||
Ocupation_Name: d.Ocupation_Name,
|
Ocupation_Name: d.Ocupation_Name,
|
||||||
Ethnic_Code: d.Ethnic_Code,
|
Ethnic_Code: d.Ethnic_Code,
|
||||||
Ethnic: d.Ethnic,
|
Ethnic: d.Ethnic,
|
||||||
Addresses: d.Addresses,
|
Addresses: d.Addresses,
|
||||||
Contacts: d.Contacts,
|
Contacts: d.Contacts,
|
||||||
Relatives: d.Relatives,
|
Relatives: d.Relatives,
|
||||||
Language_Code: d.Language_Code,
|
Language_Code: d.Language_Code,
|
||||||
|
ResidentIdentityFileUrl: d.ResidentIdentityFileUrl,
|
||||||
|
PassportFileUrl: d.PassportFileUrl,
|
||||||
|
DrivingLicenseFileUrl: d.DrivingLicenseFileUrl,
|
||||||
|
FamilyIdentityFileUrl: d.FamilyIdentityFileUrl,
|
||||||
}
|
}
|
||||||
resp.Main = d.Main
|
resp.Main = d.Main
|
||||||
return resp
|
return resp
|
||||||
|
|||||||
@@ -13,27 +13,31 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Person struct {
|
type Person struct {
|
||||||
ecore.Main // adjust this according to the needs
|
ecore.Main // adjust this according to the needs
|
||||||
Name string `json:"name" gorm:"not null;size:150"`
|
Name string `json:"name" gorm:"not null;size:150"`
|
||||||
FrontTitle *string `json:"frontTitle" gorm:"size:50"`
|
FrontTitle *string `json:"frontTitle" gorm:"size:50"`
|
||||||
EndTitle *string `json:"endTitle" gorm:"size:50"`
|
EndTitle *string `json:"endTitle" gorm:"size:50"`
|
||||||
BirthDate *time.Time `json:"birthDate,omitempty"`
|
BirthDate *time.Time `json:"birthDate,omitempty"`
|
||||||
BirthRegency_Code *string `json:"birthRegency_code" gorm:"size:4"`
|
BirthRegency_Code *string `json:"birthRegency_code" gorm:"size:4"`
|
||||||
Gender_Code *erp.GenderCode `json:"gender_code" gorm:"size:10"`
|
Gender_Code *erp.GenderCode `json:"gender_code" gorm:"size:10"`
|
||||||
ResidentIdentityNumber *string `json:"residentIdentityNumber" gorm:"unique;size:16"`
|
ResidentIdentityNumber *string `json:"residentIdentityNumber" gorm:"unique;size:16"`
|
||||||
PassportNumber *string `json:"passportNumber" gorm:"unique;size:20"`
|
PassportNumber *string `json:"passportNumber" gorm:"unique;size:20"`
|
||||||
DrivingLicenseNumber *string `json:"drivingLicenseNumber" gorm:"unique;size:20"`
|
DrivingLicenseNumber *string `json:"drivingLicenseNumber" gorm:"unique;size:20"`
|
||||||
Religion_Code *erp.ReligionCode `json:"religion_code" gorm:"size:10"`
|
Religion_Code *erp.ReligionCode `json:"religion_code" gorm:"size:10"`
|
||||||
Education_Code *erp.EducationCode `json:"education_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_Code *erp.OcupationCode `json:"occupation_code" gorm:"size:15"`
|
||||||
Ocupation_Name *string `json:"occupation_name" gorm:"size:50"`
|
Ocupation_Name *string `json:"occupation_name" gorm:"size:50"`
|
||||||
Ethnic_Code *string `json:"ethnic_code" gorm:"size:20"`
|
Ethnic_Code *string `json:"ethnic_code" gorm:"size:20"`
|
||||||
Ethnic *ee.Ethnic `json:"ethnic,omitempty" gorm:"foreignKey:Ethnic_Code;references:Code"`
|
Ethnic *ee.Ethnic `json:"ethnic,omitempty" gorm:"foreignKey:Ethnic_Code;references:Code"`
|
||||||
Addresses *[]epa.PersonAddress `json:"addresses" gorm:"foreignKey:Person_Id"`
|
Addresses *[]epa.PersonAddress `json:"addresses" gorm:"foreignKey:Person_Id"`
|
||||||
Contacts *[]epc.PersonContact `json:"contacts" gorm:"foreignKey:Person_Id"`
|
Contacts *[]epc.PersonContact `json:"contacts" gorm:"foreignKey:Person_Id"`
|
||||||
Relatives *[]epr.PersonRelative `json:"relatives" gorm:"foreignKey:Person_Id"`
|
Relatives *[]epr.PersonRelative `json:"relatives" gorm:"foreignKey:Person_Id"`
|
||||||
Language_Code *string `json:"language_code" gorm:"size:10"`
|
Language_Code *string `json:"language_code" gorm:"size:10"`
|
||||||
Language *el.Language `json:"language,omitempty" gorm:"foreignKey:Language_Code;references:Code"`
|
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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d Person) IsSameResidentIdentityNumber(input *string) bool {
|
func (d Person) IsSameResidentIdentityNumber(input *string) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user