from django.urls import path
from .views import (
    LoginAPIView, ForgotPasswordAPIView, ResetPasswordAPIView,
    DashboardAPIView, BusinessListCreateAPIView, BusinessDetailAPIView,
    BusinessDocumentCreateAPIView, BusinessDocumentListAPIView, BusinessInvestorsAPIView, InvestorDocumentListAPIView,
    InvestorListCreateAPIView, InvestorDetailAPIView, InvestorPortfolioAPIView,
    SchemeListCreateAPIView, SchemeDetailAPIView,
    KuberBusinessInvestmentListCreateAPIView, KuberBusinessInvestmentDetailAPIView,
    InvestmentListCreateAPIView, InvestmentDetailAPIView,
    BalanceSheetListCreateAPIView, BalanceSheetDetailAPIView,
    LedgerListAPIView, GenerateDailyLedgerAPIView,
    PayoutListCreateAPIView, CertificateListCreateAPIView, CertificateDetailAPIView, CertificateAttachmentDeleteAPIView,
    AccountantListCreateAPIView, AccountantDetailAPIView, AccountantPermissionAPIView,
    RecurringContributionListCreateAPIView, RecurringContributionDetailAPIView,
    AuditLogListAPIView, RestoreBinAPIView, RestoreItemAPIView,
    ExportInvestmentsAPIView,
)

urlpatterns = [
    path("auth/login/", LoginAPIView.as_view()),
    path("auth/forgot-password/", ForgotPasswordAPIView.as_view()),
    path("auth/reset-password/", ResetPasswordAPIView.as_view()),

    path("dashboard/", DashboardAPIView.as_view()),

    path("businesses/", BusinessListCreateAPIView.as_view()),
    path("businesses/<int:pk>/", BusinessDetailAPIView.as_view()),
    path("businesses/<int:business_id>/documents/", BusinessDocumentListAPIView.as_view()),
    path("businesses/<int:business_id>/documents/add/", BusinessDocumentCreateAPIView.as_view()),
    path("businesses/<int:business_id>/investors/", BusinessInvestorsAPIView.as_view()),

    path("investors/", InvestorListCreateAPIView.as_view()),
    path("investors/<int:pk>/", InvestorDetailAPIView.as_view()),
    path("investors/<int:pk>/portfolio/", InvestorPortfolioAPIView.as_view()),
    path("investors/<int:investor_id>/documents/", InvestorDocumentListAPIView.as_view()),

    path("schemes/", SchemeListCreateAPIView.as_view()),
    path("schemes/<int:pk>/", SchemeDetailAPIView.as_view()),

    path("kuber-investments/", KuberBusinessInvestmentListCreateAPIView.as_view()),
    path("kuber-investments/<int:pk>/", KuberBusinessInvestmentDetailAPIView.as_view()),

    path("investments/", InvestmentListCreateAPIView.as_view()),
    path("investments/<int:pk>/", InvestmentDetailAPIView.as_view()),
    path("investments/<int:investment_id>/recurring-contributions/", RecurringContributionListCreateAPIView.as_view()),
    path("investments/<int:investment_id>/recurring-contributions/<int:pk>/", RecurringContributionDetailAPIView.as_view()),

    path("balance-sheets/", BalanceSheetListCreateAPIView.as_view()),
    path("balance-sheets/<int:pk>/", BalanceSheetDetailAPIView.as_view()),

    path("ledger/", LedgerListAPIView.as_view()),
    path("ledger/generate-daily/", GenerateDailyLedgerAPIView.as_view()),
    path("payouts/", PayoutListCreateAPIView.as_view()),

    path("certificates/", CertificateListCreateAPIView.as_view()),
    path("certificates/<int:pk>/", CertificateDetailAPIView.as_view()),
    path("certificates/<int:pk>/attachments/<int:attachment_id>/", CertificateAttachmentDeleteAPIView.as_view()),

    path("accountants/", AccountantListCreateAPIView.as_view()),
    path("accountants/<int:pk>/", AccountantDetailAPIView.as_view()),
    path("accountants/<int:pk>/permissions/", AccountantPermissionAPIView.as_view()),

    path("audit/", AuditLogListAPIView.as_view()),
    path("restore-bin/", RestoreBinAPIView.as_view()),
    path("restore/<str:resource>/<int:pk>/", RestoreItemAPIView.as_view()),

    path("exports/investments.xlsx", ExportInvestmentsAPIView.as_view()),
]
