add validation on createDto
This commit is contained in:
@@ -8,9 +8,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Uom_Code string `json:"uom_code" validate:"maxLength=10"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
IndName string `json:"indName"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=2048"`
|
||||
IndName string `json:"indName" validate:"maxLength=2048"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Division_Id *uint16 `json:"division_id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
FeeType_Code *ero.DoctorFeeTypeCode `json:"feeType_code"`
|
||||
FeeType_Code *ero.DoctorFeeTypeCode `json:"feeType_code" validate:"maxLength=11"`
|
||||
Price *float64 `json:"price"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ type ReadListDto struct {
|
||||
|
||||
type FilterDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
SIP_Number *string `json:"sip_number"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
|
||||
Page int `json:"page"`
|
||||
|
||||
@@ -18,10 +18,10 @@ type CreateDto struct {
|
||||
Person *ep.UpdateDto `json:"person"`
|
||||
PersonAddresses []epa.UpdateDto `json:"personAddresses"`
|
||||
PersonContacts []epc.UpdateDto `json:"personContacts"`
|
||||
Position_Code ero.EmployeePosisitionCode `json:"position_code"`
|
||||
Position_Code ero.EmployeePosisitionCode `json:"position_code" validate:"maxLength=20"`
|
||||
Division_Code *string `json:"division_code"`
|
||||
Number *string `json:"number"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code"`
|
||||
Number *string `json:"number" validate:"maxLength=20"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code" validate:"maxLength=10"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
SIP_Number *string `json:"sip_number"`
|
||||
Unit_Id *uint `json:"unit_id"`
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" validate:"maxLength=10"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
EncounterClass_Code ere.EncounterClassCode `json:"encounterClass_code"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
EncounterClass_Code ere.EncounterClassCode `json:"encounterClass_code" validate:"maxLength=10"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -6,11 +6,11 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Regency_Code *string `json:"regency_code"`
|
||||
Address string `json:"address"`
|
||||
PhoneNumber string `json:"phoneNumber"`
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Regency_Code *string `json:"regency_code" validate:"maxLength=4"`
|
||||
Address string `json:"address" validate:"maxLength=100"`
|
||||
PhoneNumber string `json:"phoneNumber" validate:"maxLength=20"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
type CreateDto struct {
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Price float64 `json:"price"`
|
||||
InsuranceCompany_Code *string `json:"insuranceCompany_code"`
|
||||
InsuranceCompany_Code *string `json:"insuranceCompany_code" validate:"maxLength=20"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Code string `json:"code" validate:"maxLength=50"`
|
||||
Name string `json:"name" validate:"maxLength=100"`
|
||||
ItemGroup_Code ero.ItemGroupCode `json:"itemGroup_code" validate:"maxLength=10"`
|
||||
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Stock *int `json:"stock"`
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Uom_Code string `json:"uom_code"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Uom_Code string `json:"uom_code" validate:"maxLength=10"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Stock *int `json:"stock"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Scope_Code *ere.CheckupScopeCode `json:"scope_code"`
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Scope_Code *ere.CheckupScopeCode `json:"scope_code" validate:"maxLength=10"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
CheckupCategory_Code *string `json:"checkupCategory_code"`
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
CheckupCategory_Code *string `json:"checkupCategory_code" validate:"maxLength=20"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
Item_Id *uint `json:"item_id"`
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
MedicineGroup_Code *string `json:"medicineGroup_code"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code"`
|
||||
Uom_Code *string `json:"uom_code"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
MedicineGroup_Code *string `json:"medicineGroup_code" validate:"maxLength=10"`
|
||||
MedicineMethod_Code *string `json:"medicineMethod_code" validate:"maxLength=10"`
|
||||
Uom_Code *string `json:"uom_code" validate:"maxLength=10"`
|
||||
Dose uint8 `json:"dose"`
|
||||
Infra_Id *uint16 `json:"infra_id"`
|
||||
Stock *int `json:"stock"`
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
Unit_Id *uint16 `json:"unit_id"`
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -18,7 +18,7 @@ type CreateDto struct {
|
||||
PersonContacts []epc.UpdateDto `json:"personContacts"`
|
||||
PersonRelatives []epr.UpdateDto `json:"personRelatives"`
|
||||
RegisteredAt *time.Time `json:"registeredAt"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code"`
|
||||
Status_Code erc.ActiveStatusCode `json:"status_code" validate:"maxLength=10"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -6,10 +6,10 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Person_Id uint `json:"person_id"`
|
||||
Address string `json:"address"`
|
||||
Rt string `json:"rt"`
|
||||
Rw string `json:"rw"`
|
||||
Village_Code string `json:"village_code"`
|
||||
Address string `json:"address" validate:"maxLength=150"`
|
||||
Rt string `json:"rt" validate:"maxLength=2"`
|
||||
Rw string `json:"rw" validate:"maxLength=2"`
|
||||
Village_Code string `json:"village_code" validate:"maxLength=10"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Person_Id uint `json:"person_id"`
|
||||
Type_Code erp.ContactTypeCode `json:"type_code"`
|
||||
Value string `json:"value"`
|
||||
Type_Code erp.ContactTypeCode `json:"type_code" validate:"maxLength=15"`
|
||||
Value string `json:"value" validate:"maxLength=100"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -8,14 +8,14 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Person_Id uint `json:"person_id"`
|
||||
Relationship_Code erp.RelationshipCode `json:"relationship_code"`
|
||||
Name *string `json:"name"`
|
||||
Address *string `json:"address"`
|
||||
Village_Code *string `json:"village_code"`
|
||||
Gender_Code *erp.GenderCode `json:"gender_code"`
|
||||
PhoneNumber *string `json:"phoneNumber"`
|
||||
Education_Code *erp.EducationCode `json:"education_code"`
|
||||
Occupation_Code *erp.OcupationCode `json:"occupation_code"`
|
||||
Relationship_Code erp.RelationshipCode `json:"relationship_code" validate:"maxLength=100"`
|
||||
Name *string `json:"name" validate:"maxLength=100"`
|
||||
Address *string `json:"address" validate:"maxLength=100"`
|
||||
Village_Code *string `json:"village_code" validate:"maxLength=10"`
|
||||
Gender_Code *erp.GenderCode `json:"gender_code" validate:"maxLength=10"`
|
||||
PhoneNumber *string `json:"phoneNumber" validate:"maxLength=30"`
|
||||
Education_Code *erp.EducationCode `json:"education_code" validate:"maxLength=10"`
|
||||
Occupation_Code *erp.OcupationCode `json:"occupation_code" validate:"maxLength=10"`
|
||||
Occupation_Name *string `json:"occupation_name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ type ReadListDto struct {
|
||||
|
||||
type FilterDto struct {
|
||||
Person_Id uint `json:"person_id"`
|
||||
Relationship_Code erp.RelationshipCode `json:"relationship_code"`
|
||||
Relationship_Code erp.RelationshipCode `json:"relationship_code" `
|
||||
Name *string `json:"name"`
|
||||
Address *string `json:"address"`
|
||||
Village_Code *string `json:"village_code"`
|
||||
|
||||
@@ -11,21 +11,21 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Name string `json:"name"`
|
||||
FrontTitle *string `json:"frontTitle"`
|
||||
EndTitle *string `json:"endTitle"`
|
||||
Name string `json:"name" validate:"maxLength=150"`
|
||||
FrontTitle *string `json:"frontTitle" validate:"maxLength=50"`
|
||||
EndTitle *string `json:"endTitle" validate:"maxLength=50"`
|
||||
BirthDate *time.Time `json:"birthDate,omitempty"`
|
||||
BirthRegency_Code *string `json:"birthRegency_code"`
|
||||
BirthRegency_Code *string `json:"birthRegency_code" validate:"maxLength=4"`
|
||||
Gender_Code *erp.GenderCode `json:"gender_code"`
|
||||
ResidentIdentityNumber *string `json:"residentIdentityNumber" validate:"nik"`
|
||||
PassportNumber *string `json:"passportNumber"`
|
||||
DrivingLicenseNumber *string `json:"drivingLicenseNumber"`
|
||||
Religion_Code *erp.ReligionCode `json:"religion_code"`
|
||||
Education_Code *erp.EducationCode `json:"education_code"`
|
||||
Ocupation_Code *erp.OcupationCode `json:"occupation_code"`
|
||||
ResidentIdentityNumber *string `json:"residentIdentityNumber" validate:"nik;maxLength=16"`
|
||||
PassportNumber *string `json:"passportNumber" validate:"maxLength=20"`
|
||||
DrivingLicenseNumber *string `json:"drivingLicenseNumber" validate:"maxLength=20"`
|
||||
Religion_Code *erp.ReligionCode `json:"religion_code" validate:"maxLength=10"`
|
||||
Education_Code *erp.EducationCode `json:"education_code" validate:"maxLength=10"`
|
||||
Ocupation_Code *erp.OcupationCode `json:"occupation_code" validate:"maxLength=15"`
|
||||
Ocupation_Name *string `json:"occupation_name" validate:"maxLength=50"`
|
||||
Ethnic_Code *string `json:"ethnic_code"`
|
||||
Language_Code *string `json:"language_code"`
|
||||
Ethnic_Code *string `json:"ethnic_code" validate:"maxLength=20"`
|
||||
Language_Code *string `json:"language_code" validate:"maxLength=10"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
IHS_Number *string `json:"ihs_number"`
|
||||
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Regency_Code string `json:"regency_code"`
|
||||
Code string `json:"code" validate:"maxLength=20"`
|
||||
Name string `json:"name" validate:"maxLength=100"`
|
||||
Regency_Code string `json:"regency_code" validate:"maxLength=4"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -9,8 +9,8 @@ type CreateDto struct {
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Day_Code *erc.DayCode `json:"day_code"`
|
||||
StartTime *string `json:"startTime"`
|
||||
EndTime *string `json:"endTime"`
|
||||
StartTime *string `json:"startTime" validate:"maxLength=5"`
|
||||
EndTime *string `json:"endTime" validate:"maxLength=5"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
IndName string `json:"indName"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=2048"`
|
||||
IndName string `json:"indName" validate:"maxLength=2048"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
|
||||
type CreateDto struct {
|
||||
Installation_Id *uint16 `json:"installation_id"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code" validate:"maxLength=10"`
|
||||
Name string `json:"name" validate:"maxLength=50"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
)
|
||||
|
||||
type CreateDto struct {
|
||||
Name string `json:"name"`
|
||||
Password string `json:"password"`
|
||||
Status_Code erc.UserStatusCode `json:"status_code"`
|
||||
Name string `json:"name" validate:"maxLength=25"`
|
||||
Password string `json:"password" validate:"maxLength=255"`
|
||||
Status_Code erc.UserStatusCode `json:"status_code" validate:"maxLength=10"`
|
||||
}
|
||||
|
||||
type ReadListDto struct {
|
||||
|
||||
Reference in New Issue
Block a user