feat: implement component-item management with CRUD operations and status updates
This commit is contained in:
28
internal/models/responses/component_item_response.go
Normal file
28
internal/models/responses/component_item_response.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package responses
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
type CreateComponentItemResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type UpdateComponentItemResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
ComponentID int64 `json:"componentId"`
|
||||
ContainerID int64 `json:"containerId"`
|
||||
Quantity int32 `json:"quantity"`
|
||||
Status string `json:"status"`
|
||||
Metadata json.RawMessage `json:"metadata"`
|
||||
}
|
||||
|
||||
// UpdateComponentItemStatusResponse represents the response for a status change operation.
|
||||
// Different fields are populated depending on the case (change all, split, merge).
|
||||
type UpdateComponentItemStatusResponse struct {
|
||||
ID int64 `json:"id"`
|
||||
OldStatus string `json:"oldStatus"`
|
||||
NewStatus string `json:"newStatus"`
|
||||
ChangedQuantity int32 `json:"changedQuantity"`
|
||||
HistoryID int64 `json:"historyId"`
|
||||
NewComponentItemID *int64 `json:"newComponentItemId,omitempty"`
|
||||
MergedComponentItemID *int64 `json:"mergedComponentItemId,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user