diff --git a/internal/modules/inventory/adjustments/dto/adjustment.dto.go b/internal/modules/inventory/adjustments/dto/adjustment.dto.go index 556050f4..008f9966 100644 --- a/internal/modules/inventory/adjustments/dto/adjustment.dto.go +++ b/internal/modules/inventory/adjustments/dto/adjustment.dto.go @@ -33,10 +33,8 @@ type ProductWarehouseDTO struct { type AdjustmentRelationDTO struct { Id uint `json:"id"` - TransactionType string `json:"transaction_type"` - Quantity float64 `json:"quantity"` - BeforeQuantity float64 `json:"before_quantity"` - AfterQuantity float64 `json:"after_quantity"` + Increase float64 `json:"increase"` + Decrease float64 `json:"decrease"` Note string `json:"note,omitempty"` ProductWarehouseId uint `json:"product_warehouse_id"` ProductWarehouse *ProductWarehouseDTO `json:"product_warehouse,omitempty"` @@ -104,12 +102,10 @@ func ToProductWarehouseDTO(e *entity.ProductWarehouse) *ProductWarehouseDTO { func ToAdjustmentRelationDTO(e *entity.StockLog) AdjustmentRelationDTO { return AdjustmentRelationDTO{ - Id: e.Id, - // TransactionType: e.LoggableType, - // Quantity: e.Q, - // BeforeQuantity: e.BeforeQuantity, - // AfterQuantity: e.AfterQuantity, + Id: e.Id, Note: e.Notes, + Increase: e.Increase, + Decrease: e.Decrease, ProductWarehouseId: e.ProductWarehouseId, ProductWarehouse: ToProductWarehouseDTO(e.ProductWarehouse), } diff --git a/internal/modules/inventory/adjustments/route.go b/internal/modules/inventory/adjustments/route.go index 57200215..8c7e5f9f 100644 --- a/internal/modules/inventory/adjustments/route.go +++ b/internal/modules/inventory/adjustments/route.go @@ -14,9 +14,9 @@ func AdjustmentRoutes(v1 fiber.Router, u user.UserService, s adjustment.Adjustme route := v1.Group("/adjustments") route.Use(m.Auth(u)) - // Standard CRUD routes following master data pattern - route.Get("/", ctrl.AdjustmentHistory) // Get all with pagination and filters - route.Post("/", ctrl.Adjustment) // Create adjustment + + route.Get("/", ctrl.AdjustmentHistory) + route.Post("/", ctrl.Adjustment) route.Get("/:id", ctrl.GetOne) }