1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 07:39:39 +02:00

feat(import): add currency and number format support for CSV imports (#1819)
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

* feat(import): add currency and number format support for CSV imports

* feat(import): add currency and format for mint and trade

* fix(imports): remove currency field in favor of currency csv col

* fix(imports): remove validate column from import model

* test(import): add some tests for imports

* test(import): add some tests for generate_rows_from_csv

* fix: change method name for import model

* fix: change before validation

---------

Co-authored-by: danestves <danestves@users.noreply.github.com>
This commit is contained in:
Daniel Esteves 2025-02-10 16:31:28 -04:00 committed by GitHub
parent 9e5f1574bc
commit 077694bbde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 307 additions and 13 deletions

View file

@ -28,14 +28,19 @@ class TransactionImportTest < ActiveSupport::TestCase
end
test "imports transactions, categories, tags, and accounts" do
import = <<-CSV
import = <<~CSV
date,name,amount,category,tags,account,notes
01/01/2024,Txn1,100,TestCategory1,TestTag1,TestAccount1,notes1
01/02/2024,Txn2,200,TestCategory2,TestTag1|TestTag2,TestAccount2,notes2
01/03/2024,Txn3,300,,,,notes3
CSV
@import.update!(raw_file_str: import)
@import.update!(
raw_file_str: import,
date_col_label: "date",
amount_col_label: "amount",
date_format: "%m/%d/%Y"
)
@import.generate_rows_from_csv