clemsonMakerspace / unified-makerspace

The Makerspace - now unified.
Apache License 2.0
9 stars 11 forks source link

refactor(cdk/visit/lambda_code): remove read dependency on old database #118

Closed DillonRanwala closed 1 year ago

DillonRanwala commented 1 year ago

for checking if user was registered.

Problem:

Current lambda code checks the old DynamoDB table (Database using PK and SK) to see if a user has already registered. This adds a dependency on the old table for our registration workflow in the log_visit.py file. We can get rid of this read dependency to potentially remove dual-writing system in the future.

Solution:

In log_visit.py, changed the isUserRegistered function. The query now checks the username column of new "users" table. Previously, the original "old" table's "PK" column was queried. This change checks if the users table has the requested username of the visit.

Testing:

Logs in Dev environment lambda visit function showed that this change was checking the new users table. Tables updated correctly for completely new usernames and existing usernames, so no functional difference.

Issue:

N/A, no open GitHub Issue.