wms-be/modules/inventory_receipt/dto/inventory_receipt_dto.go

88 lines
4.4 KiB
Go

package dto
import pkgdto "github.com/Caknoooo/go-gin-clean-starter/pkg/dto"
const (
MESSAGE_FAILED_CREATE_INVENTORY_RECEIPT = "failed create inventory receipt"
MESSAGE_FAILED_CREATE_INVENTORY_RECEIPT_LINE = "failed create inventory receipt line"
MESSAGE_SUCCESS_CREATE_INVENTORY_RECEIPT = "success create inventory receipt"
MESSAGE_SUCCESS_CREATE_INVENTORY_RECEIPT_LINE = "success create inventory receipt line"
MESSAGE_FAILED_GET_INVENTORY_RECEIPT = "failed get inventory receipt"
MESSAGE_SUCCESS_GET_INVENTORY_RECEIPT = "success get inventory receipt"
MESSAGE_FAILED_UPDATE_INVENTORY_RECEIPT = "failed update inventory receipt"
MESSAGE_FAILED_UPDATE_INVENTORY_RECEIPT_LINE = "failed update inventory receipt line"
MESSAGE_SUCCESS_UPDATE_INVENTORY_RECEIPT = "success update inventory receipt"
MESSAGE_SUCCESS_UPDATE_INVENTORY_RECEIPT_LINE = "success update inventory receipt line"
MESSAGE_FAILED_DELETE_INVENTORY_RECEIPT = "failed delete inventory receipt"
MESSAGE_FAILED_DELETE_INVENTORY_RECEIPT_LINE = "failed delete inventory receipt line"
MESSAGE_SUCCESS_DELETE_INVENTORY_RECEIPT = "success delete inventory receipt"
MESSAGE_SUCCESS_DELETE_INVENTORY_RECEIPT_LINE = "success delete inventory receipt line"
MESSAGE_FAILED_GET_DATA_FROM_BODY = "failed get data from body"
)
type InventoryReceiptCreateRequest struct {
ReferenceNumber string `json:"reference_number"`
ReceiptDate string `json:"receipt_date"`
Source string `json:"source"`
QrCodeFile string `json:"qr_code_file"`
ClientID string `json:"client_id" binding:"required"`
ReceiptLines []InventoryReceiptLineCreateRequest `json:"inventory_lines,omitempty" binding:"dive"`
}
type InventoryReceiptLineCreateRequest struct {
Quantity float64 `json:"quantity"`
BatchNumber string `json:"batch_number"`
RepackingSuggestion string `json:"repacking_suggestion"`
RepackUomID string `json:"repack_uom_id"`
ProductID string `json:"product_id"`
ClientID string `json:"client_id"`
}
type InventoryReceiptUpdateRequest struct {
ReferenceNumber string `json:"reference_number"`
ReceiptDate string `json:"receipt_date"`
Source string `json:"source"`
QrCodeFile string `json:"qr_code_file"`
}
type InventoryReceiptResponse struct {
ID string `json:"id"`
ReferenceNumber string `json:"reference_number"`
DocumentNumber string `json:"document_number"`
ReceiptDate string `json:"receipt_date"`
Source string `json:"source"`
QrCodeFile string `json:"qr_code_file"`
Client pkgdto.IdNameResponse `json:"client"`
ReceiptLines []InventoryReceiptLineResponse `json:"inventory_lines"`
LineCount int `json:"line_count"`
}
type InventoryReceiptLineResponse struct {
ID string `json:"id"`
Quantity float64 `json:"quantity"`
BatchNumber string `json:"batch_number"`
RepackingSuggestion string `json:"repacking_suggestion"`
RepackUomID *string `json:"repack_uom_id"`
Product InventoryReceiptLineProductResponse `json:"product"`
ClientID string `json:"client_id"`
}
type InventoryReceiptLineProductResponse struct {
ID string `json:"id"`
Name string `json:"name"`
RefNumber string `json:"ref_number"`
Uom pkgdto.IdNameResponse `json:"uom"`
DimLength float64 `json:"dim_length"`
DimWidth float64 `json:"dim_width"`
DimHeight float64 `json:"dim_height"`
DimUom pkgdto.IdNameResponse `json:"dim_uom"`
}
type InventoryReceiptLineUpdateRequest struct {
Quantity *float64 `json:"quantity"`
BatchNumber *string `json:"batch_number"`
RepackingSuggestion *string `json:"repacking_suggestion"`
RepackUomID *string `json:"repack_uom_id"`
ProductID *string `json:"product_id"`
}