mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 14:55:42 +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 {
|
type AdjustmentRelationDTO struct {
|
||||||
Id uint `json:"id"`
|
Id uint `json:"id"`
|
||||||
TransactionType string `json:"transaction_type"`
|
Increase float64 `json:"increase"`
|
||||||
Quantity float64 `json:"quantity"`
|
Decrease float64 `json:"decrease"`
|
||||||
BeforeQuantity float64 `json:"before_quantity"`
|
|
||||||
AfterQuantity float64 `json:"after_quantity"`
|
|
||||||
Note string `json:"note,omitempty"`
|
Note string `json:"note,omitempty"`
|
||||||
ProductWarehouseId uint `json:"product_warehouse_id"`
|
ProductWarehouseId uint `json:"product_warehouse_id"`
|
||||||
ProductWarehouse *ProductWarehouseDTO `json:"product_warehouse,omitempty"`
|
ProductWarehouse *ProductWarehouseDTO `json:"product_warehouse,omitempty"`
|
||||||
@@ -104,12 +102,10 @@ func ToProductWarehouseDTO(e *entity.ProductWarehouse) *ProductWarehouseDTO {
|
|||||||
|
|
||||||
func ToAdjustmentRelationDTO(e *entity.StockLog) AdjustmentRelationDTO {
|
func ToAdjustmentRelationDTO(e *entity.StockLog) AdjustmentRelationDTO {
|
||||||
return AdjustmentRelationDTO{
|
return AdjustmentRelationDTO{
|
||||||
Id: e.Id,
|
Id: e.Id,
|
||||||
// TransactionType: e.LoggableType,
|
|
||||||
// Quantity: e.Q,
|
|
||||||
// BeforeQuantity: e.BeforeQuantity,
|
|
||||||
// AfterQuantity: e.AfterQuantity,
|
|
||||||
Note: e.Notes,
|
Note: e.Notes,
|
||||||
|
Increase: e.Increase,
|
||||||
|
Decrease: e.Decrease,
|
||||||
ProductWarehouseId: e.ProductWarehouseId,
|
ProductWarehouseId: e.ProductWarehouseId,
|
||||||
ProductWarehouse: ToProductWarehouseDTO(e.ProductWarehouse),
|
ProductWarehouse: ToProductWarehouseDTO(e.ProductWarehouse),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ func AdjustmentRoutes(v1 fiber.Router, u user.UserService, s adjustment.Adjustme
|
|||||||
|
|
||||||
route := v1.Group("/adjustments")
|
route := v1.Group("/adjustments")
|
||||||
route.Use(m.Auth(u))
|
route.Use(m.Auth(u))
|
||||||
// Standard CRUD routes following master data pattern
|
|
||||||
route.Get("/", ctrl.AdjustmentHistory) // Get all with pagination and filters
|
route.Get("/", ctrl.AdjustmentHistory)
|
||||||
route.Post("/", ctrl.Adjustment) // Create adjustment
|
route.Post("/", ctrl.Adjustment)
|
||||||
route.Get("/:id", ctrl.GetOne)
|
route.Get("/:id", ctrl.GetOne)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user