Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: interface separation discussion #2955

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

bfauble
Copy link
Contributor

@bfauble bfauble commented Feb 5, 2025

No description provided.

my_name: string(),
my_intersection: string(),
my_updated_at: number(),
my_activated_at: coerce(date(), string(), (dateStr) => new Date(dateStr)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

So if we're dealing with a draft detour (never activated), this and estimated_duration would be null? (I could see past detours retaining their activated_at and estimated_duration because there's no reason to delete them, as long as status is also included somewhere in this normalized type)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would this model also include the state blob, since some endpoints also return that to the frontend?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't spend the time to figure out every field that we'd want to pass through, just grabbed the ones that are explicitly grabbed in the serde module. We'd need to go through and figure out what fields are needed top level and decide how we want to model the 'shape' portion of the detour, whether that lives in its own table or blob field

name: my_name,
intersection: my_intersection,
updated_at: my_updated_at
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we'd need a third fromNormalizedToXYZ to cover the simplest form {state, author, id} that is returned when we open a single detour, but I don't know what to call that one. It was previously DetourWithState, but I don't love that name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there's a couple other spots I missed, but just wanted to give an example for isolating the frontend from backend db changes for at least one of the end points

@bfauble bfauble requested a review from firestack February 7, 2025 17:39
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.

2 participants