-
Notifications
You must be signed in to change notification settings - Fork 9
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
base: main
Are you sure you want to change the base?
Conversation
my_name: string(), | ||
my_intersection: string(), | ||
my_updated_at: number(), | ||
my_activated_at: coerce(date(), string(), (dateStr) => new Date(dateStr)), |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
No description provided.