96 lines
4.4 KiB
Go
96 lines
4.4 KiB
Go
package dto
|
|
|
|
import pkgdto "github.com/Caknoooo/go-gin-clean-starter/pkg/dto"
|
|
|
|
const (
|
|
MESSAGE_FAILED_CREATE_INVENTORY_REQUEST = "failed create inventory request"
|
|
MESSAGE_FAILED_CREATE_INVENTORY_REQUEST_LINE = "failed create inventory request line"
|
|
MESSAGE_SUCCESS_CREATE_INVENTORY_REQUEST = "success create inventory request"
|
|
MESSAGE_SUCCESS_CREATE_INVENTORY_REQUEST_LINE = "success create inventory request line"
|
|
MESSAGE_FAILED_GET_INVENTORY_REQUEST = "failed get inventory request"
|
|
MESSAGE_SUCCESS_GET_INVENTORY_REQUEST = "success get inventory request"
|
|
MESSAGE_FAILED_UPDATE_INVENTORY_REQUEST = "failed update inventory request"
|
|
MESSAGE_FAILED_UPDATE_INVENTORY_REQUEST_LINE = "failed update inventory request line"
|
|
MESSAGE_SUCCESS_UPDATE_INVENTORY_REQUEST = "success update inventory request"
|
|
MESSAGE_SUCCESS_UPDATE_INVENTORY_REQUEST_LINE = "success update inventory request line"
|
|
MESSAGE_FAILED_DELETE_INVENTORY_REQUEST = "failed delete inventory request"
|
|
MESSAGE_FAILED_DELETE_INVENTORY_REQUEST_LINE = "failed delete inventory request line"
|
|
MESSAGE_SUCCESS_DELETE_INVENTORY_REQUEST = "success delete inventory request"
|
|
MESSAGE_SUCCESS_DELETE_INVENTORY_REQUEST_LINE = "success delete inventory request line"
|
|
MESSAGE_FAILED_GET_DATA_FROM_BODY = "failed get data from body"
|
|
)
|
|
|
|
type InventoryRequestCreateRequest struct {
|
|
ReferenceNumber string `json:"reference_number"`
|
|
// DocumentNumber string `json:"document_number"`
|
|
DueDate string `json:"due_date"`
|
|
RequestType string `json:"request_type"`
|
|
Note string `json:"note"`
|
|
ClientID string `json:"client_id" binding:"required"`
|
|
Status string `json:"status"`
|
|
RequestLines []InventoryRequestLineCreateRequest `json:"request_lines,omitempty" binding:"dive"`
|
|
}
|
|
|
|
type InventoryRequestLineCreateRequest struct {
|
|
Quantity float64 `json:"quantity"`
|
|
ProductID string `json:"product_id"`
|
|
ClientID string `json:"client_id"`
|
|
}
|
|
|
|
type InventoryRequestUpdateRequest struct {
|
|
ReferenceNumber string `json:"reference_number"`
|
|
DocumentNumber string `json:"document_number"`
|
|
DueDate string `json:"due_date"`
|
|
RequestType string `json:"request_type"`
|
|
Note string `json:"note"`
|
|
Status string `json:"status"`
|
|
}
|
|
|
|
type InventoryRequestResponse struct {
|
|
ID string `json:"id"`
|
|
ReferenceNumber string `json:"reference_number"`
|
|
DocumentNumber string `json:"document_number"`
|
|
DueDate string `json:"due_date"`
|
|
RequestType string `json:"request_type"`
|
|
Note string `json:"note"`
|
|
Status string `json:"status"`
|
|
Client pkgdto.IdNameResponse `json:"client"`
|
|
RequestLines []InventoryRequestLineResponse `json:"request_lines"`
|
|
LineCount int `json:"line_count"`
|
|
Assignment AssignmentResponse `json:"assignment,omitempty"`
|
|
}
|
|
|
|
type AssignmentResponse struct {
|
|
ID string `json:"id"`
|
|
DocumentType string `json:"document_type"`
|
|
DocumentID string `json:"document_id"`
|
|
AssignmentUsers []AssignmentUserResponse `json:"assignment_users"`
|
|
}
|
|
|
|
type AssignmentUserResponse struct {
|
|
ID string `json:"id"`
|
|
TaskType string `json:"task_type"`
|
|
User pkgdto.IdNameResponse `json:"user"`
|
|
Role pkgdto.IdNameResponse `json:"role"`
|
|
}
|
|
|
|
type InventoryRequestLineResponse struct {
|
|
ID string `json:"id"`
|
|
Quantity float64 `json:"quantity"`
|
|
CurrentStock float64 `json:"current_stock"`
|
|
Product InventoryRequestLineProductResponse `json:"product"`
|
|
ClientID string `json:"client_id"`
|
|
}
|
|
|
|
type InventoryRequestLineProductResponse struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
RefNumber string `json:"ref_number"`
|
|
Uom pkgdto.IdNameResponse `json:"uom"`
|
|
}
|
|
|
|
type InventoryRequestLineUpdateRequest struct {
|
|
Quantity *float64 `json:"quantity"`
|
|
ProductID *string `json:"product_id"`
|
|
}
|