mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 05:21:57 +00:00
FIX[BE} fixing get all adjustment change respose json
This commit is contained in:
@@ -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),
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user