feat: add GDPR consent status policies and validations #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request adds GDPR consent tracking to the learner model, allowing course enrollments to validate whether the current user has accepted the corresponding consent before enrolling in catalog courses.
When GDPR consent is declined, the user is unenrolled (deactivated) from the current catalog as intended in the use case.
Key changes
CatalogLearnermodel:gdpr_consent_status– stores the current consent state for the learner.gdpr_consent_updated_at– stores the timestamp of the last consent change.Including the corresponding migrations and admin updates.
.../gdpr_consentURL.gdpr_consent_status, and trigger the corresponding deactivation of the learner’s catalog enrollment when consent is declined.How to test
CatalogLearner)..../gdpr_consentfor that catalog/learner:gdpr_consent_statusis set to the expected “accepted” value.gdpr_consent_updated_atis updated.