feat(BE-59,60,61): build stock transfer API with validation and audit log

This commit is contained in:
aguhh18
2025-10-16 07:37:10 +07:00
parent 0ffb8a44f2
commit f6f62246c6
2 changed files with 13 additions and 11 deletions
@@ -29,9 +29,8 @@ type AreaDTO struct {
}
type LocationDTO struct {
Id uint `json:"id"`
Name string `json:"name"`
Area *AreaDTO `json:"area"`
Id uint `json:"id"`
Name string `json:"name"`
}
type WarehouseDetailDTO struct {
@@ -119,11 +118,9 @@ func toLocationDTO(l *entity.Location) *LocationDTO {
if l == nil {
return nil
}
// Area selalu diisi jika l.Area ada
return &LocationDTO{
Id: l.Id,
Name: l.Name,
Area: toAreaDTO(&l.Area),
}
}
@@ -135,7 +132,7 @@ func toWarehouseDetailDTO(w *entity.Warehouse) *WarehouseDetailDTO {
Id: w.Id,
Name: w.Name,
Location: toLocationDTO(w.Location),
Area: toAreaDTO(&w.Area),
Area: toAreaDTO(&w.Area), // Ambil area langsung dari warehouse (area_id)
}
}