Skip to content

Feature: API waiting time endpoint#15

Merged
MischaHeeb merged 5 commits intomainfrom
feat/api-waiting-time-controller
Jan 26, 2026
Merged

Feature: API waiting time endpoint#15
MischaHeeb merged 5 commits intomainfrom
feat/api-waiting-time-controller

Conversation

@MischaHeeb
Copy link
Owner

Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (clean code, dependencies, ...)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Test this feature

  1. Pull and checkout this branch
  2. Run docker compose up -d
  3. Create the SQL File for mock data (SQL inserts: see below)
  4. Insert Mock data into database with: docker exec -i aptracker-db psql -U postgres -d aptracker < [FILENAME-HERE].sql
  5. Restart API service with docker restart aptracker-api
  6. When restarted, go to http://localhost:5000/swagger/
  7. Run both API points seperately
  8. Data should appear

Mock Data

INSERT INTO "Attractions" ("AttractionId", "AttractionName", "TrackWaitingTime")
VALUES
    (1, 'Space Mountain', true),
    (2, 'Big Thunder Mountain', true),
    (3, 'Pirates of the Caribbean', true),
    (4, 'Haunted Mansion', false),
    (5, 'Splash Mountain', true)
ON CONFLICT DO NOTHING;

INSERT INTO "WaitingTime" ("WaitingTimeId", "AttractionId", "Timestamp", "WaitingTimeInMinutes")
VALUES
    (1, 1, NOW() - INTERVAL '3 hours', 45),
    (2, 1, NOW() - INTERVAL '2 hours', 60),
    (3, 1, NOW() - INTERVAL '1 hour', 55),
    (4, 2, NOW() - INTERVAL '2 hours', 30),
    (5, 2, NOW() - INTERVAL '1 hour', 35),
    (6, 3, NOW() - INTERVAL '1 hour', 20),
    (7, 5, NOW() - INTERVAL '30 minutes', 40)
ON CONFLICT DO NOTHING;

SELECT setval('"Attractions_AttractionId_seq"', (SELECT MAX("AttractionId") FROM "Attractions"));
SELECT setval('"WaitingTime_WaitingTimeId_seq"', (SELECT MAX("WaitingTimeId") FROM "WaitingTime"));

Author Checklist:

  • The code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Reviewer Checklist:

  • The code follows the style guidelines of this project
  • I have performed a self-review of my code
  • The code has comments, particularly in hard-to-understand areas
  • Corresponding changes were made to the documentation
  • The changes generate no new warnings
  • Tests were added that prove the fix is effective or that the feature works
  • New and existing unit tests pass locally with the changes
  • Any dependent changes have been merged and published in downstream modules

@MischaHeeb MischaHeeb self-assigned this Nov 26, 2025
@MischaHeeb MischaHeeb merged commit 64a842a into main Jan 26, 2026
3 checks passed
@MischaHeeb MischaHeeb deleted the feat/api-waiting-time-controller branch January 26, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant