Commit Graph
58 Commits
Author SHA1 Message Date
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 e7ec343be1 Add implementation plan: Torn API v1 to v2 migration
- 8 tasks: exception class, API call rewrite, validation tightening,
  fetchAndStoreLogPage helper, processLogEntries rewrite with golden-file
  test, backfillUserLogs/syncUserLogs entry points, index.php call swap,
  end-to-end smoke check
- TDD: write the failing test before rewriting processLogEntries
- Each task is a self-contained commit
2026-08-03 12:47:59 -05:00
Keith Solomon c2b138d687 Add spec: Torn API v1 to v2 migration design
- Compares old (api-sample.json) and new (api-sample-new.json) shapes
- Specifies Authorization: ApiKey header instead of ?key= query param
- Specifies following _metadata.links.next for pagination
- Specifies entry.id (string) as PRIMARY KEY with INSERT ... ON CONFLICT DO NOTHING
- Adds backfillUserLogs (replaces firstRun) and syncUserLogs (renamed from getLog)
- Adds shared fetchAndStoreLogPage helper
- Adds golden-file unit test (no live API)
2026-08-03 12:42:19 -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 8c68e81c2e Refactor FTP deployment workflow by removing emojis and updating conditions for deployment trigger
Deploy website via FTP / Deploy (push) Skipped
2026-08-03 11:32:38 -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
Keith Solomon 6e63c37071 - Update README 2022-12-31 13:24:10 -06:00
Keith Solomon b13d9294da - Update vault.csv with default values
- Update README with vault info
2022-12-31 13:22:37 -06:00
Keith Solomon 28eecb304a - Update functions.php 2022-12-31 12:57:25 -06:00
Keith Solomon 31435f5520 - Update functions.php 2022-12-31 12:51:07 -06:00
Keith Solomon 85e5724c23 - Update functions.php for generic user names/keys
- Update README
2022-12-31 12:16:38 -06:00
Keith Solomon 66f1da90e4 - Add Torn profile link to README 2022-12-31 11:55:15 -06:00
Keith Solomon ce8cea41b9 - Add Torn profile link to README 2022-12-31 11:54:08 -06:00
Keith Solomon 6c24b59894 Add Torn profile link to README 2022-12-31 11:51:19 -06:00
Keith Solomon d7dfcdf3f9 Remove old project files 2022-12-31 11:48:07 -06:00
Keith Solomon e9a92be0c6 Git fix 2022-12-31 11:44:09 -06:00
Keith Solomon 887d758196 - Move to public repo
- Remove CSV values
- Readme typo fix
2022-12-31 11:37:08 -06:00
Keith Solomon c63adb7f93 - Move to public repo
- Remove CSV values
- Readme typo fix
2022-12-31 11:36:53 -06:00
Keith Solomon d86b718c65 - Update styles
- Reverse CSV array for transactions log
2022-12-23 19:21:30 +00:00
Keith Solomon 521644d997 Feature complete 2022-12-23 18:08:43 +00:00
Keith Solomon 28a923fcd7 - Display overall vault balance
- Add Roboto google font
2022-12-23 17:53:44 +00:00
Keith Solomon fb443e38b6 - Set up vault balance function
- Add comments for functions
2022-12-23 17:38:35 +00:00
Keith Solomon d414e6d83a Move vaultBalances to userBalances 2022-12-23 17:35:18 +00:00
Keith Solomon c3149ea2ab Move balance function to generic 2022-12-23 17:33:29 +00:00
Keith Solomon 388266609d - Adjust styles
- Adjust alignment
2022-12-23 17:30:53 +00:00
Keith Solomon abe10c88a2 Add variables for user name in balance function 2022-12-23 16:53:08 +00:00
Keith Solomon 828f13f975 - Move user balances to function
- Build overall vault balnce section
2022-12-23 16:50:24 +00:00
Keith Solomon 603fcd9bdd - Set up user balance calculations
- Display balances on page
2022-12-23 16:36:54 +00:00
Keith Solomon 43412ee0dc Correct date for initial balance 2022-12-23 09:58:10 -06:00
Keith Solomon 83727e2055 Remove old vault.csv 2022-12-23 09:55:49 -06:00
Keith Solomon b15cd81b10 Fix git issues 2022-12-23 09:53:21 -06:00
Keith Solomon 3a070bad6e Split testing 2022-12-23 09:35:37 -06:00
Keith Solomon 2b77e5eafc - Add function to calculate vault balances
- Modify split function to return a single user
2022-12-23 09:34:38 -06:00
Keith Solomon 71d04d660c - Add initial balance
- Adjust spacing in index.php
2022-12-23 09:25:07 -06:00
Keith Solomon 257a848970 - Remove array sort function 2022-12-22 19:10:27 -06:00
Keith Solomon 57c62d1a3d Update readme 2022-12-21 07:48:03 -06:00
Keith Solomon eeb5f63885 - Add readme file
- Move vault transaction output to function
- Add list of all transactions from vault
- Start balance calculation functins
2022-12-21 07:46:21 -06:00
Keith Solomon 41807cf76a Update CSV files 2022-12-20 06:45:36 -06:00
Keith Solomon 119b2ee28c -Misc fixes
-Add all entries CSV
2022-12-17 18:17:37 -06:00
Keith Solomon 9fe9df26bd - Set up csv storage
- Sort CSV array by timestamp
- Build transaction table from CSV
2022-12-17 15:45:30 -06:00
Keith Solomon e8fe2957a5 - Split functions and styles from index
- Start building generic log retrieval function
2022-12-17 13:26:00 -06:00
Keith Solomon be45c71db4 Set up Symos data array 2022-12-15 14:34:57 -06:00
Keith Solomon 8ee5a98a81 Add Symos API key 2022-12-15 11:27:21 -06:00
Keith Solomon 957d9cb656 Initial commit 2022-12-15 11:15:30 -06:00