From 08215a71b73e92dffe3cf565059ae960df12b69b Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Thu, 23 Jan 2025 23:46:10 -0300 Subject: [PATCH] Updated Import (markdown) --- Import.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Import.md b/Import.md index f0d48b7..c4d08c5 100644 --- a/Import.md +++ b/Import.md @@ -163,13 +163,25 @@ Transformations allow you to transform a value before it is coerced. #### Target-specific fields +Some targets have specific fields: + ##### `type` -For targets `account`, `category`, `account_group` you can set type to either "id" or "name". This will hel +For targets `account`, `category`, `tags`, `entities` and `account_group` you can set type to either `id` or `name`. This will define what to filter for when creating new objects. +For targets `account_currency`, `account_exchange_currency` and `currency_exchange`, you can set type to either `id`, `name` or `code`. This will define what to filter for when creating new objects. +##### `create` -Some targets have specific fields +For targets `tags`, `entities`, `tags`, `entities` and `account_group` you can set create to `true` or `false`. Defaulting to `true`. This will create new objects if they don't exist. This can only be used with type `name`. + +##### `format` +For targets `date` and `reference_date`, you **must** set the `format` config with a valid [Datetime format](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes). This can also be a list of formats, each one will be tried a match is found. + +##### `detection_method` +For target `type` you can set `detection_method` to `sign` for detecting transaction type from a amount sign (negative is Expense and positive is Income); `always_income` or `always_expense`. + +For target `is_paid` you can set `detection_method` to `boolean` to detect basic boolean strings; `always_paid` or `always_unpaid`. #### Example @@ -178,8 +190,15 @@ mapping: date: target: date source: transaction_date - required: true format: "%Y-%m-%d" + + reference_date: + target: reference_date + source: transaction_date + format: + - "%Y-%m-%d" + - "%d-%m-%Y" + - "%m-%d-%Y" amount: target: amount