refactor several data source tables from id into code

This commit is contained in:
dpurbosakti
2025-11-12 16:57:52 +07:00
parent 94ce6bd5ee
commit ccc341be34
73 changed files with 388 additions and 281 deletions
@@ -5,9 +5,9 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=2048"`
IndName string `json:"indName" validate:"maxLength=2048"`
Code *string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=2048"`
IndName string `json:"indName" validate:"maxLength=2048"`
}
type ReadListDto struct {
@@ -25,17 +25,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -8,9 +8,9 @@ import (
)
type CreateDto struct {
Regency_Code string `json:"regency_code" validate:"numeric;maxLength=4"`
Code string `json:"code" validate:"numeric;maxLength=6"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
Regency_Code string `json:"regency_code" validate:"numeric;maxLength=4"`
Code *string `json:"code" validate:"numeric;maxLength=6"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
}
type ReadListDto struct {
@@ -28,17 +28,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -6,7 +6,7 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=20"`
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"`
@@ -30,18 +30,19 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
PhoneNumber *string `json:"phoneNumber"`
}
type UpdateDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -7,7 +7,7 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=20"`
Code *string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=50"`
Scope_Code erc.McuScopeCode `json:"scope_code" validate:"maxLength=10"`
}
@@ -27,17 +27,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -5,8 +5,8 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Code *string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
}
type ReadListDto struct {
@@ -23,17 +23,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -5,8 +5,8 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Code *string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
}
type ReadListDto struct {
@@ -23,17 +23,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -24,19 +24,20 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Employee_Id *uint `json:"employee_id"`
IHS_Number *string `json:"ihs_number"`
}
type UpdateDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -24,19 +24,20 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
Employee_Id *uint `json:"employee_id"`
IHS_Number *string `json:"ihs_number"`
}
type UpdateDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint `json:"id"`
Id *uint `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -5,9 +5,9 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=20"`
Name string `json:"name" validate:"maxLength=100"`
Regency_Code string `json:"regency_code" validate:"maxLength=4"`
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 {
@@ -25,17 +25,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -6,8 +6,8 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"numeric;maxLength=5"`
Village_Code string `json:"village_code" validate:"numeric;maxLength=10"`
Code *string `json:"code" validate:"numeric;maxLength=5"`
Village_Code string `json:"village_code" validate:"numeric;maxLength=10"`
}
type ReadListDto struct {
@@ -24,17 +24,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -5,9 +5,9 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=2048"`
IndName string `json:"indName" validate:"maxLength=2048"`
Code *string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=2048"`
IndName string `json:"indName" validate:"maxLength=2048"`
}
type ReadListDto struct {
@@ -25,17 +25,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
@@ -6,8 +6,8 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"required;minLength=2;maxLength=2"`
Name string `json:"name" validate:"required;maxLength=10"`
Code *string `json:"code" validate:"required;minLength=2;maxLength=2"`
Name string `json:"name" validate:"required;maxLength=10"`
}
type ReadListDto struct {
@@ -24,17 +24,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id int16 `json:"id"`
Id *int16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id int16 `json:"id"`
Id *int16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id int16 `json:"id"`
Id *int16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
+7 -6
View File
@@ -8,9 +8,9 @@ import (
)
type CreateDto struct {
Province_Code string `json:"province_code" validate:"numeric;maxLength=2"`
Code string `json:"code" validate:"numeric;maxLength=4"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
Province_Code string `json:"province_code" validate:"numeric;maxLength=2"`
Code *string `json:"code" validate:"numeric;maxLength=4"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
}
type ReadListDto struct {
@@ -28,17 +28,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
+6 -5
View File
@@ -5,8 +5,8 @@ import (
)
type CreateDto struct {
Code string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
Code *string `json:"code" validate:"maxLength=10"`
Name string `json:"name" validate:"maxLength=50"`
}
type ReadListDto struct {
@@ -23,17 +23,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint16 `json:"id"`
Id *uint16 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {
+7 -6
View File
@@ -8,9 +8,9 @@ import (
)
type CreateDto struct {
District_Code string `json:"district_code" validate:"numeric;maxLength=6"`
Code string `json:"code" validate:"numeric;maxLength=10"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
District_Code string `json:"district_code" validate:"numeric;maxLength=6"`
Code *string `json:"code" validate:"numeric;maxLength=10"`
Name string `json:"name" validate:"alphaSpace;maxLength=50"`
}
type ReadListDto struct {
@@ -28,17 +28,18 @@ type FilterDto struct {
}
type ReadDetailDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type UpdateDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
CreateDto
}
type DeleteDto struct {
Id uint32 `json:"id"`
Id *uint32 `json:"id"`
Code *string `json:"code"`
}
type MetaDto struct {