
class IDMapper:
    @staticmethod
    def public_id_mapper(public_id, model):
        """
        Get the database ID if an object with the given public ID exists.

        Args:
        - public_id: Public ID of the object to check.
        - model: The model class to search for the object.

        Returns:
        - The database ID if an object with the given public ID exists, None otherwise.
        """
        obj = model.objects(public_id=public_id).first()
        return obj.id if obj else None
    
class ExistChecker:
    @staticmethod
    def exist(name, model):
        """
        Check if an object with the given name already exists.

        Args:
            - name: Name of the object to check.
            - model: The model class to search for the object.

        Returns:
            - True if an object with the given name exists, False otherwise.
        """
        obj = model.objects(name=name).first()
        return obj is not None