mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-03 04:25:21 +02:00
Improve account transaction, trade, and valuation editing and sync experience (#1506)
* Consolidate entry controller logic * Transaction builder * Update trades controller to use new params * Load account charts in turbo frames, fix PG overflow * Consolidate tests * Tests passing * Remove unused code * Add client side trade form validations
This commit is contained in:
parent
76f2714006
commit
c3248cd796
97 changed files with 1103 additions and 1159 deletions
|
@ -80,6 +80,29 @@
|
|||
],
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"warning_type": "Mass Assignment",
|
||||
"warning_code": 105,
|
||||
"fingerprint": "f158202dcc66f2273ddea5e5296bad7146a50ca6667f49c77372b5b234542334",
|
||||
"check_name": "PermitAttributes",
|
||||
"message": "Potentially dangerous key allowed for mass assignment",
|
||||
"file": "app/controllers/concerns/entryable_resource.rb",
|
||||
"line": 122,
|
||||
"link": "https://brakemanscanner.org/docs/warning_types/mass_assignment/",
|
||||
"code": "params.require(:account_entry).permit(:account_id, :name, :date, :amount, :currency, :excluded, :notes, :nature, :entryable_attributes => self.class.permitted_entryable_attributes)",
|
||||
"render_path": null,
|
||||
"location": {
|
||||
"type": "method",
|
||||
"class": "EntryableResource",
|
||||
"method": "entry_params"
|
||||
},
|
||||
"user_input": ":account_id",
|
||||
"confidence": "High",
|
||||
"cwe_id": [
|
||||
915
|
||||
],
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"warning_type": "Dynamic Render Path",
|
||||
"warning_code": 15,
|
||||
|
@ -115,6 +138,6 @@
|
|||
"note": ""
|
||||
}
|
||||
],
|
||||
"updated": "2024-11-02 15:02:28 -0400",
|
||||
"updated": "2024-11-27 15:33:53 -0500",
|
||||
"brakeman_version": "6.2.2"
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
en:
|
||||
account:
|
||||
entries:
|
||||
create:
|
||||
success: Entry created
|
||||
destroy:
|
||||
success: Entry deleted
|
||||
empty:
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
en:
|
||||
account:
|
||||
holdings:
|
||||
destroy:
|
||||
success: Holding deleted
|
||||
holding:
|
||||
per_share: per share
|
||||
shares: "%{qty} shares"
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
en:
|
||||
account:
|
||||
trades:
|
||||
create:
|
||||
failure: Something went wrong
|
||||
success: Transaction created successfully.
|
||||
form:
|
||||
account: Transfer account (optional)
|
||||
account_prompt: Search account
|
||||
|
@ -15,6 +12,15 @@ en:
|
|||
submit: Add transaction
|
||||
ticker_placeholder: AAPL
|
||||
type: Type
|
||||
header:
|
||||
buy: Buy
|
||||
current_market_price_label: Current Market Price
|
||||
overview: Overview
|
||||
purchase_price_label: Purchase Price
|
||||
purchase_qty_label: Purchase Quantity
|
||||
sell: Sell
|
||||
symbol_label: Symbol
|
||||
total_return_label: Unrealized gain/loss
|
||||
index:
|
||||
amount: Amount
|
||||
new: New transaction
|
||||
|
@ -27,7 +33,6 @@ en:
|
|||
show:
|
||||
additional: Additional
|
||||
cost_per_share_label: Cost per Share
|
||||
current_market_price_label: Current Market Price
|
||||
date_label: Date
|
||||
delete: Delete
|
||||
delete_subtitle: This action cannot be undone
|
||||
|
@ -37,12 +42,5 @@ en:
|
|||
exclude_title: Exclude from analytics
|
||||
note_label: Note
|
||||
note_placeholder: Add any additional notes here...
|
||||
overview: Overview
|
||||
purchase_price_label: Purchase Price
|
||||
purchase_qty_label: Purchase Quantity
|
||||
quantity_label: Quantity
|
||||
settings: Settings
|
||||
symbol_label: Symbol
|
||||
total_return_label: Unrealized gain/loss
|
||||
update:
|
||||
success: Trade updated successfully.
|
||||
|
|
|
@ -2,11 +2,44 @@
|
|||
en:
|
||||
account:
|
||||
transactions:
|
||||
bulk_delete:
|
||||
success: "%{count} transactions deleted"
|
||||
bulk_edit:
|
||||
cancel: Cancel
|
||||
category_label: Category
|
||||
category_placeholder: Select a category
|
||||
date_label: Date
|
||||
details: Details
|
||||
merchant_label: Merchant
|
||||
merchant_placeholder: Select a merchant
|
||||
note_label: Notes
|
||||
note_placeholder: Enter a note that will be applied to selected transactions
|
||||
overview: Overview
|
||||
save: Save
|
||||
bulk_update:
|
||||
success: "%{count} transactions updated"
|
||||
form:
|
||||
account: Account
|
||||
account_prompt: Select an Account
|
||||
amount: Amount
|
||||
category: Category
|
||||
category_prompt: Select a Category
|
||||
date: Date
|
||||
description: Description
|
||||
description_placeholder: Describe transaction
|
||||
expense: Expense
|
||||
income: Income
|
||||
submit: Add transaction
|
||||
transfer: Transfer
|
||||
index:
|
||||
new: New transaction
|
||||
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
|
||||
|
@ -16,7 +49,6 @@ en:
|
|||
account_label: Account
|
||||
amount: Amount
|
||||
category_label: Category
|
||||
category_placeholder: Select a category
|
||||
date_label: Date
|
||||
delete: Delete
|
||||
delete_subtitle: This permanently deletes the transaction, affects your historical
|
||||
|
@ -27,13 +59,14 @@ en:
|
|||
analytics.
|
||||
exclude_title: Exclude transaction
|
||||
merchant_label: Merchant
|
||||
merchant_placeholder: Select a merchant
|
||||
name_label: Name
|
||||
nature: Type
|
||||
none: "(none)"
|
||||
note_label: Notes
|
||||
note_placeholder: Enter a note
|
||||
overview: Overview
|
||||
settings: Settings
|
||||
tags_label: Tags
|
||||
update:
|
||||
success: Transaction updated successfully.
|
||||
uncategorized: "(uncategorized)"
|
||||
unmark_transfers:
|
||||
success: Transfer removed
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
en:
|
||||
account:
|
||||
valuations:
|
||||
create:
|
||||
success: Valuation created successfully.
|
||||
form:
|
||||
amount: Amount
|
||||
submit: Add balance update
|
||||
header:
|
||||
balance: Balance
|
||||
index:
|
||||
change: change
|
||||
date: date
|
||||
|
@ -18,7 +18,6 @@ en:
|
|||
title: New balance
|
||||
show:
|
||||
amount: Amount
|
||||
balance: Balance
|
||||
date_label: Date
|
||||
delete: Delete
|
||||
delete_subtitle: This action cannot be undone
|
||||
|
|
|
@ -31,10 +31,11 @@ en:
|
|||
manual_entry: Enter account balance
|
||||
title: How would you like to add it?
|
||||
title: What would you like to add?
|
||||
chart:
|
||||
no_change: no change
|
||||
show:
|
||||
chart:
|
||||
balance: Balance
|
||||
no_change: no change
|
||||
owed: Amount owed
|
||||
menu:
|
||||
confirm_accept: Delete "%{name}"
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
---
|
||||
en:
|
||||
layouts:
|
||||
application:
|
||||
syncing: Syncing account data...
|
||||
auth:
|
||||
existing_account: Already have an account?
|
||||
no_account: New to Maybe?
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
---
|
||||
en:
|
||||
shared:
|
||||
syncing_notice:
|
||||
syncing: Syncing accounts data...
|
||||
confirm_modal:
|
||||
accept: Confirm
|
||||
body_html: "<p>You will not be able to undo this decision</p>"
|
||||
|
|
|
@ -1,37 +1,6 @@
|
|||
---
|
||||
en:
|
||||
transactions:
|
||||
bulk_delete:
|
||||
success: "%{count} transactions deleted"
|
||||
bulk_edit:
|
||||
cancel: Cancel
|
||||
category_label: Category
|
||||
category_placeholder: Select a category
|
||||
date_label: Date
|
||||
details: Details
|
||||
merchant_label: Merchant
|
||||
merchant_placeholder: Select a merchant
|
||||
note_label: Notes
|
||||
note_placeholder: Enter a note that will be applied to selected transactions
|
||||
overview: Overview
|
||||
save: Save
|
||||
bulk_update:
|
||||
success: "%{count} transactions updated"
|
||||
create:
|
||||
success: New transaction created successfully
|
||||
form:
|
||||
account: Account
|
||||
account_prompt: Select an Account
|
||||
amount: Amount
|
||||
category: Category
|
||||
category_prompt: Select a Category
|
||||
date: Date
|
||||
description: Description
|
||||
description_placeholder: Describe transaction
|
||||
expense: Expense
|
||||
income: Income
|
||||
submit: Add transaction
|
||||
transfer: Transfer
|
||||
header:
|
||||
edit_categories: Edit categories
|
||||
edit_imports: Edit imports
|
||||
|
@ -41,10 +10,6 @@ en:
|
|||
index:
|
||||
transaction: transaction
|
||||
transactions: transactions
|
||||
mark_transfers:
|
||||
success: Marked as transfer
|
||||
new:
|
||||
new_transaction: New transaction
|
||||
searches:
|
||||
filters:
|
||||
amount_filter:
|
||||
|
@ -77,5 +42,3 @@ en:
|
|||
equal_to: equal to
|
||||
greater_than: greater than
|
||||
less_than: less than
|
||||
unmark_transfers:
|
||||
success: Transfer removed
|
||||
|
|
|
@ -69,22 +69,42 @@ Rails.application.routes.draw do
|
|||
|
||||
member do
|
||||
post :sync
|
||||
end
|
||||
|
||||
scope module: :account do
|
||||
resources :holdings, only: %i[index new show destroy]
|
||||
resources :cashes, only: :index
|
||||
|
||||
resources :transactions, only: %i[index update]
|
||||
resources :valuations, only: %i[index new create]
|
||||
resources :trades, only: %i[index new create update] do
|
||||
get :securities, on: :collection
|
||||
end
|
||||
|
||||
resources :entries, only: %i[index edit update show destroy]
|
||||
get :chart
|
||||
end
|
||||
end
|
||||
|
||||
namespace :account do
|
||||
resources :holdings, only: %i[index new show destroy]
|
||||
resources :cashes, only: :index
|
||||
|
||||
resources :entries, only: :index
|
||||
|
||||
resources :transactions, only: %i[show new create update destroy] do
|
||||
resource :category, only: :update, controller: :transaction_categories
|
||||
|
||||
collection do
|
||||
post "bulk_delete"
|
||||
get "bulk_edit"
|
||||
post "bulk_update"
|
||||
post "mark_transfers"
|
||||
post "unmark_transfers"
|
||||
end
|
||||
end
|
||||
|
||||
resources :valuations, only: %i[show new create update destroy]
|
||||
resources :trades, only: %i[show new create update destroy]
|
||||
end
|
||||
|
||||
direct :account_entry do |entry, options|
|
||||
if entry.new_record?
|
||||
route_for "account_#{entry.entryable_name.pluralize}", options
|
||||
else
|
||||
route_for entry.entryable_name, entry, options
|
||||
end
|
||||
end
|
||||
|
||||
resources :transactions, only: :index
|
||||
|
||||
# Convenience routes for polymorphic paths
|
||||
# Example: account_path(Account.new(accountable: Depository.new)) => /depositories/123
|
||||
direct :account do |model, options|
|
||||
|
@ -104,15 +124,7 @@ Rails.application.routes.draw do
|
|||
resources :other_assets, except: :index
|
||||
resources :other_liabilities, except: :index
|
||||
|
||||
resources :transactions, only: %i[index new create] do
|
||||
collection do
|
||||
post "bulk_delete"
|
||||
get "bulk_edit"
|
||||
post "bulk_update"
|
||||
post "mark_transfers"
|
||||
post "unmark_transfers"
|
||||
end
|
||||
end
|
||||
resources :securities, only: :index
|
||||
|
||||
resources :invite_codes, only: %i[index create]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue