Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement new relationship model #144

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

owengretzinger
Copy link
Collaborator

@owengretzinger owengretzinger commented Dec 18, 2024

TL;DR

Refactored user relationship management to support multiple relationship statuses and tracking friendship dates.

IMPORTANT: relationships will now be stored differently in the DB

Now it's:

// collection of users
id: {
    createdAt: Date,
    displayName: string,
    username: string, 
    // subcollection of relationships
    relationships: [
        status: "pending" | "friends" | "blocked",
        friendsSince: Date | undefined,
    ],
}

So each user with have a subcollection of relationships.

What changed?

  • Replaced boolean isFriend flag with a comprehensive relationship system
  • Added new relationship types: 'pending', 'friends', 'blocked', and 'none'
  • Introduced mockRelationships to store relationship data between users
  • Updated user profile to display "Friends Since" date when applicable
  • Modified user queries to include relationship information in responses

How to test?

  1. View different user profiles to verify relationship status display
  2. Check that "Friends Since" date appears for users who are friends
  3. Verify friend management actions (add/remove) work with new relationship system
  4. Confirm friends list only shows users with 'friends' status

Why make this change?

To provide a more robust relationship management system that supports additional states beyond simple friend/not-friend, while also tracking important relationship metadata like when friendships began.

@owengretzinger owengretzinger changed the title improve how relationships are stored feat: replace friend status with relationship model Dec 18, 2024
@owengretzinger owengretzinger changed the title feat: replace friend status with relationship model feat: implement new relationship model Dec 18, 2024
@owengretzinger owengretzinger marked this pull request as ready for review December 18, 2024 03:00
Copy link

graphite-app bot commented Dec 18, 2024

Graphite Automations

"Request reviewers once CI passes" took an action on this PR • (12/18/24)

1 reviewer was added to this PR based on Owen Gretzinger's automation.

@AnkushSarkar10 AnkushSarkar10 merged commit 34e2223 into main Dec 24, 2024
2 checks passed
@AnkushSarkar10 AnkushSarkar10 deleted the 12-17-improve_how_relationships_are_stored branch December 24, 2024 03:35
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.

2 participants