* 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
* Fix#209: Correctly display loaded expense
- Don't load default split options after displaying an existing expense
- Re-validate form after changing the "paidFor" selection.
This fixes the error message "The expense must be paid for at least one
participant." after clicking "Select None" and the selecting one participant.
* Fix Paid For Field reset in Edit Expense Page for split Mode 'Unevenly - By amount'
---------
Co-authored-by: partho.kunda <partho.kunda@chaldal.net>
* feat: add German language support
* fix: translate other locale names to German
* chore: integrate recommendations from the PR review
* i18n: add translation recommendations from the PR
* Fix translations
---------
Co-authored-by: Christian Schuller <christianschuller.biz@gmail.com>
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* create ES i18n json
* add ES locale to i18n and existing locales
* capitalize words at es.json
* Add missing translation
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* Added french version and title/description from json messages
* Revert back default language to en-US
* Code reviewed with prettier :)
* Updated json to add information field
* Updated json to add information block (missed on previous)
* Reviewed code language
* correction traduction "groupes étoilés" en "groupes favoris"
---------
Co-authored-by: Andy Trouvé <andy@strekol.eu>
* add group information field to group and Information tab to display
* add breaks to info page
* Improve UX
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* feat: add auto-balancing for the amount edit
this implementation allocates the rest of the total
to participants, whose rows have yet not been edited.
* fix: reset already edited on total amount change
* suggested reimbursements: make recalculation stable across repayments
Previously, after a group participant executed a suggested reimbursement, rerunning getSuggestedReimbursements() could return a completely new list of suggestions.
With this change, getSuggestedReimbursements() should now be stable:
if it returns a graph with n edges, and then a repayment is made according to one of those edges, when called again, it should now return the same graph but with that one edge removed.
The trick is that the main logic in getSuggestedReimbursements() does not rely on balancesArray being sorted based on .total values, only that the array gets partitioned into participants with credit first and then participants with debt last. After a repayment is made, re-sorting based on .total values would result in a new order hence new suggestions, but sorting based on usernames/participantIds should be unaffected.
fixes https://github.com/spliit-app/spliit/issues/178
* Prettier
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* Allow negative amount for expenses to be entered
- an expense becomes an income
- this does not affect calculations, i.e. an income can be split just like an expense
* Incomes should not be reimbursements
when entering a negative number
- deselect 'isReimbursement'
- hide reimbursement checkbox
* Change captions when entering a negative number
- "expense" becomes "income"
- "paid" becomes "received"
* Format incomes on expense list
- replace "paid by" with "received by"
* Format incomes on "Stats" tab
- a group's or participants balance might be negative
- in this case "spendings" will be "earnings" (display accordingly)
- always display positive numbers
- for active user: highlight spendings/earnings in red/green
* Fix typo
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* change onClick to onFocus, with a slight delay for safari
* typo
* fix variable name
* Fix style
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* 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>
* Add devcontainer configuration for codespace support
* Show the impact of an expense on the active user's balance
* Run prettier
* Put the balance on a different line
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* feat: added a popup asking for confirmation to delete an expense
* fix: changed cancel option as a button and formatting issues
* fix: removed unnecessary tags and replaced generic tags with proper components
* Small fix to avoid warning in console
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
* feat: initialise a new totals tab with basic UI
* fix: update group tabs and add stats page
* fix: styling within the new elements
* Prettier
* Display active user expenses only if active user is set
---------
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>