ParticipantsRepository module

class repositories.participants_repository.ParticipantsRepository(db_name: str = 'concord.db')

Bases: repositories.repository_interface.RepositoryInterface

A class that manipulates the participants table

delete_by_room_id(room_id: str)bool

Deletes all Participants containing the room_id

Parameters

room_id – the participant’s room_id

Returns

A boolean representing whether the operation was successful or not

delete_by_user_id(user_id: str)bool

Deletes all Participants containing the user_id

Parameters

user_id – the participant’s user_id

Returns

A boolean representing whether the operation was successful or not

find_all_by_room_id(room_id: str)Tuple[List[dtos.dto_participants.Participants], bool]

Finds all Participants containing the room_id

Parameters

room_id – the participant’s room id

Returns

A tuple containing containing the list of participants and whether the operation was successful or not

find_all_by_user_id(user_id: str)Tuple[List[dtos.dto_participants.Participants], bool]

Finds all Participants containing the user_id

Parameters

user_id – the participant’s user id

Returns

A tuple containing containing the list of participants and whether the operation was successful or not

find_one_by_room_id(room_id: str)Tuple[dtos.dto_participants.Participants, bool]

Finds one Participants containing the room_id

Parameters

room_id – the participant’s room_id

Returns

A tuple containing containing one participant and whether the operation was successful or not

find_one_by_user_id(user_id: str)Tuple[dtos.dto_participants.Participants, bool]

Finds one Participants containing the user_id

Parameters

user_id – the participant’s user_id

Returns

A tuple containing containing one participant and whether the operation was successful or not

find_one_by_user_id_and_room_id(user_id: str, room_id: str)Tuple[dtos.dto_participants.Participants, bool]

Finds one Participants containing both the given user_id and room_id

Parameters
  • user_id – the participant’s user_id

  • room_id – the participant’s room_id

Returns

A tuple containing containing one participant and whether the operation was successful or not

put(participant: dtos.dto_participants.Participants)bool

Deletes all Participants containing the user_id

Parameters

participant – A participant to be stored in the database

Returns

A boolean representing whether the operation was successful or not

update_by_room_id(room_id: str, new_data: dtos.dto_participants.Participants)bool

Finds one Participants containing the room_id

Parameters
  • room_id – the participant’s room_id

  • new_data – the participant’s new data

Returns

A tuple containing containing one participant and whether the operation was successful or not

update_by_user_id(user_id: str, new_data: dtos.dto_participants.Participants)bool

Finds one Participants containing the user_id

Parameters
  • user_id – the participant’s user_id

  • new_data – the participant’s new data

Returns

A tuple containing containing one participant and whether the operation was successful or not