Get dashboard notifications and pending actions
GET/company/notifications/dashboard
Retrieve consolidated information for the company's notification dashboard, including unread notifications and alerts for pending actions such as unsigned auctions.
Objective
Enable companies to view all critical alerts and pending notifications in a single endpoint, optimizing the user experience on the main dashboard.
Use Cases
- Main Dashboard: Initial load of the company dashboard
- Real-time Update: Periodic refresh of notifications
- Signature Alerts: Reminder for auctions pending signature by the company
- Activity Monitor: Tracking of unread notifications
Data Flow
The endpoint implements a prioritization system with limited slots (maximum 6 items):
flowchart TD
A[Request Dashboard] --> B{User Authenticated?}
B -->|No| C[404 USER_NOT_FOUND]
B -->|Yes| D{Company Exists?}
D -->|No| E[401 CIA_NOT_FOUND]
D -->|Yes| F[Get Company Data]
F --> G{Missing Signature?}
G -->|Yes| H[companyMissingSignature: true]
G -->|No| I[companyMissingSignature: false]
H --> J[Find Auctions Without Signature]
I --> J
J --> K{Count > 6?}
K -->|Yes| L[Limit: 6 Auctions]
K -->|No| M[Use All Auctions]
L --> N[Calculate Available Slots]
M --> N
N --> O{Slots > 0?}
O -->|No| P[Return Dashboard]
O -->|Yes| Q[Get Unread Notifications]
Q --> R[Fill Available Slots]
R --> S[Return Dashboard - 200]
Response Fields
companyMissingSignature (boolean):
true: The company has not completed its signature processfalse: The company has a registered signature
notSignedAuctionsCount (number, range 0-6):
- Count of awarded auctions that the company has not signed
- Maximum value: 6 (system limit)
- Each unsigned auction occupies a slot on the dashboard
notSignedAuctions (array):
- List of auctions pending signature
- Each element contains only the
service_codefield - Format: `[{service_code: AU12345}, {service_code: AU
Request
Responses
- 200
- 401
- 404
Dashboard of notifications successfully retrieved.
The response object contains up to 6 items distributed between:
- Auctions pending signature (highest priority)
- Unread notifications (fill the remaining slots)
Unauthorized. The user does not have an associated company or the token is invalid.
CIA_NOT_FOUND:
- The authenticated user does not have an assigned company
- The company was deactivated or deleted
- The
usersfield in the companies collection does not match the user
User not found. The JWT token does not correspond to a valid user in the system.
USER_NOT_FOUND:
- The token contains a user ID that does not exist
- The user was deleted after the token was generated