feat: update InventoryMovementResponse to include client details and modify client ID retrieval in WarehouseController
Deploy Application / deploy (push) Successful in 30s
Details
Deploy Application / deploy (push) Successful in 30s
Details
This commit is contained in:
parent
bac881a54d
commit
ff8cd07e9c
|
|
@ -2,6 +2,7 @@ package dto
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Caknoooo/go-gin-clean-starter/database/entities"
|
"github.com/Caknoooo/go-gin-clean-starter/database/entities"
|
||||||
|
pkgdto "github.com/Caknoooo/go-gin-clean-starter/pkg/dto"
|
||||||
"github.com/Caknoooo/go-gin-clean-starter/pkg/utils"
|
"github.com/Caknoooo/go-gin-clean-starter/pkg/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -55,14 +56,14 @@ type InventoryMovementLineUpdateRequest struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type InventoryMovementResponse struct {
|
type InventoryMovementResponse struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
MovementNumber string `json:"movement_number"`
|
MovementNumber string `json:"movement_number"`
|
||||||
MovementDate string `json:"movement_date"`
|
MovementDate string `json:"movement_date"`
|
||||||
MovementType string `json:"movement_type"`
|
MovementType string `json:"movement_type"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
ClientID string `json:"client_id"`
|
Client pkgdto.IdNameResponse `json:"client"`
|
||||||
SourceLocationID string `json:"source_location_id"`
|
SourceLocationID string `json:"source_location_id"`
|
||||||
DestinationLocationID string `json:"destination_location_id"`
|
DestinationLocationID string `json:"destination_location_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type InventoryMovementLineResponse struct {
|
type InventoryMovementLineResponse struct {
|
||||||
|
|
@ -81,7 +82,7 @@ func ToInventoryMovementResponse(e entities.TInventoryMovementEntity) InventoryM
|
||||||
MovementDate: utils.DateTimeToString(e.MovementDate),
|
MovementDate: utils.DateTimeToString(e.MovementDate),
|
||||||
MovementType: e.MovementType,
|
MovementType: e.MovementType,
|
||||||
Status: e.Status,
|
Status: e.Status,
|
||||||
ClientID: e.ClientID.String(),
|
Client: pkgdto.IdNameResponse{ID: e.Client.ID.String(), Name: e.Client.Name},
|
||||||
SourceLocationID: e.SourceLocationID.String(),
|
SourceLocationID: e.SourceLocationID.String(),
|
||||||
DestinationLocationID: e.DestinationLocationID.String(),
|
DestinationLocationID: e.DestinationLocationID.String(),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ func (w *warehouseController) GetById(ctx *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *warehouseController) GetAll(ctx *gin.Context) {
|
func (w *warehouseController) GetAll(ctx *gin.Context) {
|
||||||
clientId := ctx.MustGet("client_id").(string)
|
clientId := ctx.Query("client_id")
|
||||||
var filter query.WarehouseFilter
|
var filter query.WarehouseFilter
|
||||||
filter.ClientID = clientId
|
filter.ClientID = clientId
|
||||||
if err := ctx.ShouldBindQuery(&filter); err != nil {
|
if err := ctx.ShouldBindQuery(&filter); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue