25 lines
956 B
Go
25 lines
956 B
Go
package requests
|
|
|
|
import "encoding/json"
|
|
|
|
type CreateComponentItemRequest struct {
|
|
ComponentID int64 `json:"componentId" binding:"required"`
|
|
ContainerID int64 `json:"containerId" binding:"required"`
|
|
Quantity int32 `json:"quantity" binding:"required"`
|
|
Status string `json:"status" binding:"required"`
|
|
Metadata json.RawMessage `json:"metadata"`
|
|
}
|
|
|
|
type UpdateComponentItemRequest struct {
|
|
ComponentID *int64 `json:"componentId"`
|
|
ContainerID *int64 `json:"containerId"`
|
|
Metadata json.RawMessage `json:"metadata"`
|
|
}
|
|
|
|
// UpdateComponentItemStatusRequest represents the request body for changing the status of a component item.
|
|
type UpdateComponentItemStatusRequest struct {
|
|
Status string `json:"status" binding:"required,oneof=normal damaged long_unused expired pending_inspection"`
|
|
ChangedQuantity *int32 `json:"changedQuantity"`
|
|
Note string `json:"note"`
|
|
}
|