91 lines
3.9 KiB
Go
91 lines
3.9 KiB
Go
package dto
|
|
|
|
import (
|
|
"errors"
|
|
|
|
pkgdto "github.com/Caknoooo/go-gin-clean-starter/pkg/dto"
|
|
)
|
|
|
|
const (
|
|
MESSAGE_FAILED_CREATE_WAREHOUSE = "failed create warehouse"
|
|
MESSAGE_SUCCESS_CREATE_WAREHOUSE = "success create warehouse"
|
|
MESSAGE_FAILED_GET_WAREHOUSE = "failed get warehouse"
|
|
MESSAGE_SUCCESS_GET_WAREHOUSE = "success get warehouse"
|
|
MESSAGE_FAILED_UPDATE_WAREHOUSE = "failed update warehouse"
|
|
MESSAGE_SUCCESS_UPDATE_WAREHOUSE = "success update warehouse"
|
|
MESSAGE_FAILED_DELETE_WAREHOUSE = "failed delete warehouse"
|
|
MESSAGE_SUCCESS_DELETE_WAREHOUSE = "success delete warehouse"
|
|
MESSAGE_FAILED_GET_DATA_FROM_BODY = "failed get data from body"
|
|
)
|
|
|
|
var (
|
|
ErrCreateWarehouse = errors.New("failed to create warehouse")
|
|
ErrGetWarehouseById = errors.New("failed to get warehouse by id")
|
|
ErrUpdateWarehouse = errors.New("failed to update warehouse")
|
|
ErrDeleteWarehouse = errors.New("failed to delete warehouse")
|
|
)
|
|
|
|
type WarehouseCreateRequest struct {
|
|
Code string `json:"code" binding:"required"`
|
|
Name string `json:"name" binding:"required"`
|
|
Description string `json:"description"`
|
|
Status string `json:"status" binding:"required"`
|
|
DissallowNegativeInventory bool `json:"dissallow_negative_inventory"`
|
|
PICID *string `json:"pic_id"`
|
|
ClientID string `json:"client_id" binding:"required"`
|
|
}
|
|
|
|
type WarehouseUpdateRequest struct {
|
|
Code string `json:"code"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Status string `json:"status"`
|
|
DissallowNegativeInventory bool `json:"dissallow_negative_inventory"`
|
|
PICID *string `json:"pic_id"`
|
|
ClientID string `json:"client_id"`
|
|
}
|
|
|
|
type WarehouseResponse struct {
|
|
ID string `json:"id"`
|
|
Code string `json:"code"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Status string `json:"status"`
|
|
DissallowNegativeInventory bool `json:"dissallow_negative_inventory"`
|
|
Client pkgdto.IdNameResponse `json:"client"`
|
|
PIC *pkgdto.IdNameResponse `json:"pic"`
|
|
Zonas []WarehouseZonaResponse `json:"zones"`
|
|
}
|
|
|
|
type WarehouseZonaResponse struct {
|
|
ID string `json:"id"`
|
|
Code string `json:"code"`
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
Temperature string `json:"temperature"`
|
|
Hazardous bool `json:"hazardous"`
|
|
QRCodeZone string `json:"qr_code_zone"`
|
|
IsActive bool `json:"is_active"`
|
|
Client pkgdto.IdNameResponse `json:"client"`
|
|
Aisles []ZonaAisleResponse `json:"aisles"`
|
|
}
|
|
|
|
type ZonaAisleResponse struct {
|
|
ID string `json:"id"`
|
|
Code string `json:"code"`
|
|
Name string `json:"name"`
|
|
IsleX int `json:"isle_x"`
|
|
BinY int `json:"bin_y"`
|
|
LevelZ int `json:"level_z"`
|
|
DimLength float64 `json:"dim_length"`
|
|
DimWidth float64 `json:"dim_width"`
|
|
DimHeight float64 `json:"dim_height"`
|
|
Weight float64 `json:"weight"`
|
|
QrCodeAisle string `json:"qr_code_aisle"`
|
|
IsActive bool `json:"is_active"`
|
|
Zone pkgdto.IdNameResponse `json:"zone"`
|
|
DimUom pkgdto.IdNameResponse `json:"dim_uom_id"`
|
|
WeightUom pkgdto.IdNameResponse `json:"weight_uom_id"`
|
|
Client pkgdto.IdNameResponse `json:"client_id"`
|
|
}
|