Skip to content

Feature: Attraction API Endpoint#13

Open
MischaHeeb wants to merge 6 commits intomainfrom
feat/api-attraction-controller
Open

Feature: Attraction API Endpoint#13
MischaHeeb wants to merge 6 commits intomainfrom
feat/api-attraction-controller

Conversation

@MischaHeeb
Copy link
Owner

@MischaHeeb MischaHeeb commented Nov 14, 2025

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

@MischaHeeb MischaHeeb changed the title Feat/api attraction controller Feature: Attraction API Endpoint Nov 14, 2025
@MischaHeeb MischaHeeb self-assigned this Nov 14, 2025
@MischaHeeb MischaHeeb added the enhancement New feature or request label Nov 14, 2025
@MischaHeeb
Copy link
Owner Author

MischaHeeb commented Nov 14, 2025

Documentation is missing for the whole class!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant