Skip to content

fix(das): specify foreign key for timetable entry - #327

Merged
mini-bomba merged 1 commit into
mainfrom
fix-das-endpoint
Jul 16, 2026
Merged

fix(das): specify foreign key for timetable entry#327
mini-bomba merged 1 commit into
mainfrom
fix-das-endpoint

Conversation

@simon-the-shark

Copy link
Copy Markdown
Member

Summary

Fixes preloading timetable entries through the DAS timetable endpoint.

Lucid inferred the relation foreign key as dasTimetableId, while
DasTimetableEntry defines it as timetableId. This caused requests with the
entries relation to fail with E_MISSING_MODEL_ATTRIBUTE.

The relation now explicitly uses timetableId.

Before

GET /api/v1/das_timetables/1?entries=true

Returned HTTP 500:
Relation "DasTimetable.entries" expects "dasTimetableId" to exist on
"DasTimetableEntry" model, but is missing.

failling prod endpoint: https://api.topwr.solvro.pl/api/v1/das_timetables/1?entries=true

After

The same request returns HTTP 200 with the timetable entries preloaded,
including entries with a nullable endTime.

@simon-the-shark simon-the-shark self-assigned this Jul 16, 2026
@simon-the-shark
simon-the-shark requested a review from a team as a code owner July 16, 2026 17:28
@simon-the-shark simon-the-shark added the bug Something isn't working label Jul 16, 2026
@github-project-automation github-project-automation Bot moved this to Todo in ToPWR Jul 16, 2026
@simon-the-shark simon-the-shark moved this from Todo to In review in ToPWR Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Looks like you did not link an issue to this PR. If this PR completes a task, consider linking it.

@mini-bomba mini-bomba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:, but i'd rather you didn't generate pr descriptions with ai

@mini-bomba
mini-bomba added this pull request to the merge queue Jul 16, 2026
Merged via the queue into main with commit 6e0f47f Jul 16, 2026
14 checks passed
@mini-bomba
mini-bomba deleted the fix-das-endpoint branch July 16, 2026 18:15
mini-bomba added a commit that referenced this pull request Jul 16, 2026
This makes sure issues like #327 are detected in tests.
@mini-bomba mini-bomba moved this from In review to Done in ToPWR Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size/XS

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants