53 lines
2.1 KiB
Go
53 lines
2.1 KiB
Go
package dto
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
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"`
|
|
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"`
|
|
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"`
|
|
ClientID string `json:"client_id"`
|
|
}
|