All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 30s
95 lines
2.6 KiB
Python
95 lines
2.6 KiB
Python
from django.contrib import admin
|
|
from .models import VendorConfig, VerificationTransaction, VendorAttemptLog, PANDetails, SellerBankVerification
|
|
|
|
|
|
class VendorAttemptLogInline(admin.TabularInline):
|
|
model = VendorAttemptLog
|
|
extra = 0
|
|
readonly_fields = (
|
|
"attempt_number",
|
|
"vendor_name",
|
|
"status",
|
|
"is_success",
|
|
"latency_ms",
|
|
"error_code",
|
|
"error_message",
|
|
"created_at",
|
|
)
|
|
can_delete = False
|
|
|
|
|
|
@admin.register(VendorConfig)
|
|
class VendorConfigAdmin(admin.ModelAdmin):
|
|
list_display = ("name", "display_name", "priority", "is_active", "base_url", "updated_at")
|
|
list_editable = ("priority", "is_active")
|
|
search_fields = ("name", "display_name")
|
|
list_filter = ("is_active",)
|
|
|
|
|
|
@admin.register(VerificationTransaction)
|
|
class VerificationTransactionAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"reference_id",
|
|
"document_type",
|
|
"status",
|
|
"successful_vendor",
|
|
"attempts_count",
|
|
"total_latency_ms",
|
|
"created_at",
|
|
)
|
|
list_filter = ("status", "document_type", "successful_vendor", "created_at")
|
|
search_fields = ("reference_id", "document_type", "successful_vendor")
|
|
readonly_fields = (
|
|
"reference_id",
|
|
"document_type",
|
|
"status",
|
|
"successful_vendor",
|
|
"input_payload",
|
|
"final_data",
|
|
"response_payload",
|
|
"attempts_count",
|
|
"total_latency_ms",
|
|
"created_at",
|
|
"updated_at",
|
|
)
|
|
inlines = [VendorAttemptLogInline]
|
|
|
|
|
|
@admin.register(PANDetails)
|
|
class PANDetailsAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"document_id",
|
|
"name",
|
|
"category",
|
|
"date_of_birth",
|
|
"gender",
|
|
"city",
|
|
"state",
|
|
"pincode",
|
|
"aadhaar_linked",
|
|
"created_at",
|
|
)
|
|
list_filter = ("category", "gender", "aadhaar_linked", "taxpayer_profile", "state", "created_at")
|
|
search_fields = ("document_id", "name", "email", "phone", "city", "pincode", "request_id")
|
|
readonly_fields = ("created_at", "updated_at")
|
|
|
|
|
|
@admin.register(SellerBankVerification)
|
|
class SellerBankVerificationAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"seller_id",
|
|
"beneficiary_name",
|
|
"account_number",
|
|
"ifsc",
|
|
"account_ifsc",
|
|
"is_valid",
|
|
"status",
|
|
"vendor_name",
|
|
"tranx_id",
|
|
"latency_ms",
|
|
"updated_at",
|
|
)
|
|
list_filter = ("is_valid", "status", "vendor_name", "created_at")
|
|
search_fields = ("seller_id", "beneficiary_name", "account_number", "ifsc", "tranx_id")
|
|
readonly_fields = ("created_at", "updated_at")
|
|
|