"description":"Implement GET /api/v2/subscriptions/plans endpoint to return available subscription plans. Use SubscriptionManager.getAllSubscriptionPlans() or getSubscriptionDto() to fetch plans and return them in proper format.",
"acceptance_criteria":[
"GET /api/v2/subscriptions/plans returns 200 with list of plans",
"description":"Implement GET /api/v2/subscriptions/status endpoint to return current user's subscription status. Use SubscriptionManager.getSubscriptionDto() to get subscription info and return active status, start/finish dates.",
"acceptance_criteria":[
"GET /api/v2/subscriptions/status returns 200 with subscription status",
"Returns active: true/false correctly",
"Returns start and finish dates when subscription is active",
"description":"Implement POST /api/v2/subscriptions/purchase endpoint to handle subscription purchases. Accept planId in request body, validate plan exists, create payment via PaymentManager, and activate subscription for user.",
"acceptance_criteria":[
"POST /api/v2/subscriptions/purchase accepts planId in request body",
"description":"Implement POST /api/v2/subscriptions/cancel endpoint to cancel user's active subscription. Update UserSubscriptionModel to mark subscription as cancelled, set cancellation date, and prevent auto-renewal.",
"acceptance_criteria":[
"POST /api/v2/subscriptions/cancel cancels active subscription",
"Returns 200 with cancellation confirmation",
"Returns 400 if user has no active subscription",
"Returns 401 for unauthenticated requests",
"Subscription is marked as cancelled in database",
"description":"Implement GET /api/v2/promocodes endpoint to list available promocodes for current user. Return active campaigns with their promocodes that user can apply. Filter by active status and date range.",
"acceptance_criteria":[
"GET /api/v2/promocodes returns 200 with list of available promocodes",
"Only returns active campaigns within date range",
"Filters promocodes user hasn't already activated",
"Returns 401 for unauthenticated requests",
"Proper JSON format with campaign and code information",
"description":"Implement GET /api/v2/promocodes/{code}/validate endpoint to validate a promocode without applying it. Check if code exists, is active, hasn't exceeded activation limits, and user is eligible.",
"description":"Write comprehensive unit tests for all statistics-related models (PackProgressModel, AchievementModel, StudySessionModel) including toDto/fromDto conversions, serialization, and edge cases.",
"title":"Update OpenAPI Specification for Statistics Endpoints",
"priority":"medium",
"status":"pending",
"estimated_hours":2.0,
"description":"Update public/open_api.yaml to include all statistics endpoints (detailed, packs, words, timeline, sessions, achievements) with proper request/response schemas, query parameters, and examples.",
"acceptance_criteria":[
"All 6 statistics endpoints documented in OpenAPI spec",
"Request schemas defined with query parameters",
"Response schemas defined with proper types",
"Examples provided for each endpoint",
"Error responses documented (400, 401, 404)",
"OpenAPI spec validates without errors"
],
"dependencies":[],
"files_to_modify":[
"mnemo_cards_backend/public/open_api.yaml"
],
"component":"backend"
},
{
"id":"BACKEND-009",
"title":"Complete Statistics Integration Tests",
"priority":"medium",
"status":"pending",
"estimated_hours":4.0,
"description":"Complete integration tests for all statistics endpoints, ensuring end-to-end flow works correctly. Test pagination, filtering, error handling, and edge cases for all statistics endpoints.",
"acceptance_criteria":[
"Integration tests for getDetailedStatistics endpoint",
"Integration tests for getPacksStatistics with packId filter",
"Integration tests for getWordsStatistics with pagination and filters",
"Integration tests for getTimelineStatistics with period filtering",
"Integration tests for recordStudySession endpoint",
"description":"Create STATISTICS_API.md documentation and update PROGRESS.md and TODO.md with statistics system completion status. Document API endpoints, request/response formats, and usage examples.",
"acceptance_criteria":[
"STATISTICS_API.md created with comprehensive API documentation",
"All statistics endpoints documented with examples",
"Request/response formats documented",
"PROGRESS.md updated with statistics completion status",