Restore the monthly fleet archive task and routes so generated ZIP downloads work again. Also populate service report DOCX headers from the selected task/work-order context and cover the direct and archived export flows with regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
35 lines
2.4 KiB
Python
35 lines
2.4 KiB
Python
from rest_framework.routers import DefaultRouter
|
|
from django.urls import path
|
|
from .views import (
|
|
CraneViewSet, VehicleViewSet, WorkOrderViewSet, VehicleServiceRecordViewSet,
|
|
WorkOrderInvoiceViewSet, ServiceContextNoteViewSet, VehicleNotificationViewSet, VehicleServicePhotoViewSet, VehicleServiceAttachmentViewSet, pusher_auth,
|
|
monthly_servicer_report_docx, monthly_costs_report_docx, MonthlyServicerDayEntryViewSet,
|
|
monthly_service_tasks_archive, monthly_service_tasks_archive_request,
|
|
monthly_work_orders_archive, monthly_work_orders_archive_request,
|
|
generated_archive_download,
|
|
)
|
|
|
|
router = DefaultRouter()
|
|
router.register(r'vehicles', VehicleViewSet, basename='vehicle')
|
|
router.register(r'cranes', CraneViewSet, basename='crane')
|
|
router.register(r'work-orders', WorkOrderViewSet, basename='workorder')
|
|
router.register(r'work-order-invoices', WorkOrderInvoiceViewSet, basename='work-order-invoice')
|
|
router.register(r'service-notes', ServiceContextNoteViewSet, basename='service-context-note')
|
|
router.register(r'service-records', VehicleServiceRecordViewSet, basename='service-record')
|
|
router.register(r'notifications', VehicleNotificationViewSet, basename='vehicle-notification')
|
|
router.register(r'service-photos', VehicleServicePhotoViewSet, basename='service-photo')
|
|
router.register(r'service-attachments', VehicleServiceAttachmentViewSet, basename='service-attachment')
|
|
router.register(r'monthly-servicer-day-entries', MonthlyServicerDayEntryViewSet, basename='monthly-servicer-day-entry')
|
|
|
|
urlpatterns = router.urls
|
|
|
|
urlpatterns += [
|
|
path('pusher-auth/', pusher_auth, name='pusher-auth'),
|
|
path('reports/monthly-servicer/', monthly_servicer_report_docx, name='monthly-servicer-report'),
|
|
path('reports/monthly-costs/', monthly_costs_report_docx, name='monthly-costs-report'),
|
|
path('reports/monthly-service-tasks-archive/', monthly_service_tasks_archive, name='monthly-service-tasks-archive'),
|
|
path('reports/monthly-service-tasks-archive-request/', monthly_service_tasks_archive_request, name='monthly-service-tasks-archive-request'),
|
|
path('reports/monthly-work-orders-archive/', monthly_work_orders_archive, name='monthly-work-orders-archive'),
|
|
path('reports/monthly-work-orders-archive-request/', monthly_work_orders_archive_request, name='monthly-work-orders-archive-request'),
|
|
path('reports/generated-archives/<str:archive_id>/download/', generated_archive_download, name='generated-archive-download'),
|
|
] |