from typing import List
from typing import Dict
from typing import Any
from typing import Tuple
from typing import Optional


def prepare_outputs_for_categories(records: List[Dict[str, Any]]) -> \
        Tuple[List[Dict[str, Optional[Any]]], List[Dict[str, Optional[Any]]]]:
    """
    Prepares human readables and context output for 'bmc-remedy-category-details-get' command.

    :param records: List containing records of categories from rest API.
    :return: Tuple containing human-readable and context-ouputs.
    """
    outputs = list()
    hr_output = list()
    for each_record in records:
        temp = dict()
        temp1 = dict()
        temp["Id"] = temp1["Id"] = each_record.get("Id")
        temp["Name"] = temp1["Name"] = each_record.get("Name")
        temp["Children Count"] = temp1["ChildrenCount"] = each_record.get("BMCServiceDesk__children__c")
        hr_output.append(temp)
        outputs.append(temp1)
    return hr_output, outputs