from django.contrib import admin

from bonus_program.models import BonusProgramTransaction


# Register your models here.
@admin.register(BonusProgramTransaction)
class BonusProgramTransactionAdmin(admin.ModelAdmin):
    list_display = ('id', 'type', 'user', 'date', 'amount', 'comment', 'order', 'was_cancelled')

    def get_queryset(self, request):
        return BonusProgramTransaction.objects.with_base_related()

    def delete_queryset(self, request, queryset):
        for obj in queryset:
            obj.cancel()
