# stdlib import

# django imports
from django.contrib import admin

# project imports
from djangoflutterwave.models import DRPlanModel, DRTransactionModel

# project imports


class PlanAdmin(admin.ModelAdmin):
    list_display = ("name", "amount", "flw_plan_id")
    search_fields = ("name",)
    readonly_fields = ("created_datetime",)


class TransactionAdmin(admin.ModelAdmin):
    list_display = ("user", "plan", "tx_ref", "amount", "created_datetime")
    search_fields = ("user__username", "plan__name", "tx_ref")
    readonly_fields = ("created_datetime",)


admin.site.register(DRPlanModel, PlanAdmin)
admin.site.register(DRTransactionModel, TransactionAdmin)
