feat: credit-based billing system
- New DB models: credit_packages, subscription_plans, user_credits, credit_consumptions, credit_purchases - CreditService: balance, deduct, add_credits, grant_free_trial, history - User API: /api/v1/credits/* (balance/history/packages/purchase/subscribe) - Admin API: /api/v1/admin/credit-* (CRUD packages/plans, user credits, consumptions) - PaymentService.create_credit_order + handle_callback for credit purchases - Credit deduction on: discovery, translate, marketing, ai_chat, followup - Free trial 30 credits on registration - Documentation: docs/CREDIT_SYSTEM.md
This commit is contained in:
@@ -19,6 +19,10 @@ from .search_provider import SearchProvider
|
||||
from .discovery_record import DiscoveryRecord
|
||||
from .ai_provider import AIProvider
|
||||
from .payment_transaction import PaymentTransaction
|
||||
from .credit_package import CreditPackage, SubscriptionPlan
|
||||
from .user_credit import UserCredit
|
||||
from .credit_consumption import CreditConsumption
|
||||
from .credit_purchase import CreditPurchase
|
||||
|
||||
__all__ = [
|
||||
"User", "Product",
|
||||
@@ -37,4 +41,8 @@ __all__ = [
|
||||
"DiscoveryRecord",
|
||||
"AIProvider",
|
||||
"PaymentTransaction",
|
||||
"CreditPackage", "SubscriptionPlan",
|
||||
"UserCredit",
|
||||
"CreditConsumption",
|
||||
"CreditPurchase",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user