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

No files matched your search

+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"`