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

Implement Feedback Core Serializers #4478

Closed
ozer550 opened this issue Mar 20, 2024 · 0 comments · Fixed by #4537
Closed

Implement Feedback Core Serializers #4478

ozer550 opened this issue Mar 20, 2024 · 0 comments · Fixed by #4537
Assignees
Labels
DEV: backend P1 - important Priority: High impact on UX python Pull requests that update Python code

Comments

@ozer550
Copy link
Member

ozer550 commented Mar 20, 2024

Overview

This issue focuses on the implementation of serializer classes that will handle the serialization of feedback-related objects. The serializers are designed hierarchically to leverage inheritance, promoting code reuse and maintaining a logical structure. The four distinct serializers to be implemented are BaseFeedbackSerializer, BaseFeedbackEventSerializer, BaseFeedbackInteractionEventSerializer, and FlagFeedbackEventSerializer.

Depends on #4477

Description and outcomes

  • Create a file called feedback.py in contentcuration/contentcuration/viewsets/ directory this will contain all the serializer and viewset classes.

BaseFeedbackSerializer:

  • Implement a serializer class named BaseFeedbackSerializer.
  • Include fields for id (UUID), context (JSON), created_at (DateTime), contentnode_id (UUID), and content_id (UUID).

BaseFeedbackEventSerializer Class:

  • Implement a serializer class named BaseFeedbackEventSerializer.
  • Include fields for user and target_channel_id (UUID).
  • Inherit from BaseFeedbackSerializer to reuse serialization logic.

BaseFeedbackInteractionEventSerializer Class:

  • Implement a serializer class named BaseFeedbackInteractionEventSerializer.
  • Include fields for feedback_type (String) and feedback_reason (String).
  • Inherit from BaseFeedbackSerializer to maintain a consistent approach to serialization.

Unit tests:

  • Write tests to validate working of implemented serializers.

Acceptance criteria

  • The serializers should correctly serialize the specified fields.
  • Ensure the serialized data matches the expected structure for each feedback object.
  • Utilize inheritance to maintain a cohesive approach to serialization across different feedback objects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: backend P1 - important Priority: High impact on UX python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant