from helpers.either import Either, Left, Right
from models.error_string_model import ErrorStringModel
from repository import freecad_repository


class IsAllObjectSolidsCheckUseCase:
    def call() -> Either:
        result = freecad_repository().isAllObjectsSolids()
        if result.__len__() == 0:
            return Left(None)

        return Right(
            ErrorStringModel(error="Is not solid objects: " + ",".join(result))
        )
