Draft
Conversation
Test coverageSimpleCov coverage data was unavailable for this run. |
2b3e115 to
bb23e12
Compare
- Move JoinController from root to Api namespace - Change from redirect-based to JSON API endpoints: - GET /api/join/:join_code - public endpoint returns school_code - POST /api/join/:join_code - authenticated endpoint enrolls user - Returns JSON with redirect_url and school_code - Remove all redirect logic from controller - Simpler, cleaner API design for frontend consumption
- Updated JoinCodeGenerator to produce format: Consonant-Vowel-2Digits-Consonant-Vowel-2Digits - Example: GE86SU10 instead of BAFA2345 - Updated validation regex in SchoolClass model - Updated specs to test new format - All tests passing
- Remove consonants K, X, Z to reduce offensive word risk - Add OFFENSIVE_PATTERNS blacklist (AS, BA, BO, BU, DA, DI, FU, HO, PO, SH, TA, TI, VA) - Filter codes during generation to skip offensive CV patterns - Add test to verify no offensive patterns in generated codes - Max 100 attempts before raising error (very unlikely to hit) This prevents codes like BA55FU99 or DI12HO34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements join code functionality for school classes, allowing students to join classes using a unique 6-character code.
Changes
join_codecolumn toschool_classestableJoinCodeGeneratorutility for generating unique join codesSchoolClassmodel with automatic generation and regeneration/api/classes/join) for class enrollment via join codesPATCH /api/school_classes/:id/regenerate_join_code)join_codein school class API responses