feat(promo): Enhance promo code functionality and discount consumption logic
- Integrated promo code service into subscription service to streamline discount consumption during payment processing. - Improved error handling and logging for promo code activation and usage increment. - Updated payment services to handle discount calculations more robustly, including fallback mechanisms for invalid discount scenarios. - Added new methods for managing promo code activations and usage in the database layer.
This commit is contained in:
@@ -81,6 +81,8 @@ def build_core_services(
|
||||
|
||||
# Wire services that depend on each other
|
||||
try:
|
||||
# Allow subscription service to consume promo codes
|
||||
setattr(subscription_service, "promo_code_service", promo_code_service)
|
||||
# Attach YooKassa to subscription service for auto-renew charges
|
||||
setattr(subscription_service, "yookassa_service", yookassa_service)
|
||||
# Allow panel webhook to trigger renewals through subscription service
|
||||
|
||||
Reference in New Issue
Block a user