Skip to content

Conversation

@jbpenrath
Copy link
Collaborator

Purpose

From Richie we recently add new fields to CourseRun models to set offer available on the CourseRun. As in Joanie we are able to set the course run offer according to product linked to the related course, we update the course synchronization to add this information.

@jbpenrath jbpenrath marked this pull request as draft April 2, 2025 10:54
@jbpenrath jbpenrath self-assigned this Apr 2, 2025
@jbpenrath jbpenrath force-pushed the feat/synchronize-course-offers branch from d8ef298 to 3bf964d Compare April 3, 2025 10:26
@jbpenrath jbpenrath marked this pull request as ready for review April 3, 2025 10:28
@jbpenrath jbpenrath force-pushed the feat/synchronize-course-offers branch 3 times, most recently from c199330 to babf6b7 Compare April 3, 2025 15:33
@jbpenrath jbpenrath requested a review from Copilot April 3, 2025 17:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates course offer information into the course webhook payload and updates the synchronization logic for certificate products. It also adds new tests to validate the offer logic for different product types and updates JSON serialization and signal handling accordingly.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/backend/joanie/tests/core/test_signals.py Updated tests for certificate and credential product synchronization.
src/backend/joanie/tests/core/test_models_product.py Added tests for offer processing in course run data and serialization.
src/backend/joanie/tests/core/test_models_course_run.py Extended course run tests to validate certificate offer behavior.
src/backend/joanie/core/utils/webhooks.py Modified JSON serialization and added explicit Content-Type header.
src/backend/joanie/core/signals.py Enhanced signal handlers to support certificate-specific course run sync.
src/backend/joanie/core/models/products.py Introduced get_equivalent_course_run_offer and get_serialized_certificated_course_runs.
src/backend/joanie/core/models/courses.py Updated course serialization to include certificate offer and added get_certificate_offer.
src/backend/joanie/core/enums.py Added new constants for course offers.
src/backend/joanie/core/apps.py Registered new signal handler for product save.
CHANGELOG.md Documented the inclusion of course offer information in webhook payload.

@kernicPanel kernicPanel assigned kernicPanel and unassigned jbpenrath Apr 8, 2025
From Richie we recently add new fields to CourseRun models to set offer
available on the CourseRun. As in Joanie we are able to set the course run offer
according to product linked to the related course, we update the course
synchronization to add this information.
@kernicPanel kernicPanel force-pushed the feat/synchronize-course-offers branch from babf6b7 to ddb2bf5 Compare April 8, 2025 12:16
@kernicPanel kernicPanel enabled auto-merge (rebase) April 8, 2025 12:17
@kernicPanel kernicPanel merged commit 6e145bb into main Apr 8, 2025
17 checks passed
@kernicPanel kernicPanel deleted the feat/synchronize-course-offers branch April 8, 2025 12:51
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.

4 participants