get field type to response detail recording

This commit is contained in:
giovanni
2026-04-27 13:38:13 +07:00
parent 7cc5c39092
commit aadd87852b
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -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
@@ -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),
}
}