Commit Graph

67 Commits

Author SHA1 Message Date
Sebastien Castiel
a11efc79c1 Fix Prettier issues
All checks were successful
CI / checks (push) Successful in 1m34s
2025-04-20 11:10:30 -04:00
trandall
94c101cf7b Add recurring expense functionality (#263)
* code complete

* Smaller updates

* delete ambitious TODOs (add to PR)

* add transactionality to recurring expense creation

* Remove unnecessary `let`s

* Add default english labels to non-en-US translations

* Accept `es.json` translations

* add condition to ensure links are only modified when applicable
2025-04-19 15:23:23 -04:00
Daniel Thiem
728e072376 Add computed shares per expense to fix #127 (#269)
* Added computed expenses per balance to fix #127

* add missing import that got lost during merge

* if we are in percentage mode or amount mode, the shares have to be multiplied by 100
2025-04-19 15:16:37 -04:00
Yuvaraj Sai
f9307fd22d Fix the amount validation while creating an expense (#291) 2025-04-19 13:55:24 -04:00
Sébastien Beaury
5732f78e80 Fix UTC timezone used in activity tracker (#265) 2024-12-07 11:55:02 -05:00
Yuvaraj Sai
72ad0a4c90 feat(expense-list): Display the attachment count only when the expense includes attachments (#267)
* feat(expense-list): Display the attachment count only when the expense includes attachments

* handle attachments - singular & plural

* move documents count between amount and date

* Remove label

* Use document count only instead of whole document list

---------

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
2024-12-07 11:53:14 -05:00
Sebastian Goscinski
5111f3574f Feature: Default currency symbol (#259)
* Added a env parameter to define a default currency symbol

* Fixed prettier formatting
2024-12-07 11:07:54 -05:00
Sebastien Castiel
21d0c02687 Use tRPC for expense form (#251) 2024-10-19 22:59:47 -04:00
Sebastien Castiel
210c12b7ef Use tRPC in other group pages (#249)
* Use tRPC in group edition + group layout

* Use tRPC in group modals

* Use tRPC in group stats

* Use tRPC in group activity
2024-10-19 21:29:53 -04:00
Sebastien Castiel
66e15e419e Add tRPC, use it for group expenses, balances and information page (#246)
* Add tRPC, use it for group expense list

* Use tRPC for balances

* Use tRPC in group information + better loading states
2024-10-19 17:42:11 -04:00
Mert Demir
8742bd59da Fix format for integer amounts (#231)
* support both fractions and integer values

* test fractions

* prettier
2024-09-29 09:24:10 -04:00
Mert Demir
9a5674e239 Fix amount preview for scanned receipts (#227)
* 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
2024-09-28 18:39:01 -04:00
Chris Johnston
972bb9dadb add group information field to group settings and Information tab (#164)
* 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>
2024-08-02 12:03:36 -04:00
Tuomas Jaakola
4f5e124ff0 Internationalization + Finnish language (#181)
* I18n with next-intl

* package-lock

* Finnish translations

* Development fix

* Use locale for positioning currency symbol

* Translations: Expenses.ActiveUserModal

* Translations: group 404

* Better translation for ExpenseCard

* Apply translations in CategorySelect search

* Fix for Finnish translation

* Translations for ExpenseDocumentsInput

* Translations for CreateFromReceipt

* Fix for Finnish translation

* Translations for schema errors

* Fix for Finnish translation

* Fixes for Finnish translations

* Prettier

---------

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
2024-08-02 11:26:23 -04:00
Laszlo Makk
002e867bc4 Make recalculation stable across repayments in suggested reimbursements (#179)
* 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>
2024-08-02 10:58:46 -04:00
Sergio Behrends
7145cb6f30 Increase fuzzines of search results (#187)
* Introduce normalizeString fn

* Prettier

---------

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
2024-08-02 10:57:18 -04:00
Stefan Hynst
0c05499107 Add support for group income (= negative expenses) (#158)
* 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>
2024-05-29 22:20:04 -04:00
dcbr
e619c1a5b4 Add basic activity log (#141)
* Add basic activity log

* Add database migration

* Fix layout

* Fix types

---------

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
2024-05-29 22:06:45 -04:00
Stefan Hynst
d3fd8027a5 Implement "infinite scroll" for expenses (#95)
* 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>
2024-05-29 21:36:07 -04:00
Deep Golani
2fd38aadd9 Add notes in expense (#126)
* Feature: Added notes in expense

* Add missing notes in form values

* Prettier

---------

Co-authored-by: deep.golani <deep.golani@bfhl.in>
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
2024-04-05 08:38:38 -04:00
Jan T
b67a0be0dd Add "save as default splitting options" feature (#120)
* Add "save as default splitting options" feature

* Fix type issue

* Run autoformatter
2024-03-09 11:45:53 -05:00
Sebastien Castiel
552953151a Don’t count reimbursements in stats (fixes #118) (#119) 2024-02-29 10:21:23 -05:00
Jan T
4c5f8a6aa5 Fix decimal separator issue in numeric form fields (#115)
* Revert 5b65b8f, fix comma issue with type="text" and onChange

* Fix comma issue in "paid for" input

* Run prettier autoformat

* Allow only digits and dots in currency inputs

* Fix behaviour in paidFor field

* Fix duplicated onChange prop

---------

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
2024-02-28 10:57:55 -05:00
Anurag
2f991e680b feat: initialise a new totals tab with basic UI (#94)
* 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>
2024-02-28 10:43:25 -05:00
Jan T
2af0660383 Optimize docker image size (#91)
* 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>
2024-02-14 10:18:30 -05:00
Lauri Vuorela
f7a13a0436 Round totals rather than expense by expense (#88)
* do balance rounding only on full balances rather than on every expense

* use "public balances" calculated from reimbursements to show on balance page

* fixes for totals that did not work as expected

* prettier
2024-02-13 14:35:57 -05:00
Jan T
5b65b8f049 Replace commas with dots in expense form schema amount field (#90) 2024-02-13 14:26:45 -05:00
Sebastien Castiel
0e6a2bdc6c Limit file upload size on the client (#84) 2024-02-06 10:19:57 -05:00
Lauri Vuorela
be0964d9e1 format currency with thousand separators (#81) 2024-02-04 20:16:30 -05:00
Mert Demir
fb49fb596a Automatic category from expense title (#80)
* environment variable

* random category draft

* get category from ai

* input limit and documentation

* use watch

* use field.name

* prettier

* presigned upload, readme warning, category to string util

* prettier

* check whether feature is enabled

* use process.env

* improved prompt to return id only

* remove console.debug

* show loader

* share class name

* prettier

* use template literals

* rename format util

* prettier
2024-02-04 12:23:11 -05:00
Mert Demir
08d75fd75c Support for additional S3 providers (#71)
* support for other s3 providers

* remove redundant route options

* use type safe env

* prettier
2024-01-31 17:00:19 -05:00
Sebastien Castiel
4a9bf575bd Create expense from receipt (#69)
* Create expense from receipt

* Add modal

* Update README
2024-01-30 16:36:29 -05:00
Sebastien Castiel
9e300e0ff0 Use React’s cache to avoid some queries to the database 2024-01-30 12:57:21 -05:00
Sebastien Castiel
3847a67a19 Sort expenses by expense date, then by creation date (partial workaround for #67) 2024-01-29 15:14:51 -05:00
Sebastien Castiel
d43e731fe1 Attach documents to expenses (#64)
* Upload documents to receipts

* Improve documents

* Make the feature opt-in

* Fix file name issue
2024-01-28 18:51:29 -05:00
Sebastien Castiel
c138afadb9 Bring back NEXT_PUBLIC_BASE_URL 2024-01-19 12:43:17 -05:00
Sebastien Castiel
4d86c8c727 Remove varianle NEXT_PUBLIC_BASE_URL 2024-01-19 12:03:16 -05:00
Sebastien Castiel
23524cb943 Clean project from marketing content (#50)
* Clean project from marketing content

* Remove some dependencies
2024-01-19 11:28:25 -05:00
Sebastien Castiel
f9040f8bed Merge feedback and support dialogs 2024-01-18 15:48:45 -05:00
Brandon Eng
36cc4f1ef7 Ability to archive groups when they’re settled up (#45)
* Settled up icon on group card

* remove logs

* archived groups

* remove settled up

* remove more settled up

* recent-group-list-card

* sortGroups

* archiveGroup

* unarchiveGroup

* clean up

* more clean up

* Prettier, fix TS errors, add titles

---------

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
2024-01-16 10:41:46 -05:00
Sebastien Castiel
beae336666 Add donation button (closes #40) 2024-01-14 11:43:48 -05:00
Chris Johnston
45ee9cdba4 Assign categories to expenses (#28)
* add expense categories

* set category to Payment for reimbursements

* Insert categories as part of the migration

* Display category groups

---------

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
2024-01-11 16:38:30 -05:00
Sebastien Castiel
323b0ea128 Feedback button 2024-01-09 15:32:19 -05:00
Sebastien Castiel
1b9e624004 Ask the user who they are when opening a group for the first time (#7) 2024-01-09 08:53:51 -05:00
Chris Johnston
bec1dd270a Add Expense Date (#26)
* add expense date

* Improve date formatting

* Prettier

* Change field description

---------

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
2024-01-08 14:26:44 -05:00
Sebastien Castiel
0a8e56f800 Add splitmode and shares to expenses (#11)
* Add splitmode and shares to expenses

* Update balances based on shares

* Change field size

* Form validation

* Redesign expense form

* Split unevenly by amount
2024-01-08 12:11:11 -05:00
Sebastien Castiel
7e279a535d Improve loading states 2023-12-14 12:34:15 -05:00
Ivan Alexandrov
c96c4f94b9 Replace unsafe id generator with nanoid (#4) 2023-12-13 12:28:35 -05:00
Sebastien Castiel
af3ed68f1c Select all/no participant for expenses (Fix #3) 2023-12-12 09:55:48 -05:00
Sebastien Castiel
1ed533d01f Fix string to number conversion in expense schema (Fix #1) (#2) 2023-12-12 09:20:05 -05:00