# Contributing ## Development Setup ```bash git clone https://github.com/danangharissetiawan/django-subscription-midtrans.git cd django-subscription-midtrans python -m venv .venv source .venv/bin/activate pip install -r requirements.txt ``` ## Running Tests ```bash python manage.py test subscriptions.tests ``` Or with specific test modules: ```bash python manage.py test subscriptions.tests.test_models python manage.py test subscriptions.tests.test_services python manage.py test subscriptions.tests.test_views python manage.py test subscriptions.tests.test_client python manage.py test subscriptions.tests.test_middleware ``` ## Code Structure - `subscriptions/models.py` — All Django models - `subscriptions/services.py` — Business logic (SubscriptionService, WalletService) - `subscriptions/client.py` — Midtrans API client - `subscriptions/views.py` — DRF ViewSets and API views - `subscriptions/serializers.py` — DRF serializers - `subscriptions/signals.py` — Django signals - `subscriptions/tasks.py` — Celery tasks - `subscriptions/middleware.py` — Subscription access middleware - `subscriptions/admin.py` — Django Unfold admin - `subscriptions/tests/` — Test suite with factories ## Testing Conventions - Use `factories.py` for test data (Django model factories) - Mock Midtrans API calls in service tests - Test both success and failure paths - Test signal dispatch ## Pull Requests 1. Fork the repository 2. Create a feature branch (`git checkout -b feature/your-feature`) 3. Write tests for new functionality 4. Ensure all tests pass 5. Submit a pull request ## Reporting Issues Open an issue on GitHub with: - Python and Django version - Steps to reproduce - Expected vs actual behavior - Relevant logs or tracebacks