-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Store locations of expenses #172
base: main
Are you sure you want to change the base?
Conversation
Awesome feature, great job! |
Thank you for the feedback! @dcbr
Intuitively it feels a bit like creating a redundancy, as such a free-text description/mentioning of a location can already be done as part of the existing input fields (title or notes). I find myself usually writing the name of a place, where an expense was made, into the title, i. e. "Dinner at 4 seasons". Also I can imagine that for users it might be a bit confusing to have two different points in the app page where to store location-related details (the input field in the top card and then further down the location card with the map view). From your perspective, what would be the benefit to add another input field to the already existing ones? |
To close #18 I implemented a first iteration for storing locations of expenses. It adds a new card to the expense form where users can see and change the location of where an expense was made.
Users can choose between having their current location determined (by accessing
navigator.geolocation
) and manually setting/correcting it by dragging the position marker on the map; alternatively they can also place it somewhere by clicking/tapping on the map.Locations are stored in a separate table
Point
, which has a 1:1 relationship toExpense
, this way it is ensured that a position always consists of both latitude and longitude (or otherwise it just does not exist). Initially my plan was to use the point datatype of Postgres for storage, but unfortunately at this point the Prisma ORM does not support the PG geometric data types (and apparently it will not any time soon).Screencast
simplescreenrecorder-2024-06-23_19.36.10.mp4