diff --git a/internal/entities/warehouse.go b/internal/entities/warehouse.go index fe2d96aa..75c9cc01 100644 --- a/internal/entities/warehouse.go +++ b/internal/entities/warehouse.go @@ -9,7 +9,7 @@ import ( type Warehouse struct { Id uint `gorm:"primaryKey"` Name string `gorm:"type:varchar(50);not null"` - Type string `gorm:"not null"` + Type string `gorm:"column:type;not null"` AreaId uint `gorm:"not null"` LocationId *uint KandangId *uint diff --git a/internal/modules/inventory/adjustments/dto/adjustment.dto.go b/internal/modules/inventory/adjustments/dto/adjustment.dto.go index 94cbd371..a3d68713 100644 --- a/internal/modules/inventory/adjustments/dto/adjustment.dto.go +++ b/internal/modules/inventory/adjustments/dto/adjustment.dto.go @@ -33,6 +33,7 @@ type ProjectFlockRelationDTO struct { type WarehouseRelationDTO struct { Id uint `json:"id"` Name string `json:"name"` + Type string `json:"type"` Location *LocationRelationDTO `json:"location,omitempty"` } @@ -113,6 +114,7 @@ func ToWarehouseRelationDTO(e *entity.Warehouse) *WarehouseRelationDTO { return &WarehouseRelationDTO{ Id: e.Id, Name: e.Name, + Type: e.Type, Location: ToLocationRelationDTO(e.Location), } }