229 lines
4.7 KiB
JSON
229 lines
4.7 KiB
JSON
{
|
|
"metadata": {
|
|
"extractionRules": [
|
|
{
|
|
"name": "account_iban",
|
|
"lineNumber": 2,
|
|
"regex": "IBAN:\\s*([A-Z0-9 ]+)",
|
|
"captureGroup": 1
|
|
},
|
|
{
|
|
"name": "account_name",
|
|
"lineNumber": 1,
|
|
"regex": "Konto:\\s*(.+)",
|
|
"captureGroup": 1
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"lineNumber": 3,
|
|
"regex": "Währung:\\s*([A-Z]{3})",
|
|
"captureGroup": 1
|
|
}
|
|
]
|
|
},
|
|
|
|
"capitalizationExceptions": ["AG", "GmbH", "SA"],
|
|
|
|
"csvStructure": {
|
|
"headerLine": 5,
|
|
"inputDelimiter": ";",
|
|
"outputDelimiter": ",",
|
|
"encoding": "UTF-8",
|
|
"hasBom": false
|
|
},
|
|
|
|
"columnTransformations": [
|
|
{
|
|
"sourceColumn": "Buchungsdatum",
|
|
"transformations": [
|
|
{
|
|
"type": "dateformat",
|
|
"fromFormat": "d.m.Y",
|
|
"toFormat": "Y-m-d"
|
|
}
|
|
],
|
|
"outputColumn": "date",
|
|
"outputAction": "overwrite"
|
|
},
|
|
{
|
|
"sourceColumn": "Buchungstext",
|
|
"transformations": [
|
|
{
|
|
"type": "trim"
|
|
},
|
|
{
|
|
"type": "replace",
|
|
"search": " ",
|
|
"replace": " "
|
|
},
|
|
{
|
|
"type": "lowercase"
|
|
}
|
|
],
|
|
"outputColumn": "description",
|
|
"outputAction": "overwrite"
|
|
},
|
|
{
|
|
"sourceColumn": "Auftraggeber/Empfänger",
|
|
"transformations": [
|
|
{
|
|
"type": "trim"
|
|
},
|
|
{
|
|
"type": "ucwordsfirst"
|
|
},
|
|
{
|
|
"type": "truncate",
|
|
"maxLength": 100
|
|
}
|
|
],
|
|
"outputColumn": "opposing_name",
|
|
"outputAction": "overwrite"
|
|
},
|
|
{
|
|
"sourceColumn": "Mitteilungen",
|
|
"transformations": [
|
|
{
|
|
"type": "trim"
|
|
},
|
|
{
|
|
"type": "split",
|
|
"delimiter": ";",
|
|
"part": 0
|
|
},
|
|
{
|
|
"type": "lowercase"
|
|
},
|
|
{
|
|
"type": "ucwordsfirst"
|
|
}
|
|
],
|
|
"outputColumn": "merchant",
|
|
"outputAction": "create"
|
|
},
|
|
{
|
|
"sourceColumn": "Mitteilungen",
|
|
"transformations": [
|
|
{
|
|
"type": "regexextract",
|
|
"pattern": "(\\d{4,} .*)"
|
|
}
|
|
],
|
|
"outputColumn": "location",
|
|
"outputAction": "create"
|
|
},
|
|
{
|
|
"sourceColumn": "Belastung",
|
|
"transformations": [
|
|
{
|
|
"type": "replace",
|
|
"search": "'",
|
|
"replace": ""
|
|
},
|
|
{
|
|
"type": "replace",
|
|
"search": ",",
|
|
"replace": "."
|
|
}
|
|
],
|
|
"outputColumn": "amount",
|
|
"outputAction": "create"
|
|
},
|
|
{
|
|
"sourceColumn": "Gutschrift",
|
|
"transformations": [
|
|
{
|
|
"type": "replace",
|
|
"search": "'",
|
|
"replace": ""
|
|
},
|
|
{
|
|
"type": "replace",
|
|
"search": ",",
|
|
"replace": "."
|
|
}
|
|
],
|
|
"outputColumn": "amount_credit",
|
|
"outputAction": "create"
|
|
},
|
|
{
|
|
"sourceColumn": "Saldo",
|
|
"transformations": [
|
|
{
|
|
"type": "replace",
|
|
"search": "'",
|
|
"replace": ""
|
|
},
|
|
{
|
|
"type": "replace",
|
|
"search": ",",
|
|
"replace": "."
|
|
}
|
|
],
|
|
"outputColumn": "balance",
|
|
"outputAction": "create"
|
|
},
|
|
{
|
|
"sourceColumn": "_constant_",
|
|
"transformations": [
|
|
{
|
|
"type": "constantvalue",
|
|
"metadataKey": "account_iban"
|
|
}
|
|
],
|
|
"outputColumn": "account_iban",
|
|
"outputAction": "create"
|
|
},
|
|
{
|
|
"sourceColumn": "_constant_",
|
|
"transformations": [
|
|
{
|
|
"type": "constantvalue",
|
|
"metadataKey": "currency_code"
|
|
}
|
|
],
|
|
"outputColumn": "currency_code",
|
|
"outputAction": "create"
|
|
},
|
|
{
|
|
"sourceColumn": "_constant_",
|
|
"transformations": [
|
|
{
|
|
"type": "constantvalue",
|
|
"metadataKey": "account_name"
|
|
}
|
|
],
|
|
"outputColumn": "account_name",
|
|
"outputAction": "create"
|
|
}
|
|
],
|
|
|
|
"fireflyImport": {
|
|
"mode": "docker",
|
|
|
|
"jsonConfig": "/import/configs/ubs-import.json",
|
|
|
|
"importerCommand": "docker exec firefly-importer php artisan importer:import",
|
|
|
|
"autoImport": false,
|
|
"deleteAfterImport": false,
|
|
"timeout": 300,
|
|
|
|
"environment": {
|
|
"FIREFLY_III_URL": "https://your-firefly.com",
|
|
"FIREFLY_III_ACCESS_TOKEN": "your-token-here"
|
|
}
|
|
},
|
|
|
|
"directories": {
|
|
"source": "/opt/ubs-csv-transformer/import/source",
|
|
"output": "/opt/ubs-csv-transformer/import/output",
|
|
"archive": "/opt/ubs-csv-transformer/import/archive",
|
|
"error": "/opt/ubs-csv-transformer/import/error"
|
|
},
|
|
|
|
"test": {
|
|
"maxRows": 10,
|
|
"showOutput": true
|
|
}
|
|
} |