From 92c6e8ea0845aec0326ffedd10e0a40d2a3be875 Mon Sep 17 00:00:00 2001 From: dpurbosakti Date: Wed, 3 Sep 2025 14:17:01 +0700 Subject: [PATCH] add validation on createDto --- internal/domain/main-entities/device/dto.go | 6 ++--- .../domain/main-entities/diagnose-src/dto.go | 6 ++--- .../main-entities/division-position/dto.go | 4 ++-- internal/domain/main-entities/division/dto.go | 4 ++-- .../domain/main-entities/doctor-fee/dto.go | 2 +- internal/domain/main-entities/doctor/dto.go | 4 ++-- internal/domain/main-entities/employee/dto.go | 6 ++--- internal/domain/main-entities/ethnic/dto.go | 4 ++-- internal/domain/main-entities/infra/dto.go | 6 ++--- .../domain/main-entities/installation/dto.go | 6 ++--- .../main-entities/insurance-company/dto.go | 10 ++++---- .../domain/main-entities/item-price/dto.go | 2 +- internal/domain/main-entities/item/dto.go | 8 +++---- internal/domain/main-entities/language/dto.go | 4 ++-- internal/domain/main-entities/material/dto.go | 6 ++--- .../main-entities/mcu-src-category/dto.go | 6 ++--- internal/domain/main-entities/mcu-src/dto.go | 6 ++--- .../main-entities/medical-action-src/dto.go | 4 ++-- .../main-entities/medicine-group/dto.go | 4 ++-- .../main-entities/medicine-method/dto.go | 4 ++-- .../domain/main-entities/medicine-mix/dto.go | 2 +- internal/domain/main-entities/medicine/dto.go | 10 ++++---- internal/domain/main-entities/nurse/dto.go | 2 +- .../domain/main-entities/nutritionist/dto.go | 2 +- internal/domain/main-entities/patient/dto.go | 2 +- .../main-entities/person-address/dto.go | 8 +++---- .../main-entities/person-contact/dto.go | 4 ++-- .../main-entities/person-relative/dto.go | 18 +++++++------- internal/domain/main-entities/person/dto.go | 24 +++++++++---------- .../domain/main-entities/pharmacist/dto.go | 2 +- .../main-entities/pharmacy-company/dto.go | 6 ++--- .../main-entities/practice-schedule/dto.go | 4 ++-- .../domain/main-entities/procedure-src/dto.go | 6 ++--- internal/domain/main-entities/unit/dto.go | 4 ++-- internal/domain/main-entities/uom/dto.go | 4 ++-- internal/domain/main-entities/user/dto.go | 6 ++--- 36 files changed, 103 insertions(+), 103 deletions(-) diff --git a/internal/domain/main-entities/device/dto.go b/internal/domain/main-entities/device/dto.go index 921aae1b..dcc115c6 100644 --- a/internal/domain/main-entities/device/dto.go +++ b/internal/domain/main-entities/device/dto.go @@ -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"` } diff --git a/internal/domain/main-entities/diagnose-src/dto.go b/internal/domain/main-entities/diagnose-src/dto.go index 3cfe0152..7b11f8b8 100644 --- a/internal/domain/main-entities/diagnose-src/dto.go +++ b/internal/domain/main-entities/diagnose-src/dto.go @@ -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 { diff --git a/internal/domain/main-entities/division-position/dto.go b/internal/domain/main-entities/division-position/dto.go index 4bf75308..592985fe 100644 --- a/internal/domain/main-entities/division-position/dto.go +++ b/internal/domain/main-entities/division-position/dto.go @@ -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 { diff --git a/internal/domain/main-entities/division/dto.go b/internal/domain/main-entities/division/dto.go index 890bd606..e8ba2d97 100644 --- a/internal/domain/main-entities/division/dto.go +++ b/internal/domain/main-entities/division/dto.go @@ -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"` } diff --git a/internal/domain/main-entities/doctor-fee/dto.go b/internal/domain/main-entities/doctor-fee/dto.go index ae6c8d77..9e22d4d2 100644 --- a/internal/domain/main-entities/doctor-fee/dto.go +++ b/internal/domain/main-entities/doctor-fee/dto.go @@ -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"` } diff --git a/internal/domain/main-entities/doctor/dto.go b/internal/domain/main-entities/doctor/dto.go index 7f506a40..f016cc1f 100644 --- a/internal/domain/main-entities/doctor/dto.go +++ b/internal/domain/main-entities/doctor/dto.go @@ -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"` diff --git a/internal/domain/main-entities/employee/dto.go b/internal/domain/main-entities/employee/dto.go index 8fd02eff..371d82a1 100644 --- a/internal/domain/main-entities/employee/dto.go +++ b/internal/domain/main-entities/employee/dto.go @@ -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"` diff --git a/internal/domain/main-entities/ethnic/dto.go b/internal/domain/main-entities/ethnic/dto.go index f434e4ae..8b14fde1 100644 --- a/internal/domain/main-entities/ethnic/dto.go +++ b/internal/domain/main-entities/ethnic/dto.go @@ -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 { diff --git a/internal/domain/main-entities/infra/dto.go b/internal/domain/main-entities/infra/dto.go index 49a47073..07dae72a 100644 --- a/internal/domain/main-entities/infra/dto.go +++ b/internal/domain/main-entities/infra/dto.go @@ -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"` } diff --git a/internal/domain/main-entities/installation/dto.go b/internal/domain/main-entities/installation/dto.go index 76b4084b..15377317 100644 --- a/internal/domain/main-entities/installation/dto.go +++ b/internal/domain/main-entities/installation/dto.go @@ -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 { diff --git a/internal/domain/main-entities/insurance-company/dto.go b/internal/domain/main-entities/insurance-company/dto.go index 44728319..4ca58076 100644 --- a/internal/domain/main-entities/insurance-company/dto.go +++ b/internal/domain/main-entities/insurance-company/dto.go @@ -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 { diff --git a/internal/domain/main-entities/item-price/dto.go b/internal/domain/main-entities/item-price/dto.go index e9aa2e9b..b4740788 100644 --- a/internal/domain/main-entities/item-price/dto.go +++ b/internal/domain/main-entities/item-price/dto.go @@ -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 { diff --git a/internal/domain/main-entities/item/dto.go b/internal/domain/main-entities/item/dto.go index 301b759e..6c364828 100644 --- a/internal/domain/main-entities/item/dto.go +++ b/internal/domain/main-entities/item/dto.go @@ -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"` } diff --git a/internal/domain/main-entities/language/dto.go b/internal/domain/main-entities/language/dto.go index 5a7c98c4..563b5205 100644 --- a/internal/domain/main-entities/language/dto.go +++ b/internal/domain/main-entities/language/dto.go @@ -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 { diff --git a/internal/domain/main-entities/material/dto.go b/internal/domain/main-entities/material/dto.go index 27b0422b..9ae830f9 100644 --- a/internal/domain/main-entities/material/dto.go +++ b/internal/domain/main-entities/material/dto.go @@ -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"` diff --git a/internal/domain/main-entities/mcu-src-category/dto.go b/internal/domain/main-entities/mcu-src-category/dto.go index 7058722f..03e7cf79 100644 --- a/internal/domain/main-entities/mcu-src-category/dto.go +++ b/internal/domain/main-entities/mcu-src-category/dto.go @@ -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 { diff --git a/internal/domain/main-entities/mcu-src/dto.go b/internal/domain/main-entities/mcu-src/dto.go index 66205ab2..26d76102 100644 --- a/internal/domain/main-entities/mcu-src/dto.go +++ b/internal/domain/main-entities/mcu-src/dto.go @@ -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 { diff --git a/internal/domain/main-entities/medical-action-src/dto.go b/internal/domain/main-entities/medical-action-src/dto.go index 664848df..e902a1e8 100644 --- a/internal/domain/main-entities/medical-action-src/dto.go +++ b/internal/domain/main-entities/medical-action-src/dto.go @@ -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"` } diff --git a/internal/domain/main-entities/medicine-group/dto.go b/internal/domain/main-entities/medicine-group/dto.go index c4dfde6c..88de7c21 100644 --- a/internal/domain/main-entities/medicine-group/dto.go +++ b/internal/domain/main-entities/medicine-group/dto.go @@ -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 { diff --git a/internal/domain/main-entities/medicine-method/dto.go b/internal/domain/main-entities/medicine-method/dto.go index 763a7c65..5df40a7a 100644 --- a/internal/domain/main-entities/medicine-method/dto.go +++ b/internal/domain/main-entities/medicine-method/dto.go @@ -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 { diff --git a/internal/domain/main-entities/medicine-mix/dto.go b/internal/domain/main-entities/medicine-mix/dto.go index 39314051..b9fc656e 100644 --- a/internal/domain/main-entities/medicine-mix/dto.go +++ b/internal/domain/main-entities/medicine-mix/dto.go @@ -5,7 +5,7 @@ import ( ) type CreateDto struct { - Name string `json:"name"` + Name string `json:"name" validate:"maxLength=50"` } type ReadListDto struct { diff --git a/internal/domain/main-entities/medicine/dto.go b/internal/domain/main-entities/medicine/dto.go index bd01f213..9e63c9ae 100644 --- a/internal/domain/main-entities/medicine/dto.go +++ b/internal/domain/main-entities/medicine/dto.go @@ -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"` diff --git a/internal/domain/main-entities/nurse/dto.go b/internal/domain/main-entities/nurse/dto.go index 251fb231..224cb0d5 100644 --- a/internal/domain/main-entities/nurse/dto.go +++ b/internal/domain/main-entities/nurse/dto.go @@ -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"` } diff --git a/internal/domain/main-entities/nutritionist/dto.go b/internal/domain/main-entities/nutritionist/dto.go index f69e252e..7f8c2229 100644 --- a/internal/domain/main-entities/nutritionist/dto.go +++ b/internal/domain/main-entities/nutritionist/dto.go @@ -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 { diff --git a/internal/domain/main-entities/patient/dto.go b/internal/domain/main-entities/patient/dto.go index 506a7efc..c0eee96a 100644 --- a/internal/domain/main-entities/patient/dto.go +++ b/internal/domain/main-entities/patient/dto.go @@ -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 { diff --git a/internal/domain/main-entities/person-address/dto.go b/internal/domain/main-entities/person-address/dto.go index f88799f1..5f5dad52 100644 --- a/internal/domain/main-entities/person-address/dto.go +++ b/internal/domain/main-entities/person-address/dto.go @@ -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 { diff --git a/internal/domain/main-entities/person-contact/dto.go b/internal/domain/main-entities/person-contact/dto.go index 036db7e7..c2b684e2 100644 --- a/internal/domain/main-entities/person-contact/dto.go +++ b/internal/domain/main-entities/person-contact/dto.go @@ -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 { diff --git a/internal/domain/main-entities/person-relative/dto.go b/internal/domain/main-entities/person-relative/dto.go index c3d48d01..4b870771 100644 --- a/internal/domain/main-entities/person-relative/dto.go +++ b/internal/domain/main-entities/person-relative/dto.go @@ -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"` diff --git a/internal/domain/main-entities/person/dto.go b/internal/domain/main-entities/person/dto.go index e9d2511c..bab22944 100644 --- a/internal/domain/main-entities/person/dto.go +++ b/internal/domain/main-entities/person/dto.go @@ -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 { diff --git a/internal/domain/main-entities/pharmacist/dto.go b/internal/domain/main-entities/pharmacist/dto.go index 7d32082d..39ba0d85 100644 --- a/internal/domain/main-entities/pharmacist/dto.go +++ b/internal/domain/main-entities/pharmacist/dto.go @@ -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 { diff --git a/internal/domain/main-entities/pharmacy-company/dto.go b/internal/domain/main-entities/pharmacy-company/dto.go index eb7ce5e1..138c58ad 100644 --- a/internal/domain/main-entities/pharmacy-company/dto.go +++ b/internal/domain/main-entities/pharmacy-company/dto.go @@ -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 { diff --git a/internal/domain/main-entities/practice-schedule/dto.go b/internal/domain/main-entities/practice-schedule/dto.go index 3896868f..505d793e 100644 --- a/internal/domain/main-entities/practice-schedule/dto.go +++ b/internal/domain/main-entities/practice-schedule/dto.go @@ -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 { diff --git a/internal/domain/main-entities/procedure-src/dto.go b/internal/domain/main-entities/procedure-src/dto.go index a69a5244..8dd97f1e 100644 --- a/internal/domain/main-entities/procedure-src/dto.go +++ b/internal/domain/main-entities/procedure-src/dto.go @@ -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 { diff --git a/internal/domain/main-entities/unit/dto.go b/internal/domain/main-entities/unit/dto.go index 8d4c0b44..e3521eb5 100644 --- a/internal/domain/main-entities/unit/dto.go +++ b/internal/domain/main-entities/unit/dto.go @@ -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 { diff --git a/internal/domain/main-entities/uom/dto.go b/internal/domain/main-entities/uom/dto.go index 597510a1..348fb7fd 100644 --- a/internal/domain/main-entities/uom/dto.go +++ b/internal/domain/main-entities/uom/dto.go @@ -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 { diff --git a/internal/domain/main-entities/user/dto.go b/internal/domain/main-entities/user/dto.go index 102429b7..26233c81 100644 --- a/internal/domain/main-entities/user/dto.go +++ b/internal/domain/main-entities/user/dto.go @@ -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 {