Accounts in Leo Counter represent the real-world financial containers where your money lives — a checking account at your bank, a savings account, a cash wallet, or a digital payment app. Every movement you record must be linked to exactly one account, which means Leo Counter can track the running balance of each container and show you at a glance how money flows between them.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/juanVillamilEchavarria/Leo_Counter-app/llms.txt
Use this file to discover all available pages before exploring further.
The Account Model
Accounts are stored in thecuentas table. The model tracks both an saldo_inicial (the opening balance you enter when you create the account) and a saldo_actual (maintained automatically as movements are recorded and deleted).
SoftDeletes trait) was added in a later migration, so archived accounts are retained in the database and can be fully restored.
Account Fields
A short display name for the account (max 25 characters).
Opening balance at the time of account creation (min 0). Leo Counter uses this as the baseline from which
saldo_actual is calculated.The account type. Seeded types are stored in the
tipo_cuentas table. Examples include checking, savings, cash, and digital wallets — the exact values depend on your seeder configuration.The owner of the account. Owners are managed separately at
/propietarios.Optional free-text notes about this account (max 255 characters).
Account Types (TipoCuenta)
Account types are a simple lookup table (tipo_cuentas) that classifies how an account behaves. The seeded types are managed by your database seeder. The TipoCuenta model stores a single tipo_cuenta string field per record.
Account types are system-managed. You cannot create or modify them through the UI — they are seeded once when the application is first set up.
Owners (Propietarios)
Owners allow a household to track which family member or person is responsible for each account. This is especially useful when multiple people use the same Leo Counter instance and you need to separate, say, your personal checking account from a shared household account. Owner fields:First name (max 255 characters).
Last name (max 255 characters).
Phone number (max 255 characters).
Email address — must be unique across all owners.
Owner Routes
| Method | URI | Action |
|---|---|---|
| GET | /propietarios | List all owners |
| GET | /propietarios/create | Show creation form |
| POST | /propietarios | Store a new owner |
| GET | /propietarios/{id} | View owner detail |
| GET | /propietarios/{id}/edit | Show edit form |
| PUT | /propietarios/{id} | Update an owner |
| DELETE | /propietarios/{id} | Delete an owner |
Active / Inactive Toggle
You can pause an account — preventing new movements from being accidentally assigned to it — without deleting it. Use the toggle endpoint:{attribute} is active. The ToggleCuentaCommand is dispatched and flips the boolean flag. Inactive accounts remain visible in the account list but are filtered out of movement creation forms.
Soft Deletes and Archiving
Deleting an account viaDELETE /cuentas/{id} performs a soft delete (the destroy handler displays a flash message “Cuenta Archivada correctamente”). The record is moved to the trash and is no longer shown in the main account list. Historical movements linked to that account are retained.
Admins can restore or permanently hard-delete archived accounts from:
Account Routes
| Method | URI | Action |
|---|---|---|
| GET | /cuentas | List all active accounts |
| GET | /cuentas/create | Show creation form |
| POST | /cuentas | Store a new account |
| GET | /cuentas/{id}/edit | Show edit form |
| PUT | /cuentas/{id} | Update an account |
| DELETE | /cuentas/{id} | Archive (soft-delete) an account |
| PATCH | /cuentas/{id}/{attribute}/toggle | Toggle active flag |
Account Creation Workflow
Create an owner
Navigate to
/propietarios and create at least one owner record with a name, surname, phone number, and email. Each account must be assigned to an owner.Open account creation
Go to
/cuentas/create. The form loads available account types and owners automatically from the ListCuentaFormOptionsQuery.Fill in the details
Enter a name (max 25 chars), select the account type, assign an owner, set the opening balance, and optionally add notes.
Save the account
Submit the form. Leo Counter creates the account with
saldo_actual initialized to saldo_inicial. The account is immediately available as a target when recording movements.Relationship to Movements
Every movement — spontaneous, fixed, or pending — carries acuenta_id. When a movement is saved, Leo Counter automatically adjusts saldo_actual on the linked account:
- Income movements increase
saldo_actual. - Expense movements decrease
saldo_actual.
RevertTransactionEffectForCuentaResolver and ApplyTransactionEffectForCuentaResolver services, keeping account balances consistent at all times.