diff --git a/database/entities/m_aisle_entity.go b/database/entities/m_aisle_entity.go index e1ce361..ec65eba 100644 --- a/database/entities/m_aisle_entity.go +++ b/database/entities/m_aisle_entity.go @@ -6,13 +6,13 @@ type MAisleEntity struct { ID uuid.UUID `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()" json:"id"` Code string `gorm:"type:varchar(50);not null;" json:"code"` Name string `gorm:"type:varchar(100);not null;" json:"name"` - IsleX string `gorm:"type:varchar(50);" json:"isle_x"` - BinY string `gorm:"type:varchar(50);" json:"bin_y"` - LevelZ string `gorm:"type:varchar(50);" json:"level_z"` - DimLength string `gorm:"type:varchar(100);" json:"dim_length"` - DimWidth string `gorm:"type:varchar(100);" json:"dim_width"` - DimHeight string `gorm:"type:varchar(100);" json:"dim_height"` - Weight string `gorm:"type:varchar(100);" json:"weight"` + IsleX int `gorm:"type:int;" json:"isle_x"` + BinY int `gorm:"type:int;" json:"bin_y"` + LevelZ int `gorm:"type:int;" json:"level_z"` + DimLength float64 `gorm:"type:float;" json:"dim_length"` + DimWidth float64 `gorm:"type:float;" json:"dim_width"` + DimHeight float64 `gorm:"type:float;" json:"dim_height"` + Weight float64 `gorm:"type:float;" json:"weight"` QrCodeAisle string `gorm:"type:text;" json:"qr_code_aisle"` IsActive bool `gorm:"type:boolean;default:true;" json:"is_active"` diff --git a/modules/aisle/dto/aisle_dto.go b/modules/aisle/dto/aisle_dto.go index 4121c3c..6874901 100644 --- a/modules/aisle/dto/aisle_dto.go +++ b/modules/aisle/dto/aisle_dto.go @@ -26,48 +26,48 @@ var ( ) type AisleCreateRequest struct { - Code string `json:"code" binding:"required"` - Name string `json:"name" binding:"required"` - IsleX string `json:"isle_x"` - BinY string `json:"bin_y"` - LevelZ string `json:"level_z"` - DimLength string `json:"dim_length"` - DimWidth string `json:"dim_width"` - DimHeight string `json:"dim_height"` - Weight string `json:"weight"` - QrCodeAisle string `json:"qr_code_aisle"` - IsActive bool `json:"is_active"` - ZoneID string `json:"zone_id" binding:"required"` - DimUomID string `json:"dim_uom_id" binding:"required"` - WeightUomID string `json:"weight_uom_id" binding:"required"` - ClientID string `json:"client_id" binding:"required"` + Code string `json:"code" binding:"required"` + Name string `json:"name" binding:"required"` + IsleX int `json:"isle_x"` + BinY int `json:"bin_y"` + LevelZ int `json:"level_z"` + DimLength float64 `json:"dim_length"` + DimWidth float64 `json:"dim_width"` + DimHeight float64 `json:"dim_height"` + Weight float64 `json:"weight"` + QrCodeAisle string `json:"qr_code_aisle"` + IsActive bool `json:"is_active"` + ZoneID string `json:"zone_id" binding:"required"` + DimUomID string `json:"dim_uom_id" binding:"required"` + WeightUomID string `json:"weight_uom_id" binding:"required"` + ClientID string `json:"client_id" binding:"required"` } type AisleUpdateRequest struct { - Code string `json:"code"` - Name string `json:"name"` - IsleX string `json:"isle_x"` - BinY string `json:"bin_y"` - LevelZ string `json:"level_z"` - DimLength string `json:"dim_length"` - DimWidth string `json:"dim_width"` - DimHeight string `json:"dim_height"` - Weight string `json:"weight"` - QrCodeAisle string `json:"qr_code_aisle"` - IsActive bool `json:"is_active"` + Code string `json:"code"` + Name string `json:"name"` + IsleX int `json:"isle_x"` + BinY int `json:"bin_y"` + LevelZ int `json:"level_z"` + DimLength float64 `json:"dim_length"` + DimWidth float64 `json:"dim_width"` + DimHeight float64 `json:"dim_height"` + Weight float64 `json:"weight"` + QrCodeAisle string `json:"qr_code_aisle"` + IsActive bool `json:"is_active"` } type AisleResponse struct { ID string `json:"id"` Code string `json:"code"` Name string `json:"name"` - IsleX string `json:"isle_x"` - BinY string `json:"bin_y"` - LevelZ string `json:"level_z"` - DimLength string `json:"dim_length"` - DimWidth string `json:"dim_width"` - DimHeight string `json:"dim_height"` - Weight string `json:"weight"` + IsleX int `json:"isle_x"` + BinY int `json:"bin_y"` + LevelZ int `json:"level_z"` + DimLength float64 `json:"dim_length"` + DimWidth float64 `json:"dim_width"` + DimHeight float64 `json:"dim_height"` + Weight float64 `json:"weight"` QrCodeAisle string `json:"qr_code_aisle"` IsActive bool `json:"is_active"` Zone pkgdto.IdNameResponse `json:"zone"` diff --git a/modules/aisle/service/aisle_service.go b/modules/aisle/service/aisle_service.go index dbe567d..12762c3 100644 --- a/modules/aisle/service/aisle_service.go +++ b/modules/aisle/service/aisle_service.go @@ -168,25 +168,25 @@ func (s *aisleService) Update(ctx context.Context, req dto.AisleUpdateRequest, a if req.Name != "" { aisle.Name = req.Name } - if req.IsleX != "" { + if req.IsleX != 0 { aisle.IsleX = req.IsleX } - if req.BinY != "" { + if req.BinY != 0 { aisle.BinY = req.BinY } - if req.LevelZ != "" { + if req.LevelZ != 0 { aisle.LevelZ = req.LevelZ } - if req.DimLength != "" { + if req.DimLength != 0 { aisle.DimLength = req.DimLength } - if req.DimWidth != "" { + if req.DimWidth != 0 { aisle.DimWidth = req.DimWidth } - if req.DimHeight != "" { + if req.DimHeight != 0 { aisle.DimHeight = req.DimHeight } - if req.Weight != "" { + if req.Weight != 0 { aisle.Weight = req.Weight } if req.QrCodeAisle != "" { diff --git a/modules/warehouse/dto/warehouse_dto.go b/modules/warehouse/dto/warehouse_dto.go index e5282f7..04737cd 100644 --- a/modules/warehouse/dto/warehouse_dto.go +++ b/modules/warehouse/dto/warehouse_dto.go @@ -74,13 +74,13 @@ type ZonaAisleResponse struct { ID string `json:"id"` Code string `json:"code"` Name string `json:"name"` - IsleX string `json:"isle_x"` - BinY string `json:"bin_y"` - LevelZ string `json:"level_z"` - DimLength string `json:"dim_length"` - DimWidth string `json:"dim_width"` - DimHeight string `json:"dim_height"` - Weight string `json:"weight"` + IsleX int `json:"isle_x"` + BinY int `json:"bin_y"` + LevelZ int `json:"level_z"` + DimLength float64 `json:"dim_length"` + DimWidth float64 `json:"dim_width"` + DimHeight float64 `json:"dim_height"` + Weight float64 `json:"weight"` QrCodeAisle string `json:"qr_code_aisle"` IsActive bool `json:"is_active"` Zone pkgdto.IdNameResponse `json:"zone"`