def METHOD_NAME(loan,
                                 notification_type=NotificationType.OVERDUE):
    """Get the number of notifications sent for the given loan.
    :param loan: the parent loan.
    :param notification_type: the type of notification to find.
    :return notification counter.
    """
    trans_date = ciso8601.parse_datetime(loan.get('transaction_date'))
    return NotificationsSearch()\
        .filter('term', context__loan__pid=loan.pid)\
        .filter('term', notification_type=notification_type) \
        .filter('term', notification_sent=True) \
        .filter('range', creation_date={'gt': trans_date}) \
        .source().count()