Skip to content

♻️ Standardize provider configuration structure #19

@bdamokos

Description

@bdamokos

Standardize provider configuration structure

Issue Description

Currently, each provider (STIB, De Lijn, BKK) uses slightly different methods and structures for configuring monitored lines and stops. This inconsistency makes the system harder to maintain and configure.

Current State

  1. STIB:

    • Uses STIB_STOPS with complex nested structure for lines and directions
    • Has both legacy and new configuration formats
  2. De Lijn:

    • Uses simple STOP_IDS list
    • Separate MONITORED_LINES list
  3. BKK:

    • Uses STOP_IDS list
    • Uses MONITORED_LINES list
    • Has additional provider-specific fields

Proposed Solution

Create a standardized configuration structure for all providers:

PROVIDER_CONFIG = {
    'provider_name': {
        'stops': [
            {
                'id': 'stop_id',
                'name': 'stop_name',  # Optional
                'lines': {  # Optional
                    'line_id': ['destination1', 'destination2']
                },
                'direction': 'direction'  # Optional
            }
        ],
        'monitored_lines': ['line_id1', 'line_id2'],  # Optional
        'provider_specific': {  # For any provider-specific settings
            'key': 'value'
        }
    }
}

Implementation Steps

  1. Create migration scripts for each provider
  2. Update configuration loading code
  3. Update documentation
  4. Add validation for the new structure
  5. Deprecate old configuration formats

Success Criteria

  • Single, consistent configuration format for all providers
  • Clear documentation for users
  • Backward compatibility or clear migration path
  • Validation for configuration format

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions