Ejemplo n.º 1
0
def set_vote(event, _):
    session_id = event['sessionID']
    participant_id = event['participantID']
    vote = models.Vote(points=event['vote']['points'], abstained=event['vote']['abstained'])

    return session_service.SessionService(session_repo.SessionsDynamoDBRepo()).set_vote(session_id, participant_id,
                                                                                        vote).to_json()
Ejemplo n.º 2
0
def join_session(event, _):
    session_id = event['sessionID']
    payload = event['participant']

    participant_description = models.ParticipantDescription(
        id=payload['id'],
        name=payload['name']
    )

    return session_service.SessionService(session_repo.SessionsDynamoDBRepo()).join_session(
        session_id, participant_description).to_json()
Ejemplo n.º 3
0
def set_reviewing_issue(event, _):
    session_id = event['sessionID']
    description = event['issue']

    issue = models.ReviewingIssueDescription(
        title=description['title'],
        description=description['description'],
        url=description['url']
    )

    return session_service.SessionService(session_repo.SessionsDynamoDBRepo()).set_reviewing_issue(session_id,
                                                                                                   issue).to_json()
Ejemplo n.º 4
0
def create_session(event, _):
    payload = event['sessionDescription']

    session_description = models.SessionDescription(
        name=payload['name'],
        pointingMax=payload['pointingMax'],
        pointingMin=payload['pointingMin'],
    )

    moderator_description = models.ParticipantDescription(
        id=event['moderator']['id'],
        name=event['moderator']['name']
    )

    return session_service.SessionService(session_repo.SessionsDynamoDBRepo()).create_session(
        session_description, moderator_description).to_json()
Ejemplo n.º 5
0
def participant(event, _):
    user_id = event['id']

    return session_service.SessionService(session_repo.SessionsDynamoDBRepo()).participant(user_id).to_json()
Ejemplo n.º 6
0
def stop_voting(event, _):
    session_id = event['sessionID']

    return session_service.SessionService(session_repo.SessionsDynamoDBRepo()).stop_voting(session_id).to_json()
Ejemplo n.º 7
0
def close_session(event, _):
    session_id = event['sessionID']

    return session_service.SessionService(session_repo.SessionsDynamoDBRepo()).close_session(session_id).to_json()
Ejemplo n.º 8
0
def leave_session(event, _):
    session_id = event['sessionID']
    participant_id = event['participantID']

    return session_service.SessionService(session_repo.SessionsDynamoDBRepo()).leave_session(session_id,
                                                                                             participant_id).to_json()