Skip to content

Automatically assign door codes to new members via external service#2105

Merged
adarshm11 merged 4 commits into
devfrom
feature/door-code-distribution
May 3, 2026
Merged

Automatically assign door codes to new members via external service#2105
adarshm11 merged 4 commits into
devfrom
feature/door-code-distribution

Conversation

@adarshm11

@adarshm11 adarshm11 commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Problem

When a user pays for membership, their membership status is updated automatically, but their door code has to be manually assigned. This is a problem because most members pay almost exclusively for the door code so this should be automated.

Context

I created DCD, a simple microservice to maintain and distribute door codes given to SCE by the department. This engine makes sure that the door codes are distributed evenly; since there are more members than door codes, there are inevitably repeats, but the codes are repeated at an almost identical frequency.

Implementation

I modified the workflow for membership validation by having Clark query DCD for a new door code, then assigning that door code to the user when updating their membership status. This includes robust error handling for tracking when issues occur with querying DCD, and also made it so that the API call to DCD can be mocked, in case of a local setup where the developer does not have access to the production DCD server.

Testing

This was tested on a local setup with Clark running in dev mode and DCD running on localhost port 5999. Using a test account with access level NON_MEMBER, verifying membership with a dummy payment record successfully updated the user's membership status to MEMBER and added a door code to the profile.

Before Running

Ensure that you set the DCD_URL field in api/config/config.json to be whatever the address of the DCD service is, so that Clark can correctly query for door codes.

@adarshm11 adarshm11 force-pushed the feature/door-code-distribution branch from f62db17 to 7218e48 Compare May 2, 2026 20:24

@weslayer weslayer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

touching u

@adarshm11 adarshm11 merged commit a95abfd into dev May 3, 2026
4 checks passed
@adarshm11 adarshm11 deleted the feature/door-code-distribution branch May 3, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants