1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 13:35:21 +02:00

Transfer and Payment auto-matching, model and UI improvements (#1585)

* Transfer data model migration

* Transfers and payment modeling and UI improvements

* Fix CI

* Transfer matching flow

* Better UI for transfers

* Auto transfer matching, approve, reject flow

* Mark transfers created from form as confirmed

* Account filtering

* Excluded rejected transfers from calculations

* Calculation tweaks with transfer exclusions

* Clean up migration
This commit is contained in:
Zach Gollwitzer 2025-01-07 09:41:24 -05:00 committed by GitHub
parent 46e129308f
commit 307a3687e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
78 changed files with 1161 additions and 682 deletions

View file

@ -103,6 +103,30 @@
],
"note": ""
},
{
"warning_type": "Dangerous Eval",
"warning_code": 13,
"fingerprint": "c193307bb82f931950d3bf2855f82f9a7f50d94c5bd950ee2803cb8a8abe5253",
"check_name": "Evaluation",
"message": "Dynamic string evaluated as code",
"file": "app/helpers/styled_form_builder.rb",
"line": 7,
"link": "https://brakemanscanner.org/docs/warning_types/dangerous_eval/",
"code": "class_eval(\" def #{selector}(method, options = {})\\n merged_options = { class: \\\"form-field__input\\\" }.merge(options)\\n label = build_label(method, options)\\n field = super(method, merged_options)\\n\\n build_styled_field(label, field, merged_options)\\n end\\n\", \"app/helpers/styled_form_builder.rb\", (7 + 1))",
"render_path": null,
"location": {
"type": "method",
"class": "StyledFormBuilder",
"method": null
},
"user_input": null,
"confidence": "Weak",
"cwe_id": [
913,
95
],
"note": ""
},
{
"warning_type": "Dynamic Render Path",
"warning_code": 15,
@ -138,6 +162,5 @@
"note": ""
}
],
"updated": "2024-12-18 17:46:13 -0500",
"brakeman_version": "6.2.2"
"brakeman_version": "7.0.0"
}

View file

@ -1,17 +0,0 @@
---
en:
account/transfer:
from_fallback_name: Originator
name: Transfer from %{from_account} to %{to_account}
to_fallback_name: Receiver
activerecord:
errors:
models:
account/transfer:
attributes:
entries:
must_be_from_different_accounts: must be from different accounts
must_be_marked_as_transfer: must be marked as transfer
must_have_an_inflow_and_outflow_that_net_to_zero: must have an inflow
and outflow that net to zero
must_have_exactly_2_entries: must have exactly 2 entries

View file

@ -0,0 +1,17 @@
---
en:
activerecord:
errors:
models:
transfer:
attributes:
base:
must_be_from_different_accounts: Transfer must have different accounts
must_be_within_date_range: Transfer transaction dates must be within
4 days of each other
must_have_opposite_amounts: Transfer transactions must have opposite
amounts
must_have_single_currency: Transfer must have a single currency
transfer:
name: Transfer to %{to_account}
payment_name: Payment to %{to_account}

View file

@ -36,15 +36,8 @@ en:
no_transactions: No transactions for this account yet.
transaction: transaction
transactions: Transactions
mark_transfers:
success: Marked as transfers
new:
new_transaction: New transaction
selection_bar:
mark_transfers: Mark as transfers?
mark_transfers_confirm: Mark as transfers
mark_transfers_message: By marking transactions as transfers, they will no
longer be included in income or spending calculations.
show:
account_label: Account
amount: Amount
@ -55,9 +48,6 @@ en:
balances, and cannot be undone.
delete_title: Delete transaction
details: Details
exclude_subtitle: This excludes the transaction from any in-app features or
analytics.
exclude_title: Exclude transaction
merchant_label: Merchant
name_label: Name
nature: Type
@ -68,5 +58,6 @@ en:
settings: Settings
tags_label: Tags
uncategorized: "(uncategorized)"
unmark_transfers:
success: Transfer removed
transfer_matches:
create:
success: Transfer created

View file

@ -1,38 +0,0 @@
---
en:
account:
transfers:
create:
success: Transfer created
destroy:
success: Transfer removed
form:
amount: Amount
date: Date
expense: Expense
from: From
income: Income
select_account: Select account
submit: Create transfer
to: To
transfer: Transfer
new:
title: New transfer
show:
delete: Delete
delete_subtitle: This permanently deletes both of the transactions related
to the transfer. This cannot be undone.
delete_title: Delete transfer?
details: Details
exclude_subtitle: This excludes the transfer from any in-app features or analytics.
exclude_title: Exclude transfer
note_label: Notes
note_placeholder: Add a note to this transfer
overview: Overview
settings: Settings
transfer_toggle:
remove_transfer: Remove transfer
remove_transfer_body: This will remove the transfer from this transaction
remove_transfer_confirm: Confirm
update:
success: Transfer updated

View file

@ -1,11 +1,8 @@
---
en:
category:
dropdowns:
show:
empty: No categories found
bootstrap: Generate default categories
categories:
bootstrap:
success: Default categories created successfully
category:
delete: Delete category
edit: Edit category
@ -18,15 +15,18 @@ en:
form:
placeholder: Category name
index:
bootstrap: Use default categories
categories: Categories
empty: No categories found
new: New category
bootstrap: Use default categories
bootstrap:
success: Default categories created successfully
menu:
loading: Loading...
new:
new_category: New category
update:
success: Category updated successfully
category:
dropdowns:
show:
bootstrap: Generate default categories
empty: No categories found

View file

@ -6,7 +6,6 @@ en:
delete: Delete category
edit: Edit category
show:
add_new: Add new
clear: Clear
clear: Clear category
no_categories: No categories found
search_placeholder: Search

View file

@ -0,0 +1,31 @@
---
en:
transfers:
create:
success: Transfer created
destroy:
success: Transfer removed
form:
amount: Amount
date: Date
expense: Expense
from: From
income: Income
select_account: Select account
submit: Create transfer
to: To
transfer: Transfer
new:
title: New transfer
show:
delete: Remove transfer
delete_subtitle: This removes the transfer. It will not delete the underlying
transactions.
delete_title: Remove transfer?
details: Details
note_label: Notes
note_placeholder: Add a note to this transfer
overview: Overview
settings: Settings
update:
success: Transfer updated

View file

@ -46,9 +46,7 @@ Rails.application.routes.draw do
resources :merchants, only: %i[index new create edit update destroy]
namespace :account do
resources :transfers, only: %i[new create destroy show update]
end
resources :transfers, only: %i[new create destroy show update]
resources :imports, only: %i[index new show create destroy] do
post :publish, on: :member
@ -81,6 +79,7 @@ Rails.application.routes.draw do
resources :entries, only: :index
resources :transactions, only: %i[show new create update destroy] do
resource :transfer_match, only: %i[new create]
resource :category, only: :update, controller: :transaction_categories
collection do