* install json2csv package
* add necessary labels
* add support convert the JSON to redable CSV format and export
* add a popover to export btton and provide options for exporting to JSON and CSV
* Use a DropdownMenu
* Translations
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* no division of amount
* use gpt-4-turbo
* testing setup and naive test
* test multiple variants
* document
* correct locale names
* test large amounts
* test wth strings
* prettier
* Extract ExpenseCard vom ExpenseList
* Implement simple pagination of expenses (see #30)
- display only this year's entries by default
- a "Show more" button reveals all expenses
* Turn getPrisma() into constant "prisma"
- getPrisma() is not async and doesn't need to be awaited
- turn getPrisma() into exported constant "prisma"
* Select fields to be returned by getGroupExpenses()
- make JSON more concise and less redundant
- some properties were removed (i.e.instead of "expense.paidById" use "expense.paidBy.id")
* Remove "participants" from ExpenseCard
- no need to search for participant by id to get it's name
- name property is already present in expense
* Add option to fetch a slice of group expenses
- specify offset and length to get expenses for [offset, offset+length[
- add function to get total number of group expenses
* Add api route for client to fetch group expenses
* Remove "Show more" button from expense list
* Implement infinite scroll
- in server component Page
- only load first 200 expenses max
- pass preloaded expenses and total count
- in client component ExpenseList, if there are more expenses to show
- test if there are more expenses
- append preloading "skeletons" to end of list
- fetch more expenses when last item in list comes into view
- after each fetch increase fetch-length by factor 1.5
- rationale: db fetch usually is not the issue here, the longer the list gets, the longer react needs to redraw
* Use server action instead of api endpoint
* Fixes
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* Move prisma to runtime dependencies
* Optimize Dockerfile and build script
* Fix: remove mention of generated next-env.d.ts in Dockerfile
* Add missing reset.d.ts file to Dockerfile
* Remove compression steps from Dockerfile and entrypoint script
* Add an env file with mocked env vars added for Docker production builds
* Use server actions to get runtime env vars
* Refactor types and names
* Rollback serverActions, use parsed Zod object for runtime env
* Reintroduce featureFlags object to avoid passing secret envs to the frontend
* Improve string to boolean coercion
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* Run prettier autoformat
* Fix type issue, rename function to match behaviour better
---------
Co-authored-by: Lauri Vuorela <lauri.vuorela@gmail.com>
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* Add splitmode and shares to expenses
* Update balances based on shares
* Change field size
* Form validation
* Redesign expense form
* Split unevenly by amount