public function getRegistrationSummary(User $user = null)
    {
        $data = $userData = [];

        // Gets user data
        if (null !== $user) {
            $userData = $this->repository->getRegistrationsSummaryForUser($user);
        }

        foreach ($this->appbox->get_databoxes() as $databox) {
            $data[$databox->get_sbas_id()] = [
                // Registrations on databox by type
                'registrations' => [
                    'by-type' => [
                        'inactive'  => [],
                        'accepted'  => [],
                        'in-time'   => [],
                        'out-dated' => [],
                        'pending'   => [],
                        'rejected'  => [],
                    ]
                ],
                // Registration configuration on databox and collections that belong to the databox
                'config' => [
                    'db-name'       => $databox->get_dbname(),
                    'cgu'           => $databox->get_cgus(),
                    'can-register'  => $databox->isRegistrationEnabled(),
                    // Configuration on collection
                    'collections'   => [],
                ]
            ];

            foreach ($databox->get_collections() as $collection) {
                // Sets collection info
                $data[$databox->get_sbas_id()]['config']['collections'][$collection->get_base_id()] = $this->getCollectionSummary($collection, $userData);
                // Sets registration by type
                if (null !== $registration = $this->getUserCollectionRegistration($collection, $userData)) {
                    $data[$databox->get_sbas_id()]['registrations']['by-type'][$registration['type']][] = $registration;
                }
            }
        }

        return $data;
    }