📊 Activity Suggestion Entity

Represents a suggested physical activity tailored to the user's context including preferences, location, weather, and available equipment.

core 🔑 Primary Key: id

📈 Entity Statistics

📋 Attributes

9

0 required, 0 unique

🔍 Indexes

3

Database performance indexes

✅ Validations

2

Data integrity rules

⚡ Operations

4

Allowed CRUD operations

📝 Entity Overview

The Activity Suggestion entity is central to delivering personalized physical activity recommendations to children and youth, leveraging contextual data such as location, weather, and equipment availability. By tailoring suggestions to individual circumstances, it reduces barriers to physical activity, increases engagement, and supports public health goals. This entity enables the platform to provide relevant, safe, and motivating activity options, thereby driving increased usage and positive health outcomes among the target demographic.

Implementing the Activity Suggestion entity requires integration with multiple external services including weather-service, location-service, and equipment-availability-service to ensure accurate filtering and relevance. The entity must support CRUD operations primarily managed by the activity-suggestion-engine, with read access also provided to the activity-suggestion-wheel for UI rendering. Validation rules enforce data integrity and consistency. Storage is handled via the activity-data-repository, necessitating coordination with data storage teams. The complexity lies in ensuring seamless data flow and real-time responsiveness to contextual changes.

From a technical perspective, the Activity Suggestion entity is modeled as a document stored in the activity-data-repository, with attributes capturing all necessary metadata for filtering and presentation. Integration points include weather-service for dynamic weather conditions, location-service for geospatial context, and equipment-availability-service to verify resource availability. CRUD operations are exposed via the activity-suggestion-engine component, which enforces business rules such as filtering by weather and equipment. Validation rules ensure data correctness, and indexing on key attributes like activity_name and location_type optimizes query performance.

📋 Data Structure

Name Type Description Constraints
id PK string Unique identifier for the activity suggestion. PRIMARY KEY
activity_name string Name of the suggested activity. -
description string Detailed description of the activity. -
required_equipment array List of equipment IDs required for the activity. -
location_type string Type of location suitable for the activity (e.g., indoor, outdoor). -
weather_conditions array Weather conditions suitable for the activity. -
age_group string Recommended age group for the activity. -
difficulty_level string Difficulty level of the activity. -
safety_instructions string Safety instructions related to the activity. -

🔍 Database Indexes

Index on activity_name

Columns: activity_name

Index on location_type

Columns: location_type

Index on age_group

Columns: age_group

✅ Validation Rules

valid_activity_type

error

Ensures the activity_type attribute is one of the predefined valid types

Applies to: activity_type

required_fields_present

error

Ensures all required fields for an activity suggestion are present

Applies to: activity_name, activity_type, equipment_required

📐 Business Rules

activity_suggestion_must_consider_user_preferences

create

Activity suggestions must be filtered and adapted based on user preferences

activity_suggestion_must_consider_location_and_weather

create

Activity suggestions must be adapted based on user's location and current weather conditions

activity_suggestion_must_check_equipment_availability

create

Suggested activities must only include those with available equipment

activity_suggestion_must_be_displayed_on_wheel

read

All activity suggestions must be presented through the activity suggestion wheel component

⚡ CRUD Operations

➕ CREATE

Allowed
Required Permissions:
adminactivity_manager
Required Fields: activity_name, activity_type, equipment_required

👁️ READ

Allowed
Required Permissions:
useradminactivity_manager
Filterable by: activity_type, user_id, location, weather_condition

✏️ UPDATE

Allowed
Required Permissions:
adminactivity_manager
Updatable Fields: activity_name, activity_type, equipment_required, description

🗑️ DELETE

Allowed
Required Permissions:
admin
Soft Delete Enabled
Cascade Rules:
  • remove_activity_from_suggestion_lists

💾 Storage Configuration

Storage Type: document_store
Location: activity-data-repository

🧩 Components Managing This Entity

Data component managing storage and retrieval of activity metadata, user preferences, historical activity data, and feedback related to activity suggestions. Supports CRUD operations and data validation.

🔌 Interfaces

  • getActivityById(activityId)
  • getAllActivities()
  • saveUserPreferences(userId, preferences)
  • getUserPreferences(userId)
  • recordActivityFeedback(userId, activityId, feedback)
  • ...and 1 more

Data service dedicated to managing user-specific preferences and settings related to activity suggestions, enabling personalized recommendation adjustments and feedback incorporation.

🔌 Interfaces

  • getUserPreferences(userId)
  • saveUserPreferences(userId, preferences)
  • updatePreferencesFromFeedback(userId, feedback)

Infrastructure component that interfaces with equipment availability databases to determine which physical activity equipment is accessible to the user, influencing activity suggestion relevance.

🔌 Interfaces

  • getAvailableEquipment(userId)
  • refreshEquipmentData(userId)

Infrastructure component integrating with geolocation APIs to provide accurate user location data for context-aware activity suggestions. Handles API communication, data normalization, and error management.

🔌 Interfaces

  • getUserLocation(userId)
  • refreshLocationData(userId)

Infrastructure component that connects to external weather APIs to obtain current and forecasted weather conditions, enabling the algorithm to adapt activity suggestions accordingly.

🔌 Interfaces

  • getWeatherData(location)
  • refreshWeatherData(location)

Core service implementing the algorithm that generates personalized activity suggestions based on user context including location, season, weather, equipment availability, and user preferences. It applies rule-based logic initially with extensibility for machine learning enhancements.

🔌 Interfaces

  • generateSuggestions(userContext)
  • updateUserPreferences(userId, preferences)
  • recordActivityFeedback(userId, activityId, feedback)
  • getHistoricalActivityData(userId)
  • refreshContextualData()

Visual interactive component displaying personalized activity suggestions as a dynamic wheel with images and descriptions. It allows users to spin or select activities tailored to their context, providing an engaging and intuitive interface for children and youth to explore physical activities.

🔌 Interfaces

  • renderActivityWheel()
  • handleSpinAction()
  • displayActivityDetails(activityId)
  • updateSuggestions(suggestions)
  • showLoadingState()
  • ...and 1 more