Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support firefly category in transaction processing script #381

Merged
merged 2 commits into from
Aug 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions workflows/process-firefly-transactions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
# to public nextcloud and firefly addresses.
# - Run the script `./workflows/process-firefly-transactions/test-locally.sh`
# from the root of the repository.
#
# For reference:
# - The Firefly III API is documented here:
# `https://docs.firefly-iii.org/firefly-iii/api/`.
# - The cospend API is defined here:
# `https://github.com/julien-nc/cospend-nc/blob/main/appinfo/routes.php`.

on:
script:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ async function main() {

const categoryid = pipe(
O.fromNullable(category),
O.orElse(() => O.fromNullable(t.category_name)),
O.flatMap((name) =>
RA.findFirst(Object.values(p.categories), (_) => _.name === name)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ const FireflyTransaction = S.struct({
amount: S.string,
description: S.string,
tags: S.array(S.string),
category_id: S.nullable(S.string),
category_name: S.nullable(S.string),
})
),
}),
Expand Down