phoenixlan / phoenixapi-v1

Python-based api server for a self-hosted event hosting system
GNU General Public License v3.0
2 stars 0 forks source link

Friends system #20

Closed petterroea closed 11 months ago

petterroea commented 1 year ago

We want a system that allows people to add each other as friends. This would allow people to see where friends are seated in the seatmap. In addition, it would also give us information that allows us to move people around without splitting up friend groups.

Design concept

The idea is a system where we use a single table to track the lifetime of friendships. A friendship is created when an user sends a friend request. Accepting the friend request sets an "accepted" column to a non-null value, meaning that the request is accepted. If the "deleted" column is set, the friend request should be invisible to users if they aren't using the views/friend_request/instance GET request

Requirements

Database models

Friendship

Represents a friend request, and when accepted, the actual friendship.

Fields:

Remember to create a sqlalchemy migration!

API

User

Tests