This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This project uses Docker for local development. Key commands:
make dev.up.build-no-cache: Initial setup - builds containers from scratch and starts servicesmake dev.up.build: Regular development startup with buildmake dev.up: Start existing containersmake app-shell: Enter the application container shell./provision-enterprise-subsidy.sh: Initial provisioning script (run after first build)
- Main application: http://localhost:18280/admin/
- MySQL 8.0 database (container: enterprise-subsidy.mysql80)
- Memcache for caching
- Event consumer service for learner credit course enrollment lifecycle events
For working with openedx-events and Kafka:
make dev.up.with-events: Start with local Kafka (includes Confluent Control Center at http://localhost:9021/clusters)- Event consumption:
./manage.py consume_enterprise_ping_events - Event production:
./manage.py produce_enterprise_ping_event
make requirements: Install/update dev requirementsmake dev_requirements: Sync to dev requirementsmake validation_requirements: Sync to requirements for testing & code quality
make test: Run tests with coverage (uses pytest)make validate: Run all tests, quality checks, PII checks, and keyword checkspytest ./path/to/new/tests: Run specific testsmake quality: Run tox quality checksmake lint/make pylint: Python linting with pylintmake style: Python style checking with pycodestylemake isort: Sort imports,make isort_check: Check import sortingmake pii_check: Check for PII annotations on Django modelsmake check_keywords: Scan for restricted field names in Django models
make migrate/make dev.migrate: Apply database migrationsmake db-shell-8: MySQL 8 shell accessmake dev.backup/make dev.restore: Database backup/restore
make static/make dev.static: Collect static files
- subsidy: Core subsidy models and business logic, including Subsidy model with ledger integration
- transaction: Transaction management, including ledger transactions and reversals
- content_metadata: Content metadata API integration and caching
- fulfillment: Handles fulfillment of subsidies, including GEAG (Get Enrolled & Get Assigned) fulfillment
- api_client: Client integrations with Enterprise API, Enterprise Catalog, and LMS User API
- core: Shared utilities, context processors, and base functionality
- Subsidies: Store value (learner credit in USD or subscription seats) that can be redeemed for content
- Ledger: Tracks transactions (value movement in/out of subsidies) using openedx-ledger package
- Redemption: The act of redeeming stored value for content
- Revenue Categories: Control revenue recognition (bulk-enrollment-prepay, partner-no-rev-prepay)
- Reference Types: Links subsidies to originating objects (e.g., Salesforce OpportunityLineItem)
- Enterprise Catalog Service: Content metadata and pricing (http://localhost:18160)
- LMS: User data and enrollment operations
- Event Bus: openedx-events integration for cross-service communication
- Course Discovery: Source of truth for content pricing and metadata
- Subsidies use django-simple-history for change tracking
- Soft deletion pattern with
is_soft_deletedfield - Integration with edx-rbac for role-based access control
- Uses openedx-ledger for transaction tracking and balance management
- RESTful API with DRF (Django REST Framework)
- API versioning (v1, v2 endpoints)
- Integration with content metadata for price validation
- Redeemability queries return boolean + current content price
- Base settings in
enterprise_subsidy/settings/base.py - Environment-specific configs:
devstack.py,local.py,production.py,test.py - Uses environment variables for service URLs and configuration