diff --git a/internal/database/migrations/20251203145514_adjustment_recording_without_grading_eggs.down.sql b/internal/database/migrations/20251203145514_adjustment_recording_without_grading_eggs.down.sql index 7654ca00..294d5e40 100644 --- a/internal/database/migrations/20251203145514_adjustment_recording_without_grading_eggs.down.sql +++ b/internal/database/migrations/20251203145514_adjustment_recording_without_grading_eggs.down.sql @@ -5,8 +5,7 @@ ALTER TABLE recording_eggs DROP CONSTRAINT IF EXISTS chk_recording_eggs_qty; ALTER TABLE recording_eggs - DROP COLUMN IF EXISTS weight, - DROP COLUMN IF EXISTS grade; + DROP COLUMN IF EXISTS weight; ALTER TABLE recording_eggs ADD CONSTRAINT chk_recording_eggs_qty CHECK (qty >= 0); diff --git a/internal/database/migrations/20251203145514_adjustment_recording_without_grading_eggs.up.sql b/internal/database/migrations/20251203145514_adjustment_recording_without_grading_eggs.up.sql index 91820b0e..4da8c647 100644 --- a/internal/database/migrations/20251203145514_adjustment_recording_without_grading_eggs.up.sql +++ b/internal/database/migrations/20251203145514_adjustment_recording_without_grading_eggs.up.sql @@ -5,8 +5,7 @@ DROP INDEX IF EXISTS idx_grading_eggs_recording_egg; DROP TABLE IF EXISTS grading_eggs; ALTER TABLE recording_eggs - ADD COLUMN IF NOT EXISTS weight NUMERIC(10,3), - ADD COLUMN IF NOT EXISTS grade VARCHAR; + ADD COLUMN IF NOT EXISTS weight NUMERIC(10,3); ALTER TABLE recording_eggs DROP CONSTRAINT IF EXISTS chk_recording_eggs_qty; diff --git a/internal/entities/recording_egg.go b/internal/entities/recording_egg.go index 20e6e72e..775d15dc 100644 --- a/internal/entities/recording_egg.go +++ b/internal/entities/recording_egg.go @@ -8,7 +8,6 @@ type RecordingEgg struct { ProductWarehouseId uint `gorm:"column:product_warehouse_id;not null"` Qty int `gorm:"column:qty;not null"` Weight *float64 `gorm:"column:weight"` - Grade *string `gorm:"column:grade;type:varchar(50)"` CreatedBy uint `gorm:"column:created_by"` CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"` diff --git a/internal/modules/production/recordings/dto/recording.dto.go b/internal/modules/production/recordings/dto/recording.dto.go index 986f99cb..51fba8a4 100644 --- a/internal/modules/production/recordings/dto/recording.dto.go +++ b/internal/modules/production/recordings/dto/recording.dto.go @@ -69,7 +69,6 @@ type RecordingEggDTO struct { ProductWarehouseId uint `json:"product_warehouse_id"` Qty int `json:"qty"` Weight *float64 `json:"weight,omitempty"` - Grade *string `json:"grade,omitempty"` ProductWarehouse productWarehouseDTO.ProductWarehouseDTO `json:"product_warehouse"` } @@ -241,7 +240,6 @@ func ToRecordingEggDTOs(eggs []entity.RecordingEgg) []RecordingEggDTO { ProductWarehouseId: egg.ProductWarehouseId, Qty: egg.Qty, Weight: egg.Weight, - Grade: egg.Grade, ProductWarehouse: mapProductWarehouseDTO(&egg.ProductWarehouse), } } diff --git a/internal/modules/production/recordings/validations/recording.validation.go b/internal/modules/production/recordings/validations/recording.validation.go index 64a726a0..28c38ff5 100644 --- a/internal/modules/production/recordings/validations/recording.validation.go +++ b/internal/modules/production/recordings/validations/recording.validation.go @@ -22,7 +22,6 @@ type ( ProductWarehouseId uint `json:"product_warehouse_id" validate:"required,number,min=1"` Qty int `json:"qty" validate:"required,number,min=0"` Weight *float64 `json:"weight,omitempty" validate:"omitempty,gte=0"` - Grade *string `json:"grade,omitempty" validate:"omitempty"` } ) diff --git a/internal/utils/recording/util.recording.go b/internal/utils/recording/util.recording.go index 52fa0087..f10926dc 100644 --- a/internal/utils/recording/util.recording.go +++ b/internal/utils/recording/util.recording.go @@ -81,7 +81,6 @@ func MapEggs(recordingID uint, createdBy uint, items []validation.Egg) []entity. ProductWarehouseId: item.ProductWarehouseId, Qty: item.Qty, Weight: item.Weight, - Grade: item.Grade, CreatedBy: createdBy, }) }