Commit Graph
22 Commits
Author SHA1 Message Date
Keith Solomon a7f35e79e2 Remove unused fetchLiveVaultBalance and its test 2026-08-07 17:50:45 -05:00
Keith Solomon 63c6cc6972 Replace broadcast backfill with per-entry re-fetch for running_balance 2026-08-07 17:39:22 -05:00
Keith Solomon 5b8abd8bbc Revert vaultLoop to per-user SQL MAX(running_balance) 2026-08-07 17:34:37 -05:00
Keith Solomon d1cb4196dd vaultLoop: sum per-user live /money balances for the all-users path 2026-08-07 14:19:34 -05:00
Keith Solomon 006520b4c0 vaultLoop: prefer live /money balance, fall back to MAX(running_balance) 2026-08-05 10:04:43 -05:00
Keith Solomon 728f7bb4a5 fetchLiveVaultBalance: split production/test cache paths so production caching works 2026-08-05 09:55:01 -05:00
Keith Solomon abb353a939 Add fetchLiveVaultBalance helper using v2 /money endpoint 2026-08-05 09:47:39 -05:00
Keith Solomon a81554a125 Add backfillRunningBalances helper for NULL running_balance rows 2026-08-03 22:41:22 -05:00
Keith Solomon a9e443eeb2 vaultLoop: use MAX(running_balance) per user instead of SUM(amount) 2026-08-03 22:17:11 -05:00
Keith Solomon 214891d957 fetchVaultRecords: explicit column list including running_balance 2026-08-03 22:00:56 -05:00
Keith Solomon af7a233272 Capture running_balance from v2 API data.balance 2026-08-03 21:54:40 -05:00
Keith Solomon 73360f6805 processLogEntries: skip incomplete entries instead of throwing
Per the spec's error-handling table, entries missing timestamp or
details.title should be skipped (logged via consoleLog) and the loop
should continue processing the rest. Previously the function threw
LogEntryIncompleteException and aborted the entire batch, which would
take down the whole UI when a single malformed entry was returned.
2026-08-03 14:17:27 -05:00
Keith Solomon 89ecaaa6c7 Remove dead prepareCheckStatement/prepareInsertStatement helpers
These helpers were no longer called after the v2 migration rewrote
processLogEntries and fetchAndStoreLogPage (the latter now prepares its
own idempotent INSERT inline). Rendered unused by the v2 migration.
2026-08-03 14:16:16 -05:00
Keith Solomon cb584e9d3a Restore consoleLog helper and remove test stub masking production fatal
The v2 rewrite of processLogEntries() calls consoleLog(...) at two
skip branches (no id, and no deposited/withdrawn). Commit 3ebc5e2 had
removed the project helper from includes/utilities.php, leaving a
production runtime fatal ("Call to undefined function consoleLog()")
the first time a non-vault entry flowed through fetchAndStoreLogPage
-> processLogEntries in real use.

The previous test appeared to pass only because it defined a local
no-op consoleLog stub via function_exists() guard — masking the defect
behind a test fixture that never reached either skip branch.

Fix:
  - Restore the original consoleLog() helper to
    includes/utilities.php (unchanged from the pre-3ebc5e2 codebase;
    spec lists it as unchanged).
  - Remove the local consoleLog stub from
    tests/process_log_entries_test.php so the test now exercises
    the real production code path.
2026-08-03 13:34:29 -05:00
Keith Solomon 2a55cc11ee Rewrite processLogEntries for v2 shape; add golden-file test 2026-08-03 13:27:43 -05:00
Keith Solomon 9a4a7291cc Add fetchAndStoreLogPage helper for v2 pagination 2026-08-03 13:19:38 -05:00
Keith Solomon 07a8bba1d5 Tighten validateApiResponse for v2 array shape 2026-08-03 13:13:50 -05:00
Keith Solomon 3ebc5e2850 Remove unauthorized consoleLog helper and restore original quote style 2026-08-03 13:06:30 -05:00
Keith Solomon e25a069e00 Rewrite executeApiCall for v2 API (Authorization header) 2026-08-03 13:01:52 -05:00
Keith Solomon 93b934c5cc Add LogEntryIncompleteException for malformed v2 entries 2026-08-03 12:56:32 -05:00
Keith Solomon 2811fc83e5 Enhance Torn Vault Tracker: Add documentation, improve exception handling, and update styles
Deploy website via FTP / Deploy (push) Skipped
- Updated .gitignore to exclude new directories and files.
- Enhanced config.php with detailed PHPDoc comments for better clarity.
- Refactored functions.php to include PHPDoc comments and improve code readability.
- Added custom exceptions in exceptions.php with detailed documentation.
- Improved utilities.php with better documentation and error handling.
- Updated index.php with structured comments and improved readability.
- Refined style.css for better visual consistency.
- Introduced phpcs.xml for coding style checks and standards enforcement.
2026-08-03 12:07:16 -05:00
Keith Solomon 7f1f4de553 Enhance README and refactor code structure for improved functionality
🚀 Deploy website via FTP / 🎉 Deploy (push) Failing after 8s
- Updated README.md with detailed project description, features, and installation instructions.
- Refactored functions.php to include configuration settings and improved database handling.
- Modified index.php for better user experience and added pagination controls.
- Introduced new utility functions for API handling and database interactions.
- Added CSS styles for improved layout and visibility of elements.
- Removed vault.csv as data is now managed through the database.
- Implemented FTP deployment workflow for automated deployment.
- Added exception handling classes for better error management.
- Created JavaScript functions for pagination of transaction records.
2026-08-03 11:26:55 -05:00