from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import ProfileViewSet, OpportunityViewSet, IntroductionRequestViewSet, LeaderboardView, LeaderboardMeView
from recycle_core.views_api import (
    OrganizationViewSet,
    MaterialCategoryViewSet,
    MaterialViewSet,
    PriceListViewSet,
    PriceListItemViewSet,
    CustomerViewSet,
    CustomerSiteViewSet,
    ServiceAgreementViewSet,
    PickupOrderViewSet,
    PickupItemViewSet,
    WeighTicketViewSet,
    WeighLineViewSet,
    InvoiceViewSet,
    InvoiceLineViewSet,
    PaymentViewSet,
    PayoutViewSet,
    ScrapListingViewSet,
    ScrapListingItemViewSet,
    ScrapBidViewSet,
    ScrapAwardViewSet,
    ScrapListingInviteViewSet,
    DocumentViewSet,
    AuditLogViewSet,
)

router = DefaultRouter()
router.register(r'profiles', ProfileViewSet)
router.register(r'opportunities', OpportunityViewSet)
router.register(r'introduction-requests', IntroductionRequestViewSet)
router.register(r'organizations', OrganizationViewSet)
router.register(r'material-categories', MaterialCategoryViewSet)
router.register(r'materials', MaterialViewSet)
router.register(r'price-lists', PriceListViewSet)
router.register(r'price-list-items', PriceListItemViewSet)
router.register(r'customers', CustomerViewSet)
router.register(r'customer-sites', CustomerSiteViewSet)
router.register(r'service-agreements', ServiceAgreementViewSet)
router.register(r'pickups', PickupOrderViewSet)
router.register(r'pickup-items', PickupItemViewSet)
router.register(r'weigh-tickets', WeighTicketViewSet)
router.register(r'weigh-lines', WeighLineViewSet)
router.register(r'invoices', InvoiceViewSet)
router.register(r'invoice-lines', InvoiceLineViewSet)
router.register(r'payments', PaymentViewSet)
router.register(r'payouts', PayoutViewSet)
router.register(r'scrap-listings', ScrapListingViewSet)
router.register(r'scrap-listing-items', ScrapListingItemViewSet)
router.register(r'scrap-bids', ScrapBidViewSet)
router.register(r'scrap-awards', ScrapAwardViewSet)
router.register(r'scrap-listing-invites', ScrapListingInviteViewSet)
router.register(r'documents', DocumentViewSet)
router.register(r'audit-logs', AuditLogViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('leaderboard/', LeaderboardView.as_view({'get': 'list'})),
    path('leaderboard/me/', LeaderboardMeView.as_view({'get': 'list'})),
]
