refactor: move stripe webhook handler to app/handlers/
- Create app/handlers/ directory for event handlers - Move stripe_webhook_handler.py to app/handlers/stripe_webhook.py - Update imports in webhooks.py, tests, and docs - Handlers are distinct from services (event-driven vs request-driven) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@ from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from app.services.stripe_webhook_handler import StripeWebhookHandler
|
||||
from app.handlers.stripe_webhook import StripeWebhookHandler
|
||||
from models.database.subscription import (
|
||||
BillingHistory,
|
||||
StripeWebhookEvent,
|
||||
@@ -59,7 +59,7 @@ class TestStripeWebhookHandlerCheckout:
|
||||
"""Initialize handler instance before each test."""
|
||||
self.handler = StripeWebhookHandler()
|
||||
|
||||
@patch("app.services.stripe_webhook_handler.stripe.Subscription.retrieve")
|
||||
@patch("app.handlers.stripe_webhook.stripe.Subscription.retrieve")
|
||||
def test_handle_checkout_completed_success(
|
||||
self, mock_stripe_retrieve, db, test_vendor, test_subscription, mock_checkout_event
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user