Repository navigation
Profiles Endpoints
This page details the Profiles endpoints in The Wall API, responsible for tracking and managing cost calculations related to wall construction.
- Overview
- API Requests Flow Diagram
- Profiles Endpoints
-
Profiles Endpoints Views
4.1 Class Architecture
4.2 Throttling Mechanisms
4.3 OpenAPI Schema Documentation
4.4 Core DRF Components -
Wall Data ORM Representation
5.1 Data Model Overview
5.2 Key Operational Behaviors
-
Construction progress querying is a core functionality in The Wall API, allowing users to perform the following operations:
✔ Retrieve daily construction cost for a specific profile.
✔ Retrieve aggregated daily cost across all profiles.
✔ Retrieve total accumulated build cost for all profiles.
✔ Retrieve daily amounts of ice used for a specific profile. -
Authentication is required for all requests, and API rate limits ensure fair access to resources.
-
The cost calculations are based on wall construction simulations, ensuring that each request retrieves precise cost estimates for a specific profile or the entire wall.
The following diagram illustrates the API request flow for profiles endpoints queries. It outlines how the system processes requests for cost calculations, handles concurrent tasks, and determines whether to fetch cached results, perform synchronous calculations, or delegate computations to Celery.

| Action | Endpoint | Requires Authentication? |
|---|---|---|
| Daily Profile Cost | /api/v2/profiles/<int:profile_id>/overview/<int:day>/ |
✅ Yes |
| Daily Wall Cost | /api/v2/profiles/overview/<int:day>/ |
✅ Yes |
| Total Wall Cost | /api/v2/profiles/overview/ |
✅ Yes |
| Daily Profile Ice Amount | /api/v2/profiles/<int:profile_id>/days/<int:day>/ |
✅ Yes |
💡 API Access Overview - Full API endpoints breakdown and applied throttling rates.
💡 Detailed Cost and Resource Calculations - In-depth explanations of cost computation logic.
💡 Detailed OpenAPI Documentation - Comprehensive details on each profiles endpoint and its parameters.
Wall progress tracking data in The Wall API is retrieved through dedicated Django Rest Framework (DRF) views, which handle authentication, request validation, and structured API documentation.
-
Base Class:
ProfilesBaseView(inheritsAPIView)- Centralizes throttling (
UserRateThrottle), and request validation. - Implements a shared request processing method (
process_profiles_request) to extract query parameters, validate them, and retrieve simulation data. - Provides structured error handling and response formatting for all profile-related endpoints.
- Centralizes throttling (
-
Derived Views:
-
ProfilesDaysView– Retrieves daily ice usage for a specific profile. -
ProfilesOverviewView– Returns aggregated costs for the entire wall construction. -
ProfilesOverviewDayView– Fetches daily total cost for all actively constructed profiles. -
SingleProfileOverviewDayView– Retrieves cost for a specific profile on a given day.
-
-
Design Rationale
-
Separation of concerns:
ProfilesBaseViewensures consistent validation, authentication, and data retrieval, while each derived view is responsible for a specific type of cost computation, reducing redundant logic. -
Extendable API documentation: Each view applies
@extend_schemafrom drf-spectacular, ensuring distinct and structured documentation for every endpoint.
-
Separation of concerns:
- API requests are rate-limited under the Authenticated throttle scope, preventing excessive usage.
- The API ensures optimized resource distribution by limiting requests based on demand.
💡 For more details on API throttling, see the API Throttling page.
- Profiles endpoints are documented with DRF Spectacular, ensuring structured and consistent schema definitions.
💡 Check DRF Spectacular for API documentation and schema generation details.
The following DRF files manage profiles endpoints-related data:
-
the_wall_api/views.py– Defines API views for retrieving cost and ice usage data. -
config/urls.py– Maps profiles API endpoints. -
the_wall_api/utils/api_utils.py– Manages profiles endpoints registration within the centralized API configuration. -
the_wall_api/serializers.py– Structures and validates the profiles endpoints API requests. -
config/settings.py– Controls authentication, permissions, and rate-limiting configuration.-
Global authentication and permissions are configured in
REST_FRAMEWORK:💡 These settings enforce token-based authentication, ensuring only authenticated users can query wall configuration data.REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.TokenAuthentication', ], 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.IsAuthenticated', ], }
-
Global authentication and permissions are configured in
-
The Wall API uses database models to manage cost-tracking for different construction profiles.
-
WallConfig: Stores wall configurations and associated cost parameters.
💡 See WallConfig ORM Model. -
Wall: Represents a simulated build using aWallConfig.
💡 Check Wall ORM Model. -
WallProgress: Tracks daily progress, costs, and ice usage.
💡 See WallProgress ORM Model.
-
-
Each
Wallinstance represents a complete construction simulation, tracking costs and resource consumption. -
Daily cost calculations are performed per
WallProgressinstance, which records the ice amount used and monetary cost for each simulated day. -
Aggregated daily costs combine all ongoing builds for a given day.
-
Total cost computations aggregate all recorded daily costs from all builds.
-
The profiles' progress and costs are stored in a structured manner, ensuring accurate and scalable cost estimation for different construction scenarios.
Next: Error Handling
Back to: File Management Endpoints
Return to Top
DTS Index
Home Page
📌 Notable Technical Sections
👤 Author
LinkedIn: Aleksandar Dimitrov
Yahoo: sasho_1983@yahoo.com