Commit Graph

99 Commits

Author SHA1 Message Date
Kevin Bataille
f5e0bba298 remove container name 2025-10-06 15:23:42 +02:00
Kevin Bataille
9a35a57c7f fix(auth): Update API response parsing to handle nested structure
- Fix 'id_user' key not found error by navigating the correct nested path
- Extract id_user from data.user.applications[0].users[0].id_user
- Add fallback to old structure for backward compatibility
- Prevents authentication failures due to API response format changes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-06 15:21:21 +02:00
Kevin Bataille
cd5f0a54ac feat(notifier): Add username display and improve config error handling
- Add CROSSFIT_USERNAME from .env to all Telegram notifications
- Make session_config exit safely when config file is missing or invalid
- Remove default hardcoded sessions, return empty list instead
- Update unit tests to reflect new error handling behavior

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-06 15:19:27 +02:00
Kevin Bataille
d1e5fc1003 feat: Use preferred sesions as a template 2025-10-06 15:05:20 +02:00
Kevin Bataille
7d03f5b40c chore: Move docs and scripts into directories 2025-10-06 14:55:20 +02:00
Kevin Bataille
795016a60c fix(notifier): Add retry mechanism for Telegram timeout errors
- Add exponential backoff retry logic for Telegram notifications
- Handle TimedOut and NetworkError exceptions gracefully
- Add logging for retry attempts and failures
- Prevent booking system crashes due to network timeouts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-06 14:13:39 +02:00
kbe
b6ea2a4ff1 refactor: Remove CrossfitBooker class and simplify booking system 2025-10-01 17:54:43 +02:00
kbe
5f89af44aa Now include session ID in booking message 2025-08-30 15:08:34 +02:00
kbe
39d408d882 fix(booker): Recalculate today target time each day
The previous script was calculating target booking time at start. 
So when it was 20:00, it was not working correctly after the first day.
2025-08-30 13:14:51 +02:00
kbe
5bdde5fee1 feat: Add QWEN agent.md for AI use 2025-08-30 12:56:12 +02:00
kbe
8b8dd68b34 No more logging outside reservation window 2025-08-16 08:17:45 +02:00
5aee4dbaf4 Merge pull request 'fix: main script on docker launch' (#11) from develop into main
Reviewed-on: #11
2025-08-12 00:10:50 +00:00
kbe
81adedba6f fix: main script on docker launch 2025-08-12 02:10:24 +02:00
2a8299300c Merge pull request 'Improve error handling and logging' (#10) from develop into main
Reviewed-on: #10
2025-08-12 00:03:11 +00:00
kbe
fa9d73a9a9 feat: enhance booking process with improved error handling and logging
Added logging to display message when outside booking window in booker.py
Added error handling for asyncio.run in crossfit_booker.py
Added logging for errors during booking process
2025-08-12 02:02:20 +02:00
kbe
cfbb857cfb chore: Revised code linter 2025-08-12 01:50:33 +02:00
8d04f0075d Merge pull request 'Refactor code and split into multiple files' (#9) from develop into main
Reviewed-on: #9
2025-08-11 23:44:32 +00:00
kbe
4872b817b3 Merge branch 'refactor/booker' into develop 2025-08-12 01:43:32 +02:00
kbe
a7f9e6bacd Fixed failing tests in test_crossfit_booker_sessions.py
Fixed test_run_auth_failure by patching the correct method (CrossFitBooker.login) and calling the correct method (booker.login())
Fixed test_run_booking_outside_window by patching the correct method (Booker.run) and adding the necessary mocking for the booking cycle
Added proper mocking for auth_token and user_id to avoid authentication errors in the tests
Updated imports to use the src prefix for all imports
Added proper test structure for the booking window logic test
All tests now pass successfully
2025-08-12 01:38:50 +02:00
kbe
8d882ad091 refactor: Move files into src directory
Refactored project structure: Moved all Python modules to a src/ directory, updated imports accordingly. Added new environment variables to Dockerfile and docker-compose.yml. Removed Dockerfile.test and TODO file.
2025-08-12 01:10:26 +02:00
kbe
90230832ee refactor: Split code into many files 2025-08-12 00:53:16 +02:00
kbe
944421c68b refactor: Booking preferred sessions works
I modified the code to book only preferred sessions.
First it displays available sessions in console INFO.
Then if there is sessions that matches preferred ones,
it tries to book them and the notify bout it.
2025-08-12 00:20:21 +02:00
kbe
7161a11905 feat: Scripts display preferred sessions during execution 2025-08-12 00:09:56 +02:00
kbe
3b8a755a25 feat: Add book session script 2025-08-08 22:21:17 +02:00
kbe
6c29fc0802 chore: Renamed datetime to dt 2025-08-08 22:19:40 +02:00
kbe
439c5f3d6f feat: New script for booking test function in shell and python 2025-08-08 22:09:48 +02:00
kbe
30eb9863a0 refactor: does not notify if no session found 2025-08-08 21:54:12 +02:00
kbe
888728729f feat: more debug logs 2025-08-05 01:24:25 +02:00
kbe
a6cb6cb7b6 refactor: Reduce code size 2025-08-04 23:34:07 +02:00
kbe
d31976084a feat: Time delta as env var 2025-08-04 21:45:35 +02:00
kbe
90923b0f1c Less window timing and sessions change 2025-07-29 00:10:06 +02:00
kbe
d2b63ea807 More window timing 2025-07-29 00:06:03 +02:00
kbe
7b4d66c779 10 minutes window end 2025-07-26 09:13:06 +02:00
kbe
4401adfebb chore: no more 80% match for booking 2025-07-25 15:50:09 +02:00
kbe
2b99bc37de more tests? 2025-07-25 15:47:35 +02:00
kbe
f975cb529f test: More coverage on methods. All tests are passed. 2025-07-25 14:17:12 +02:00
kbe
0baa5b6e3f test: add more coverage 2025-07-25 14:09:03 +02:00
kbe
b2f923a6c3 test: more code coverage 2025-07-25 13:31:03 +02:00
kbe
17cb728dd9 test: add coverage for most methods but still bugs 2025-07-25 13:25:12 +02:00
kbe
5e597c4d1a refactor: try to reduce code size 2025-07-24 20:51:39 +02:00
kbe
352fae2d25 Merge branch 'develop' 2025-07-24 16:23:00 +02:00
kbe
3e33ae5132 add a functional file 2025-07-24 15:08:53 +02:00
kbe
cf4780d9d0 feat: only book session in current day, +1 and +2 2025-07-24 12:06:42 +02:00
kbe
ef65069592 feat: only book session during window + 1h 2025-07-21 23:48:44 +02:00
kbe
cacdd74184 feat: only book session during window + 1h 2025-07-21 23:48:14 +02:00
ef7f82bc76 Merge pull request 'feat: ENV var to toggle impossible notification' (#7) from develop into main
Reviewed-on: #7
2025-07-21 19:38:02 +00:00
kbe
fcd227e3ed feat: ENV var to toggle impossible notification 2025-07-21 21:32:05 +02:00
kbe
ed65cd836f Merge branch 'develop' 2025-07-21 21:12:41 +02:00
kbe
d6e9373321 feat: Send notification when booking is impossible 2025-07-21 21:07:58 +02:00
fa382f4c6b Merge pull request 'feat: Add a restart file to setup docker' (#6) from develop into main
Reviewed-on: #6
2025-07-21 18:51:29 +00:00