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: add community question and answer models, schemas, and routes #1183

Open
wants to merge 20 commits into
base: dev
Choose a base branch
from

Conversation

Black-fox17
Copy link

@Black-fox17 Black-fox17 commented Mar 1, 2025

Community Feature - User Q&A System

Description

This feature introduces a Community Q&A System, allowing users to ask and answer questions within the platform. It enhances user engagement by enabling knowledge-sharing and structured discussions, similar to platforms like the Microsoft Community Center.

Features

  • Users can post questions related to the platform or relevant topics.
  • Other users can provide answers to those questions.
  • The question author can mark an answer as accepted.
  • Users can mark their questions as resolved.
  • Self-answered questions are supported.

Service Implementation

CommunityQuestionService

  • create_question: Users can create new questions.
  • fetch_all: Retrieve all questions, with optional filters.
  • fetch_by_id: Fetch a specific question by ID.
  • mark_as_resolved: Mark a question as resolved/unresolved.
  • delete_question: Remove a question from the database.

CommunityAnswerService

  • create_answer: Users can provide answers to questions.
  • mark_as_accepted: The question author can accept an answer.

Motivation and Context

Currently, the platform lacks a dedicated Q&A system. This feature addresses that gap by:

  • Promoting discussions and problem-solving.
  • Encouraging community-driven support.
  • Making it easier for users to seek help and share insights.

Testing

  • Automated Tests: Implemented using FastAPI TestClient to verify API endpoints.
  • Manual Testing: Ensured correct functionality for question and answer creation, retrieval, updates, and deletion.
  • Database Validation: Verified smooth interactions using SQLAlchemy ORM.
  • Security Checks: Ensured authentication and authorization mechanisms are in place.

Types of Changes

  • New Feature (non-breaking change that adds functionality)
  • Bug Fix (non-breaking change that fixes an issue)
  • Breaking Change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the project's coding style.
  • My change requires a documentation update.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Additional Context

The implementation leverages FastAPI and SQLAlchemy for efficient database operations, ensuring performance and security. This feature significantly enhances user engagement by providing an interactive space for discussions.

@Black-fox17 Black-fox17 changed the title Add community question and answer models, schemas, and routes [FEAT]: Add community question and answer models, schemas, and routes Mar 1, 2025
@Black-fox17 Black-fox17 changed the title [FEAT]: Add community question and answer models, schemas, and routes feat: add community question and answer models, schemas, and routes Mar 1, 2025
@samuelogboye
Copy link
Contributor

Commit messages are not compliant

samuelogboye
samuelogboye previously approved these changes Mar 1, 2025
Copy link
Contributor

@samuelogboye samuelogboye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
The code is well-written and follows best practices

Copy link
Contributor

@joboy-dev joboy-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests????

@Black-fox17
Copy link
Author

No tests????

@joboy-dev
I have added tests sir.

@Black-fox17
Copy link
Author

@joboy-dev

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.

3 participants