.extra(select={'day': 'DAY(create_time)'}) uses Django field name but
Inquiry.create_time has db_column='CreateTime' causing SQL Server error.
TruncDate is the proper ORM approach for date truncation.
Backend: Response() now returns {code:200, msg, data: {buyer, supplier}}
Frontend: store extracts buyer/supplier from res.data since axios interceptor returns full response
The serializers.py had incomplete field definitions - missing the deadline
and method fields that views.py correctly builds. Also fixed quantity type
(CharField to match view's empty string fallback) and added status field
to SupplierQuoteSerializer.
BuyerDashboard API:
- Add buying_method, quote_deadline, bid_start_time, bid_end_time to tasks
- Add daily trend data with day field instead of monthly
SupplierDashboard API:
- Add buying_method, quote_deadline, bid_start_time, bid_end_time to pending_quotes
- Add daily trend data with day field instead of monthly
These fields are needed by the frontend to display procurement method
badges and deadline countdown with color-coded urgency.
- Fix superadmin supplier dashboard: show all quotes instead of filtering by username
- Fix Count('id') -> Count('autoid') in trend queries
- Add quote_timely_rate, on_time_quotes, overdue_quotes to supplier KPI
- Add status field to supplier pending quotes
- Buyer chart now uses real trend data from backend
- Supplier quote list height matches buyer task list
- Remove KPI card top color bars
- Enlarge KPI card text (title: 18px, value: 52px) and center align
- pytest.ini: use application.test_settings for MSSQL compatibility
- conftest.py: move to backend root; use UserFactory with Sequence
- application/test_settings.py: NoCreateTestDatabase patch for MSSQL
- test_serializers.py: use chinese error keys (django_restql behavior)
- test_views.py: use API response code assertions (SuccessResponse format)
Backend:
- Fix JWT auth header format (use "JWT " prefix)
- Fix DashboardView to return data for superadmin users
- Return empty structure when no business data exists
- Use serializers for response validation
Frontend:
- Redesign BuyerDashboard with new UI matching design spec
- Redesign SupplierDashboard with consistent styling
- Add role switcher for users with both buyer/supplier roles
- Fix FontAwesome icon class names (fa vs fas)
- Update tagsView title when switching roles via mitt event
- Add i18n translations for dashboard
Auth fixes:
- Fix token storage to use sessionStorage instead of Cookies
- Add route initialization guard to prevent duplicate routing
- Fix login flow for token handling
Files:
- Add BuyerDashboard, SupplierDashboard, KpiCard, TrendChart components
- Add dashboard API and Pinia store
- Add mitt event type for tagsView name update
- Move serializers into views.py for self-contained CBV
- Use DashboardViewSet with list() method for GET
- Add proper docstrings
- Use serializer for response validation