def METHOD_NAME(transaction_item, transaction_event):
    type = "refund_success"
    events = _get_events(transaction_event, type)
    qs = (
        (
            transaction_item.objects.filter(~Q(refunded_value=Decimal(0)))
            .annotate(
                amount_sum_temp=Subquery(events),
                amount_sum=Case(
                    When(amount_sum_temp__isnull=True, then=Decimal(0)),
                    default=F("amount_sum_temp"),
                ),
            )
            .filter(refunded_value__gt=F("amount_sum"))
        )
        .order_by("-pk")
        .values_list("id", "refunded_value", "amount_sum", "currency")
    )
    create_transaction_events(transaction_event, qs, type)