package utils

import (
	"encoding/json"
	"fmt"
)

func ParseAuditDetails(details string) (map[string]any, error) {
	var payload map[string]any
	if details == "" {
		return nil, fmt.Errorf("empty details")
	}
	if err := json.Unmarshal([]byte(details), &payload); err != nil {
		return nil, err
	}
	return payload, nil
}
