UNLV-CS472-672 / 2024-S-GROUP5-Munch

The Munch app is a social platform where users create profiles by selecting preferred foods.
1 stars 11 forks source link

Like and Follow modified with User and Timestamp #100

Closed KeenParchment closed 5 months ago

KeenParchment commented 5 months ago

Co-authored-by: Fabrizio fabriziovaldivia2001@gmail.com

This is related to issue #87

Description / Changes Made

-In the database, likes and followers were changed to arrays containing maps containing a user (reference) and timestamp (string) field as per the new schema mentioned in #87 -Timestamp follows UTC format. Example: 2024-04-21 02:31:25.856024+00:00 represents the date and time of April 21, 2024, at 2 hours, 31 minutes, 25 seconds, and 856,024 microseconds, in Coordinated Universal Time (UTC). -Likes and followers were updated from string and numbers to the user reference and timestamp string

-Tests were overall changed/modified to represent the new schema accordingly -Test cases like fields modified with the new schema (array) -Test follows were updated with user and timestamp in their correct field

Portions of this code that utilized AI generation

Screenshots

Recipes now contain likes with user/timestamp image

Users now contain the user/timestamp of when they followed another user image

Users now contain the user/timestamp of when another user follows them image

Test Coverage is now 90% image

How to Test

  1. Run the Firestore emulator and the server.py
  2. Open Postman and use the proper routes for like and follow
  3. To like: Set the Method to PATCH with the route http://127.0.0.1:5000/api/users//like/ -This can be set for Posts or Recipes
  4. To unlike: Set the Method to PATCH with the route http://127.0.0.1:5000/api/users//unlike/ -This can be set for Posts or Recipes
  5. To follow: Set the Method to PATCH with the route http://127.0.0.1:5000/api/users//follow/ -Follow is on a toggle, so following the same user again will unfollow the user
  6. Run the run_tests.py to get the test coverage

Checklist

rparker2003 commented 5 months ago

Great work! This PR implements the changes outlined in issue #87 effectively. The database schema updates for likes and followers are well-handled, along with corresponding adjustments in tests. The addition of user/timestamp fields enhances data integrity and functionality. The instructions for testing are clear and comprehensive. Overall, this PR looks solid. 👍