Commit Graph

238 Commits

Author SHA1 Message Date
9faebb6cea container: plugins: root: fix example3()'s usage of throw handler
The old macros should *not* have been used in any example; as they
were intended for internal use only.

This was noted in Doxygen ...by not noting them as publicly consumable.
2025-11-21 11:15:58 -08:00
ca59169116 container: root: rewrite throw handler, refactor using common types
- Refactor using common types that were once internal
- Removes ancient macro approaches to C++20 solutions
- Changes `Exception` message type to use std::string
  * std::string_view isn't worthwhile in this context
2025-11-21 11:15:58 -08:00
fa91fd02e8 container: root: factor out internal types to common
These types and handlers are too generic to be kept internal only.

They can now be used across all root macros, plugins and overall API.
2025-11-20 17:44:32 -08:00
cf68f02d2f container: root: test: utility: add tests for common 2025-11-19 13:23:52 -08:00
0d4b293b2d client/container: root: refactor common namespace
- Factor out respective common from macro and apply to all scopes
  * `dfi::common`
  * `dfi::macro::common`
  * `dfi::plugin::common`

- Add deprecation warnings in `dfi::macro::common`
  * Common functionality (not macro specific) is now in `dfi::common`

- Add convenience wrappers to inner common impl, where appropriate
  * Allows for backwards compatibility

- Add/update/clarify code docs and Doxygen definitions

- Related refactoring

NOTE: all changes are backward compatible (no need to bump major).
2025-11-19 13:23:52 -08:00
8c76e7cc11 container: root: macro: common: throw if invalid loading path
- Fixes silent failure when attempting to load non-existent/invalid path
- Applies to any macro, plugin or path that's loaded through this class
2025-11-14 13:19:09 -08:00
8b59cee84c client/container: root: migrate to Botan3
- This is possible now that `dfi`'s ROOT build supports C++20
- No internal `dfi` API or impl changes are necessary
  * This includes any Botan signatures
2025-11-07 13:13:53 -08:00
249e2ca77a container: hledger-flow: electrum: add mockup w/ lightning 2025-10-29 15:54:44 -07:00
d684f370ff container: hledger-flow: electrum: add lightning, backwards compat
*WARNING*: lightning support is a WIP due to an unresolved electrum
lightning history bug (see docker-finance #227).

This commit is needed for backwards compatibility, as the new electrum
format will break import - even if lightning is never used.
2025-10-29 15:54:44 -07:00
0266157abe client/container: usage help updates 2025-10-28 12:13:10 -07:00
da40a93ae1 container: lib_taxes: don't attempt to patch non-existent taxable events
An optimization and printing cleanup (attempts to patch won't break)
2025-10-28 12:09:57 -07:00
960e51fe0a container: lib_taxes: fix printing for 'all' years 2025-10-28 12:09:57 -07:00
e9960461b7 container: lib_taxes: fix arg parsing for 'all' years
Impl was not able to process 'all' years because global_arg_year was set
2025-10-28 12:09:57 -07:00
9735317ae8 container: plugins: root: fix example3()'s shell
The spawned shell needs its sourced environment and aliases.

Resolves:

  sh: line 1: dfi: command not found
  Error in <TRint::HandleTermInput()>: std::runtime_error caught:
          FILE = "/home/business/docker-finance/plugins/root/example.cc"
          LINE = 125
          WHAT = "command failed"
2025-10-22 16:01:05 -07:00
aaf3c21b7d container: hledger-flow: ethereum-based: compound: add internal swapping
when supplying/withdrawing.
2025-10-15 10:32:32 -07:00
e3f50ddb72 container: hledger-flow: vultr: add credits support
- Fixes direction to allow for credits issued by Vultr for N instances
- Updates documentation, adds where to put invoices to catch Sales Tax
2025-10-09 12:41:31 -07:00
aac3f780f9 Merge pull request #223 into master
5fb1d6f container: lib_reports: bump Copyright year (Aaron Fiore)
2025-10-03 14:17:50 -07:00
5fb1d6f2b0 container: lib_reports: bump Copyright year 2025-10-03 14:16:13 -07:00
3383b5c73f container: migrate from xsv to xan
`xsv` is no longer maintained and the author recommends `xan` instead.

Fortunately, `xan` is very suitable for our use-case; is very efficient,
and produces no differences in our expected output.
2025-10-03 14:09:34 -07:00
2f293ed566 container: lib_taxes: run linter 2025-10-02 17:19:21 -07:00
66c34a4b1c container: lib_taxes: optimize writes by forking
- Decreases real time in multicore container environments.
  * Given the nature of the writer, there should be no race conditions.
2025-10-02 17:09:48 -07:00
bf3a4e36e6 container: lib_reports: optimize writes by forking
- Decreases real time in multicore container environments.
  * Given the nature of the writer, there should be no race conditions.
2025-10-02 17:09:17 -07:00
3a35e45ffa container: hledger-flow: add explicit amount4 to applicable rules
For rule consistency. Does not affect balances or other functionality.
2025-09-19 12:55:47 -07:00
d83d9835da container: root: macro: Hash: change output to CSV format
The output can now be used with container's CSV tools.
2025-09-19 10:48:01 -07:00
c604ca8e39 container: root: macro: Random: change output to CSV format
The output can now be used with container's CSV tools.
2025-09-19 10:18:36 -07:00
c68a6680ef container: finance: completion: add 'help' to plugins 2025-09-04 15:08:20 -07:00
c3364511b0 container: finance: lib_plugins: update usage help
- Clarify usage, add examples, note plugin support type
  * finance's `plugins` only supports shell-based plugins
    - To use `root` plugins, use `root` command (see `root help`)
2025-09-04 15:08:20 -07:00
745a16e086 container: finance: completion: add root 2025-09-04 15:08:20 -07:00
33486665a9 container: root: rootlogon.C: remove default help()
Help will automatically load when starting an interactive instance.
2025-09-04 15:08:19 -07:00
ed163448f9 container: finance: add lib_root impl (macro/plugin support)
- dfi's `root` now supports shell loading (and running) of
  macros/plugins:

  * An interactive ROOT.cern instance is no longer *always* needed:

    - For macros (non-server); a 'one-off' instance will start, load the
      given macro, run the macro and then the instance will exit.

      * Server(s) will maintain an interactive instance.

    - For plugins; an interactive instance will start, load the given
      plugin, and then leave the user to make their calls manually.

  * All repo macros and repo/custom plugins are available.

- By default, an interactive instance will start when no dfi `root`
  arguments are given.

See `root help` for details.
2025-09-04 15:08:19 -07:00
2ec14fa1e1 container: hledger-flow: paypal-business: add expenses description subaccount
- If expense description exists, add description as subaccount
  * This is consistent with all other legacy finance rules
    - Typically, legacy institutions provide a column for category type.
      Since PayPal doesn't provide that data, using the description will
      provide the needed information for granular (full view) reporting.

- Removes old TODO that is no longer applicable
  * End-user will need to use custom rules, if needed
2025-09-02 13:23:35 -07:00
ef3b255bac container: hledger-flow: paypal: add expenses description subaccount
- If expense description exists, add description as subaccount
  * This is consistent with all other legacy finance rules
    - Typically, legacy institutions provide a column for category type.
      Since PayPal doesn't provide that data, using the description will
      provide the needed information for granular (full view) reporting.
2025-09-02 13:22:56 -07:00
b1ed20a4c8 container: hledger-flow: finish uniform fiat subaccounts
- For consistency across *all* hledger-flow accounts/rules.
- For future-proofing legacy finance (as related to #163).
2025-08-29 13:09:54 -07:00
178c197320 container: lib_fetch: fix wording to reflect impl 2025-08-26 14:06:46 -07:00
abac2a37d6 container: c++: run linter 2025-08-19 13:57:31 -07:00
1ce08021f8 container: c++: dfi namespace refactor
Align with project alias, save the eyes and hands.
2025-08-19 13:54:18 -07:00
491d77553f container: php: dfi namespace refactor
Align with project alias, save the eyes and hands.
2025-08-19 13:53:50 -07:00
903560ccc3 container: php: refactor for linter
- Removes deprecations (since PHP 8.4)
- Resolves linter errors
2025-08-19 11:09:05 -07:00
07b710567d container: fetch: refactor for php
- Refactors locations for internal `fetch` impl and deps (composer)
  * A softer hardcoding without the need for a new autoloader
  * A restructured solution to silence the linter (phpstan)

NOTE: variables are prepended with *_PHP_* as to not bring confusion
with any other `dfi` dependencies or the `dfi` `root` module (C++).
2025-08-18 14:37:29 -07:00
671362b445 container: finance: fetch: prices: format non-alpha currencies
Formats non-alpha character currencies for hledger's prices journal
(e.g., "1INCH", "USDC.e", etc.)
2025-08-08 13:58:38 -07:00
812d9cc7ce container: hledger-flow: remove potential % interpretation (printf)
Removes potential interpretation of percent signs in various types of
descriptions/notes/labels (otherwise, import may break).

Resolves "fatal: not enough arguments to satisfy format string" under
certain conditions.
2025-08-08 12:56:14 -07:00
cc2e4a736f container: hledger-flow: btcpayserver: update mockups
Reflects latest "Legacy Invoice Export" and "Wallets" exports.
2025-08-08 12:33:24 -07:00
5920d87f86 container: hledger-flow: btcpayserver: support "Legacy Invoice Export" plugin, update "Wallets" impl
BTCPay Server v2.2.0 has a new "Invoices" export format that is more
complex than the prior "Legacy Invoice Export" format.

To help facilitate the transition to the new format, upstream has
provided a plugin for backwards compatibility. However, this plugin
happens to provide additional columns that must be supported.

Additionaly, the "Wallets" format also has new columns with fee
information, so the impl now supports tx fees (prior, fees required
manual input).

The "Wallets" impl also now defaults to a refund expense account for
outgoing txs and adds tax rules & documentation for rationale.
2025-08-08 12:33:24 -07:00
731f9206f8 container: lib_taxes: remove non-alpha char (currency) hack
Now supported within flow impl.
2025-08-08 12:25:18 -07:00
facde4f533 container: fetch: gemini: remove non-alpha char (currency) hack
Now supported within flow impl.
2025-08-08 12:25:18 -07:00
b51b94d8a3 container: hledger-flow: support non-alpha chars (currency)
Removes old hack for currencies with non-alpha characters.
2025-08-08 12:25:18 -07:00
418ed80a8c container: hledger-flow: ethereum-based: support non-alpha chars (currency)
- Fixes broken import of any tx that contains non-alpha character(s) in
  its currency (digits, etc.)
  * Currencies may now contain any character(s) supported by hledger
2025-08-04 15:27:33 -07:00
0ce9302e50 container: hledger-flow: ethereum-based: rules (spam): add arbitrum/base/optimism, update polygon 2025-08-04 15:07:42 -07:00
cc024b838e container: hledger-flow: metamask: mockups: add arbitrum/base/optimism, update polygon 2025-08-04 15:07:10 -07:00
d270d56366 client/container: ethereum-based: support Etherscan V2, add more L2 chains
- Implements support for unified API via Etherscan V2 (ethereum-based)
  * All ethereum-based L2s are now accessed via single API endpoint
    - Chains are now available via chain ID
  * Updates API key requirement for `fetch` ethereum-based subaccounts
    - The API key's value must now be prepended with "etherscan"
      * Previously was prepended per-chain ("ethereum" or "polygon")
    - The API key is now *required* (can be generated at etherscan.io)
      * Resolves fatal error in Etherscan::parse_response()
      * Impl will now handle if:
        - Config's API key/value is malformed
        - Etherscan API key was not given
        - Etherscan response is fatal

- Adds support for more L2s
  * Arbitrum (One)
  * Optimism
  * Base

- Adds more L2s to existing accounts
  * Coinbase Wallet
  * Ledger Live
  * MetaMask

- Updates documentation
  * Update default generated `fetch` config
  * Update `fetch` usage help
  * Update README
2025-08-04 15:07:10 -07:00