src/sentry/billing/platform/README.md
Interface definitions for the new billing platform. See INTENTION.md for design principles.
Service-oriented architecture with:
__init__ arguments)platform/
├── INTENTION.md # Design principles (human-maintained)
├── core/ # BillingService base class and decorator
└── services/ # Individual service implementations
from sentry.billing.platform.core import BillingService, service_method
from sentry_protos.billing.v1.services.myservice import MyRequest, MyResponse
class MyService(BillingService):
@service_method
def my_method(self, request: MyRequest) -> MyResponse:
return MyResponse(...)
# Usage
response = MyService().my_method(MyRequest(...))
pytest -svv --reuse-db tests/sentry/billing/platform/
See tests/sentry/billing/platform/core/test_service.py for examples.
Service implementations will eventually move to external services. These interfaces will remain, delegating to RPC endpoints.