Refactor to remove Leetcode endpoint and related services #47#49
Refactor to remove Leetcode endpoint and related services #47#49AmanDeol7 wants to merge 9 commits intoDijkstra-Edu:qafrom
Conversation
There was a problem hiding this comment.
@AmanDeol7 we do not directly edit out older versions of DB migrations. You will need to generate a new version from the updated schema. Can you have a look at the instructions on the Readme for creating a new version on Alembic?
There was a problem hiding this comment.
This should not be deleted. Versions (especially the base version should not be changed on your own unless its finetuning
There was a problem hiding this comment.
The entire service can be deleted
There was a problem hiding this comment.
It has getAllLeetcodeData service, which is used by statistics controller, which is later called by frontend.
JRS296
left a comment
There was a problem hiding this comment.
Kindly make the requested changes, and let me know if you have trouble with Alembic
… #47
Remove LeetCode Integration - Complete Feature Cleanup
📋 Description
This pull request completely removes the LeetCode profile integration feature from the Dataforge application. The refactoring includes cleanup of controllers, services, repositories, data models, DTOs, and database migrations.
🎯 Objective
Deprecate and remove the LeetCode profile feature to streamline the codebase and reduce maintenance burden.
📦 Changes Summary
Backend API
app/Controllers/User/leetcode_controller.py(105 lines)/sync/{profile_id}/{lc_username}Service Layer
app/Services/User/leetcode_service.pyLeetCodeServiceclass and all its methodsgetAllLeetcodeData()for API fetching (read-only)Data Access Layer
app/Repository/User/leetcode_repository.py(241 lines)LeetcodeRepository- core CRUD operationsLeetcodeBadgeRepository- badge managementLeetcodeTagRepository- tag management with filtering and sortingData Models
app/Schema/SQL/Models/models.pyLeetcodemodel classLeetcodeBadgesmodel classLeetcodeTagsmodel classProfile.leetcodeEnums & Constants
Modified:
app/Schema/SQL/Enums/enums.pyLeetcodeTagCategoryenum (FUNDAMENTAL, INTERMEDIATE, ADVANCED)Modified:
app/Utils/error_codes.pyUSER_LEETCODE_DB_A01/A02/A03(database errors)USER_LEETCODE_SRV_A01/A02(service errors)USER_LEETCODE_VAL_A01(validation error)USER_LEETCODE_NF_A01/A02/A03(not found errors)Exception Handling
app/Utils/Exceptions/user_exceptions.pyLeetcodeNotFoundexceptionLeetcodeBadgeNotFoundexceptionLeetcodeTagNotFoundexceptionEntity DTOs
app/Entities/leetcode_entity.py(196 lines)CreateLeetcode,UpdateLeetcode,ReadLeetcodeDTOsCreateLeetcodeBadge,UpdateLeetcodeBadge,ReadLeetcodeBadgeDTOsCreateLeetcodeTag,UpdateLeetcodeTag,ReadLeetcodeTagDTOsReadLeetcodeWithRelationsaggregated DTOApplication Configuration
app/main.pyleetcode_controllerapp.include_router(leetcode_controller.router)Database
app/migrations/versions/a02260f2e326_drop_leetcode_models_and_tables.pyLeetcodeTagstableLeetcodeBadgestableLeetcodetable📝 Breaking Changes
The following API endpoints are removed:
POST /Dijkstra/v1/leetcode/sync/{profile_id}/{lc_username}GET /Dijkstra/v1/leetcode/id/{leetcode_id}GET /Dijkstra/v1/leetcode/{github_username}GET /Dijkstra/v1/leetcode/profile/{profile_id}DELETE /Dijkstra/v1/leetcode/{leetcode_id}/badges/*/tags/*📊 Code Impact
🚀 Deployment Notes
Related Issue: #47
Type: Refactoring / Deprecation
Scope: User Module - LeetCode Integration