migration: adjust person entity

This commit is contained in:
2025-12-09 14:02:30 +07:00
parent 4e392f1162
commit 143b873c11
4 changed files with 27 additions and 10 deletions
@@ -0,0 +1,2 @@
-- Modify "Person" table
ALTER TABLE "public"."Person" ADD COLUMN "BirthPlace" text NULL;
+14 -2
View File
@@ -1,4 +1,4 @@
h1:JGe2DnXv3QZTmdne3HWeAGA4rppck8cJaiZ0RgoM+Sg=
h1:YJzcjq4dKD7GKlV0GJ88TOtZgg0JRDcVMlAe5ZYT9/U=
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
@@ -145,4 +145,16 @@ h1:JGe2DnXv3QZTmdne3HWeAGA4rppck8cJaiZ0RgoM+Sg=
20251202180207.sql h1:IHmSMIO3ia+YV5GULixbdlV1joaUAWtnjQHPd8+HKiM=
20251202231005.sql h1:lua0KKoeBptSfs/6ehZE6Azo6YUlNkOJwGFyb1HQWkY=
20251203205052.sql h1:nk0VK2Uv4bHE3SBfHo/aevVZxtHzr7zAzvmMU8TCCtk=
20251209064304.sql h1:/vp48I71991yaVsOw/g+eFsFydgLGEo+Xfen7Lp8WB4=
20251205073858.sql h1:46qqXnArgJmzGE/WO7v7Ev8Jh7BudDiGbdANexq/5Dk=
20251205211957.sql h1:3fvtZ/mBWsTIXllXMFOuCLJsp4MivVP56dunehlU0yo=
20251205214433.sql h1:rn3++FEfX7ntcJcOmCEuOMnr27TZqH0KMGRppzFwFTc=
20251205221124.sql h1:CRruUvGZqlVDBmbQSVEl4wFm+uq30AurMMDI6sb8jxg=
20251206021053.sql h1:bpuEocu4lOhZ7oLuxd//22dzjfNgU2iaWEqSD1mVwoU=
20251207020537.sql h1:m6uh4NHVF3EKNTVMqOmuBSDFD9oCQk5mAwo05fT46G4=
20251207212015.sql h1:UPelYGTeUR6rm8mU8dfNzgRDEDun0UQ4tkgsaDljn30=
20251207221222.sql h1:bTfUCvCf2UPh+BA2IY2PHQafb9DwY9nhH5FRuMEHy+0=
20251209022744.sql h1:y5/PAiZH/fYCpDJpkQdNRJwWICHH2iNIwM1V+S1P6KA=
20251209025908.sql h1:p3kZA8kyEj+mQZSrdY3k2K1NojQzFJh/MlZJ0Oy6t/k=
20251209030538.sql h1:zltV6/Fu2zJW0/lVBl7MdnWuJcqNTUIRcqYYZ8Fi1wo=
20251209064304.sql h1:Mj6Zh+2b/4AkM1HjnJGjAs788kVN0UaL34jeaKQIjT0=
20251209070128.sql h1:rdqSlAmJS5XSc1w9dka3C53zwgibQwRIUqBcgmIPoTM=
+10 -8
View File
@@ -19,6 +19,7 @@ type CreateDto struct {
FrontTitle *string `json:"frontTitle" validate:"maxLength=50"`
EndTitle *string `json:"endTitle" validate:"maxLength=50"`
BirthDate *time.Time `json:"birthDate,omitempty"`
BirthPlace *string `json:"birthPlace" validate:"maxLength=4"`
BirthRegency_Code *string `json:"birthRegency_code" validate:"maxLength=4"`
Gender_Code *erp.GenderCode `json:"gender_code"`
ResidentIdentityNumber *string `json:"residentIdentityNumber" validate:"nik;maxLength=16"`
@@ -46,14 +47,13 @@ type ReadListDto struct {
type FilterDto struct {
Name string `json:"name"`
FrontTitle *string `json:"frontTitle"`
EndTitle *string `json:"endTitle"`
BirthDate *time.Time `json:"birthDate,omitempty"`
BirthRegency_Code *string `json:"birthRegency-code"`
FrontTitle *string `json:"front-title"`
EndTitle *string `json:"end-title"`
BirthDate *time.Time `json:"birth-date,omitempty"`
Gender_Code *erp.GenderCode `json:"gender-code"`
ResidentIdentityNumber *string `json:"residentIdentityNumber"`
PassportNumber *string `json:"passportNumber"`
DrivingLicenseNumber *string `json:"drivingLicenseNumber"`
ResidentIdentityNumber *string `json:"resident-identity-number"`
PassportNumber *string `json:"passport-number"`
DrivingLicenseNumber *string `json:"driving-license-number"`
Religion_Code *erp.ReligionCode `json:"religion-code"`
Education_Code *erp.EducationCode `json:"education-code"`
Ocupation_Code *erp.OcupationCode `json:"occupation-code"`
@@ -61,7 +61,7 @@ type FilterDto struct {
Nationality *string `json:"nationality"`
Ethnic_Code *string `json:"ethnic-code"`
Language_Code *string `json:"language-code"`
CommunicationIssueStatus bool `json:"communicationIssueStatus"`
CommunicationIssueStatus bool `json:"communication-issue-status"`
Disability *string `json:"disability"`
}
@@ -94,6 +94,7 @@ type ResponseDto struct {
FrontTitle *string `json:"frontTitle"`
EndTitle *string `json:"endTitle"`
BirthDate *time.Time `json:"birthDate,omitempty"`
BirthPlace *string `json:"birthPlace"`
BirthRegency_Code *string `json:"birthRegency_code"`
BirthRegency *er.Regency `json:"birthRegency,omitempty"`
Gender_Code *erp.GenderCode `json:"gender_code"`
@@ -128,6 +129,7 @@ func (d *Person) ToResponse() ResponseDto {
FrontTitle: d.FrontTitle,
EndTitle: d.EndTitle,
BirthDate: d.BirthDate,
BirthPlace: d.BirthPlace,
BirthRegency_Code: d.BirthRegency_Code,
BirthRegency: d.BirthRegency,
Gender_Code: d.Gender_Code,
@@ -23,6 +23,7 @@ type Person struct {
FrontTitle *string `json:"frontTitle" gorm:"size:50"`
EndTitle *string `json:"endTitle" gorm:"size:50"`
BirthDate *time.Time `json:"birthDate,omitempty"`
BirthPlace *string `json:"birthPlace,omitempty"`
BirthRegency_Code *string `json:"birthRegency_code" gorm:"size:4"`
BirthRegency *er.Regency `json:"birthRegency,omitempty" gorm:"foreignKey:BirthRegency_Code;references:Code"`
Gender_Code *erp.GenderCode `json:"gender_code" gorm:"size:10"`