Commit graph

79 commits

Author SHA1 Message Date
Andros Fenollosa
c10e222c09 Show all polls (active and expired) in GET /polls/ endpoint
- Modified _get_all_polls() to return both active and expired polls
- Added is_active field to indicate poll status
- Updated test to reflect new behavior
- Polls are ordered by creation date (newest first)
2025-09-21 12:05:41 +02:00
Andros Fenollosa
bf6797ba55 Add polls endpoints functionality
Implemented comprehensive polls API endpoints for Org Social Relay:

- GET /polls/ - List all active polls in the system
- GET /polls/?feed=<url> - Get polls for a specific feed
- GET /polls/?voter=<url> - Get votes cast by a specific voter
- GET /polls/votes/?feed=<url>&poll_id=<id> - Get votes for a specific poll

Features:
- Complete API endpoints with proper error handling
- Comprehensive test suite with 15 test cases
- Caching for improved performance
- Response format compliance with existing API patterns
- Support for filtering active vs expired polls
- Vote counting and aggregation
- Query parameter validation

Technical details:
- Created new Django app 'polls' in app/polls/
- Added polls app to Django settings and URL configuration
- Uses existing poll models from feeds app (PollOption, PollVote)
- Follows established patterns for API responses and error handling
- All tests passing with proper Given/When/Then structure
2025-09-21 11:52:25 +02:00
Andros Fenollosa
8a53198ad6 Added polls 2025-09-20 20:05:16 +02:00
Andros Fenollosa
9e434c2bc5 Fixed cache 2025-09-20 19:16:04 +02:00
Andros Fenollosa
4bf78d0648 Updated mentions 2025-09-20 10:18:17 +02:00
Andros Fenollosa
9616c5c581 Added mentions and tasks 2025-09-19 16:09:27 +02:00
Andros Fenollosa
f828698892 Added table 2025-09-17 09:12:27 +02:00
Andros Fenollosa
d4b6b41071 Updated Redis connection and README 2025-09-17 09:09:35 +02:00
Andros Fenollosa
4042e9d3a4 Fixed crontab 2025-09-17 08:56:10 +02:00
Andros Fenollosa
bf93fc5ece Minor fix 2025-09-17 08:50:54 +02:00
Andros Fenollosa
d5a1fc36b1 Fixed routers 2025-09-17 08:47:28 +02:00
Andros Fenollosa
0c279c509c Added cache 2025-09-16 16:12:03 +02:00
Andros Fenollosa
940bc47a8b Remove uv 2025-09-16 16:06:28 +02:00
Andros Fenollosa
3983e81518 Minor bug 2025-09-16 15:58:12 +02:00
Andros Fenollosa
685918bfae Added uv 2025-09-16 15:52:23 +02:00
Andros Fenollosa
db3cc39019 Fixed Redis sleep 2025-09-16 15:50:16 +02:00
Andros Fenollosa
10b277e30f Upload 2025-09-16 15:46:32 +02:00
Andros Fenollosa
c16bc97222 Reverse proxy 2025-09-16 15:43:45 +02:00
Andros Fenollosa
b9e6a2a6a3 Fix minor bug 2025-09-16 15:41:57 +02:00
Andros Fenollosa
4c185ccd46 Added envExample 2025-09-16 15:39:12 +02:00
Andros Fenollosa
d3f5e38a54 Feeds endpoints 2025-09-16 15:28:21 +02:00
Andros Fenollosa
8f65ba63a0 Added first test 2025-09-12 15:53:32 +02:00
Andros Fenollosa
c62d64395e First commit 2025-09-12 11:29:00 +02:00
Andros Fenollosa
ee9a3e23eb Fix 2025-09-12 07:32:11 +02:00
Andros Fenollosa
7847b52e96 Updated 2025-09-11 12:12:24 +02:00
Andros Fenollosa
371cb5e2c0 Test 2025-09-11 10:50:37 +02:00
Andros Fenollosa
8a9bbfd1ac Test 2025-09-11 10:48:26 +02:00
Andros Fenollosa
96d1159f73 Updated 2025-09-11 10:46:15 +02:00
Andros Fenollosa
716d3e5833 Add files via upload 2025-09-05 12:22:04 +02:00