feat: MobileNumber auth + optional metadata on /employee/login#130
Open
Aadil-Ahmed-27 wants to merge 1 commit into
Open
feat: MobileNumber auth + optional metadata on /employee/login#130Aadil-Ahmed-27 wants to merge 1 commit into
Aadil-Ahmed-27 wants to merge 1 commit into
Conversation
Aadil-Ahmed-27
force-pushed
the
feat/get-employee-by-phone-with-role
branch
from
June 22, 2026 12:00
dbd622c to
c399dd5
Compare
… metadata to /employee/login
Aadil-Ahmed-27
force-pushed
the
feat/get-employee-by-phone-with-role
branch
from
June 22, 2026 13:10
c399dd5 to
f0b2fbb
Compare
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.
Summary
Extends
POST /internal/fleet-operator/{gtfs_id}/employee/loginwith a second auth flow and optional richer responses, consolidating the conductor/manager lookup use case into the existing endpoint rather than adding a new one.New behaviour
auth_type: \"MobileNumber\"— verify an employee bymobile_no+ optionaltoken_no. ExistingEmailauth is unchanged on the success path.?withMetadata=true— optional query param; when set, the response includesEmployeeMetadata { first_name, last_name, mobile_no, depot_name, depot_code }.chennai_bus→ primaryemployees+designationsfirst, fall back toemployees_internal+designations_internal.gtfs_id→ internal pool only, filtered bye.gtfs_id.token_nois absent the server returnsverified: trueif the phone resolves; when present, it must match.PERSON_NOT_FOUND,TOKEN_MISMATCH,EMAIL_AUTH_FAILED,MISSING_MOBILE_NO,MISSING_EMAIL_HASH,MISSING_PASSWORD_HASH,MISSING_AUTH_TYPE.Role::Manageradded (driver | conductor | manager). Email path filtersManagertoNonefor now so the driver-app Haskell catch-all stays correct until that side is updated.DBVehicleReader(entity_id→{ name, code }, 2-hour TTL), populated lazily fromentitiesorentities_internal. No moreentitiesJOIN in the employee query.Notes
errorfield (additive).GTFSService::load_initial_datastart-up failures are now soft (logswarn!) instead of crashing the boot. Will be split into its own PR after a follow-up commit.Test plan
verified:true, role:driververified:false, error:EMAIL_AUTH_FAILEDwithMetadata=true→ metadata populatedwithMetadata=true→ successtoken_no→ verification skipped,verified:trueTOKEN_MISMATCHPERSON_NOT_FOUNDmobile_no→MISSING_MOBILE_NOrole:manager