Rename auto-save transactions to round-up

This commit is contained in:
2023-10-29 01:03:11 +00:00
parent a01611e193
commit 0adc7ae20a

View File

@@ -145,9 +145,9 @@ function createAutoSaveTransaction(array $group, array $arguments): void
'type' => 'transfer', 'type' => 'transfer',
'source_id' => $arguments['account'], 'source_id' => $arguments['account'],
'destination_id' => $arguments['destination'], 'destination_id' => $arguments['destination'],
'description' => '(auto save transaction)', 'description' => '(Round-up transaction)',
'date' => substr($first['date'], 0, 10), 'date' => substr($first['date'], 0, 10),
'tags' => ['auto-save'], 'tags' => ['Round-up'],
'currency_code' => $first['currency_code'], 'currency_code' => $first['currency_code'],
'amount' => $amountToCreate, 'amount' => $amountToCreate,
], ],
@@ -157,7 +157,7 @@ function createAutoSaveTransaction(array $group, array $arguments): void
// submit: // submit:
$result = postCurlRequest('/api/v1/transactions', $submission); $result = postCurlRequest('/api/v1/transactions', $submission);
$groupId = $result['data']['id']; $groupId = $result['data']['id'];
message(sprintf('For transaction #%d ("%s") with amount %s %s, have created auto-save transaction #%d with amount %s %s, making the total %s %s.', message(sprintf('For transaction #%d ("%s") with amount %s %s, have created round-up transaction #%d with amount %s %s, making the total %s %s.',
$group['id'], $group['id'],
$first['description'], $first['description'],
$first['currency_code'], $first['currency_code'],
@@ -200,7 +200,7 @@ function isAutoSaveTransaction(array $transaction): bool
} }
$hasTag = false; $hasTag = false;
foreach ($first['tags'] as $tag) { foreach ($first['tags'] as $tag) {
if ('auto-save' === $tag) { if ('Round-up' === $tag) {
return true; return true;
} }
} }