Commit Graph

52 Commits

Author SHA1 Message Date
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
Sebastien Castiel
4f43e8e42a Add Plausible 2023-12-11 11:54:24 -05:00
Sebastien Castiel
69fa008ea4 Tiny adjustments 2023-12-11 10:26:13 -05:00
Sebastien Castiel
92a21ff4c5 Migration script, improvements in expenses list 2023-12-08 14:56:51 -05:00
Sebastien Castiel
9cc819b0c9 Short IDs 2023-12-08 10:55:14 -05:00
Sebastien Castiel
15f959bcc2 Remove delay 2023-12-07 21:30:13 -05:00
Sebastien Castiel
0e7b879aa8 Redesign the groups page 2023-12-07 20:57:48 -05:00
Sebastien Castiel
6f077f141e Prevent removing participants with expenses 2023-12-07 20:12:40 -05:00
Sebastien Castiel
0b27f90fb7 Titles and navigation 2023-12-07 16:44:01 -05:00
Sebastien Castiel
6611e3a187 Store amounts as cents 2023-12-07 11:11:53 -05:00
Sebastien Castiel
ae7360caf8 Fix balances display 2023-12-06 20:30:41 -05:00
Sebastien Castiel
57899b0160 Reimbursements 2023-12-06 20:21:26 -05:00
Sebastien Castiel
6ce2329f5c Reimbursements 2023-12-06 19:50:56 -05:00
Sebastien Castiel
12b1cdb52a Balances 2023-12-06 17:02:59 -05:00
Sebastien Castiel
72fe199879 Add currency 2023-12-06 15:23:18 -05:00
Sebastien Castiel
570aa713b1 Delete expense 2023-12-06 15:08:52 -05:00