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: expose enterprise_customer and enterprise_features in BFF response #597

Merged
merged 14 commits into from
Nov 25, 2024

Conversation

adamstankiewicz
Copy link
Member

@adamstankiewicz adamstankiewicz commented Nov 22, 2024

Description:

  • Exposes enterprise_customer metadata in BFF response.
  • Exposes enterprise_features metadata in BFF response.

Example:

{
    "enterprise_customer": {
        "uuid": "7ad8cdb9-352c-4b71-bcf1-3015103cca1f",
        "slug": "test-enterprise",
        "name": "Test Enterprise",
        "active": true,
        "auth_org_id": null,
        "site": {
            "domain": "example.com",
            "name": "example.com"
        },
        "branding_configuration": {
            "logo": "http://localhost:18000/media/enterprise/branding/7ad8cdb9-352c-4b71-bcf1-3015103cca1f/logo_062e9a03-70eb-4704-b8d3-503461c18624.png",
            "primary_color": "#2D494E",
            "secondary_color": "#F2F0EF",
            "tertiary_color": "#D23228"
        },
        "identity_provider": null,
        "identity_providers": [],
        "enable_data_sharing_consent": true,
        "enforce_data_sharing_consent": "at_enrollment",
        "disable_expiry_messaging_for_learner_credit": false,
        "enable_audit_enrollment": false,
        "replace_sensitive_sso_username": false,
        "enable_portal_code_management_screen": true,
        "sync_learner_profile_data": false,
        "enable_audit_data_reporting": false,
        "enable_learner_portal": true,
        "enable_learner_portal_offers": false,
        "enable_portal_learner_credit_management_screen": false,
        "enable_executive_education_2U_fulfillment": false,
        "enable_portal_reporting_config_screen": true,
        "enable_portal_saml_configuration_screen": true,
        "contact_email": null,
        "enable_portal_subscription_management_screen": true,
        "hide_course_original_price": false,
        "enable_analytics_screen": true,
        "enable_integrated_customer_learner_portal_search": true,
        "enable_generation_of_api_credentials": false,
        "enable_portal_lms_configurations_screen": true,
        "sender_alias": null,
        "enterprise_customer_catalogs": [
            "f09ff39b-f456-4a03-b53b-44cd70f52108",
            "1bc4dd08-2995-4952-a942-ba57efb5c378"
        ],
        "reply_to": null,
        "enterprise_notification_banner": {
            "title": "",
            "text": ""
        },
        "hide_labor_market_data": false,
        "modified": "2024-10-22T19:17:41.700759Z",
        "enable_universal_link": false,
        "enable_browse_and_request": false,
        "admin_users": [
            {
                "email": "[email protected]",
                "lms_user_id": 15
            }
        ],
        "enable_learner_portal_sidebar_message": false,
        "learner_portal_sidebar_content": "",
        "enable_pathways": true,
        "enable_programs": true,
        "enable_demo_data_for_analytics_and_lpr": false,
        "enable_academies": false,
        "enable_one_academy": false,
        "active_integrations": [],
        "show_videos_in_learner_portal_search_results": false,
        "default_language": null,
        "country": "US",
        "enable_slug_login": false,
        "disable_search": false,
        "show_integration_warning": false
    },
    "enterprise_customer_user_subsidies": {
        "subscriptions": {
            "customer_agreement": {
                "uuid": "9571c2d9-d562-49e2-8f2e-2eaa92f07a84",
                "available_subscription_catalogs": [
                    "f09ff39b-f456-4a03-b53b-44cd70f52108"
                ],
                "default_enterprise_catalog_uuid": null,
                "net_days_until_expiration": 316,
                "disable_expiration_notifications": false,
                "enable_auto_applied_subscriptions_with_universal_link": true,
                "subscription_for_auto_applied_licenses": "7dce00ba-2de1-48b3-8aed-b514d7e1dbab",
                "has_custom_license_expiration_messaging_v2": true,
                "button_label_in_modal_v2": "Continue learning",
                "expired_subscription_modal_messaging_v2": "Testibg",
                "modal_header_text_v2": "HELLO WORLD"
            },
            "subscription_licenses": [
                {
                    "uuid": "095392a2-5748-45ad-aa2a-7d6bcd75ba67",
                    "status": "activated",
                    "user_email": "[email protected]",
                    "activation_date": "2024-11-20T20:53:32.889205Z",
                    "last_remind_date": "2024-11-20T20:53:32.889205Z",
                    "revoked_date": null,
                    "activation_key": "26bc3e9e-6048-43a5-8aba-358fbf8e0b5d",
                    "subscription_plan": {
                        "uuid": "7dce00ba-2de1-48b3-8aed-b514d7e1dbab",
                        "title": "Seed Generated Plan from <CustomerAgreement: 'test-enterprise'> 2024-10-05 16:08:01.428564+00:00",
                        "enterprise_catalog_uuid": "f09ff39b-f456-4a03-b53b-44cd70f52108",
                        "is_active": true,
                        "is_current": true,
                        "start_date": "2024-10-05T16:08:01Z",
                        "expiration_date": "2025-10-05T16:08:01Z",
                        "days_until_expiration": 316,
                        "days_until_expiration_including_renewals": 316,
                        "should_auto_apply_licenses": true
                    }
                }
            ],
            "subscription_licenses_by_status": {
                "activated": [
                    {
                        "uuid": "095392a2-5748-45ad-aa2a-7d6bcd75ba67",
                        "status": "activated",
                        "user_email": "[email protected]",
                        "activation_date": "2024-11-20T20:53:32.889205Z",
                        "last_remind_date": "2024-11-20T20:53:32.889205Z",
                        "revoked_date": null,
                        "activation_key": "26bc3e9e-6048-43a5-8aba-358fbf8e0b5d",
                        "subscription_plan": {
                            "uuid": "7dce00ba-2de1-48b3-8aed-b514d7e1dbab",
                            "title": "Seed Generated Plan from <CustomerAgreement: 'test-enterprise'> 2024-10-05 16:08:01.428564+00:00",
                            "enterprise_catalog_uuid": "f09ff39b-f456-4a03-b53b-44cd70f52108",
                            "is_active": true,
                            "is_current": true,
                            "start_date": "2024-10-05T16:08:01Z",
                            "expiration_date": "2025-10-05T16:08:01Z",
                            "days_until_expiration": 316,
                            "days_until_expiration_including_renewals": 316,
                            "should_auto_apply_licenses": true
                        }
                    }
                ],
                "assigned": [],
                "expired": [],
                "revoked": []
            }
        }
    },
    "enterprise_course_enrollments": [],
    "errors": [],
    "warnings": [],
    "enterprise_features": {
        "top_down_assignment_real_time_lcm": false,
        "feature_prequery_search_suggestions": false,
        "enterprise_groups_v1": false,
        "enterprise_customer_support_tool": false,
        "enterprise_groups_v2": false
    }
}

Merge checklist:

  • ./manage.py makemigrations has been run
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.

Post merge:

  • Ensure that your changes went out to the stage instance
  • Deploy to prod instance

@adamstankiewicz adamstankiewicz marked this pull request as ready for review November 22, 2024 18:33
Base automatically changed from ags/bff-viewset-tests to main November 22, 2024 20:17
@adamstankiewicz
Copy link
Member Author

Closing and re-opening to see if the openedx/cla check gets unstuck.

@adamstankiewicz adamstankiewicz merged commit 98ed6ec into main Nov 25, 2024
3 checks passed
@adamstankiewicz adamstankiewicz deleted the ags/bff-viewset-expose-enterprise-customer branch November 25, 2024 14:26
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.

2 participants