package handlers

import (
	"strings"

	responsedto "wucher/internal/transport/http/dto/response"
)

func fileManagerActionResultResource(resourceType string, id []byte, status string, locationFolderID string) responsedto.FileManagerActionResultResource {
	result := responsedto.FileManagerActionResultResource{
		Type: resourceType,
		ID:   uuidStringOrEmpty(id),
		Attributes: responsedto.FileManagerActionResultAttributes{
			Status: strings.TrimSpace(status),
		},
	}

	locationFolderID = strings.TrimSpace(locationFolderID)
	if locationFolderID != "" {
		result.Attributes.Location = &responsedto.FileManagerActionLocation{
			FolderID: locationFolderID,
		}
	}

	return result
}
