Commit graph

4 commits

Author SHA1 Message Date
538751f21a Fixes user account creation in Fava/Beancount
This commit fixes two critical bugs in the user account creation flow:

1. **Always check/create in Fava regardless of Castle DB status**
   - Previously, if an account existed in Castle DB, the function would
     return early without checking if the Open directive existed in Fava
   - This caused accounts to exist in Castle DB but not in Beancount
   - Now we always check Fava and create Open directives if needed

2. **Fix Open directive insertion to preserve metadata**
   - The insertion logic now skips over metadata lines when finding
     the insertion point
   - Prevents new Open directives from being inserted between existing
     directives and their metadata, which was causing orphaned metadata

3. **Add comprehensive logging**
   - Added detailed logging with [ACCOUNT CHECK], [FAVA CHECK],
     [FAVA CREATE], [CASTLE DB], and [WALLET UPDATE] prefixes
   - Makes it easier to trace account creation flow and debug issues

4. **Fix Fava filename handling**
   - Now queries /api/options to get the Beancount file path dynamically
   - Fixes "Parameter 'filename' is missing" errors with /api/source

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 21:22:02 +01:00
992a8fe554 Creates default user accounts on wallet setup
Ensures consistent user account structure by proactively
creating core liability and asset accounts when a user
configures their wallet settings.
2025-11-08 23:41:17 +01:00
bb1dbcccd8 Adds per-user wallet configuration
Allows users to configure their own wallet ID, enabling
the system to track expenses and receivables on a per-user basis.

Introduces new database table, models, API endpoints, and UI elements
to manage user-specific wallet settings.
2025-10-22 14:54:25 +02:00
29983cedb7 Adds user settings for the Castle extension
Adds functionality to configure the Castle extension, including a wallet ID.

This allows administrators to customize the extension's behavior by specifying a dedicated wallet for castle operations.
2025-10-22 13:55:52 +02:00