fix(lint): auto-fix ruff violations and tune lint rules
- Auto-fixed 4,496 lint issues (import sorting, modern syntax, etc.) - Added ignore rules for patterns intentional in this codebase: E402 (late imports), E712 (SQLAlchemy filters), B904 (raise from), SIM108/SIM105/SIM117 (readability preferences) - Added per-file ignores for tests and scripts - Excluded broken scripts/rename_terminology.py (has curly quotes) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,7 @@ def __getattr__(name: str):
|
||||
from app.modules.loyalty.definition import loyalty_module
|
||||
|
||||
return loyalty_module
|
||||
elif name == "get_loyalty_module_with_routers":
|
||||
if name == "get_loyalty_module_with_routers":
|
||||
from app.modules.loyalty.definition import get_loyalty_module_with_routers
|
||||
|
||||
return get_loyalty_module_with_routers
|
||||
|
||||
@@ -6,7 +6,13 @@ Defines the loyalty module including its features, menu items,
|
||||
route configurations, and scheduled tasks.
|
||||
"""
|
||||
|
||||
from app.modules.base import MenuItemDefinition, MenuSectionDefinition, ModuleDefinition, PermissionDefinition, ScheduledTask
|
||||
from app.modules.base import (
|
||||
MenuItemDefinition,
|
||||
MenuSectionDefinition,
|
||||
ModuleDefinition,
|
||||
PermissionDefinition,
|
||||
ScheduledTask,
|
||||
)
|
||||
from app.modules.enums import FrontendType
|
||||
|
||||
|
||||
|
||||
@@ -4,9 +4,10 @@ Revision ID: loyalty_001
|
||||
Revises: messaging_001
|
||||
Create Date: 2026-02-07
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision = "loyalty_001"
|
||||
down_revision = "messaging_001"
|
||||
branch_labels = None
|
||||
|
||||
@@ -4,9 +4,10 @@ Revision ID: loyalty_002
|
||||
Revises: loyalty_001
|
||||
Create Date: 2026-02-08
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision = "loyalty_002"
|
||||
down_revision = "loyalty_001"
|
||||
branch_labels = None
|
||||
|
||||
@@ -19,36 +19,36 @@ Usage:
|
||||
)
|
||||
"""
|
||||
|
||||
from app.modules.loyalty.models.loyalty_program import (
|
||||
# Enums
|
||||
LoyaltyType,
|
||||
from app.modules.loyalty.models.apple_device import (
|
||||
# Model
|
||||
LoyaltyProgram,
|
||||
AppleDeviceRegistration,
|
||||
)
|
||||
from app.modules.loyalty.models.loyalty_card import (
|
||||
# Model
|
||||
LoyaltyCard,
|
||||
)
|
||||
from app.modules.loyalty.models.loyalty_transaction import (
|
||||
from app.modules.loyalty.models.loyalty_program import (
|
||||
# Model
|
||||
LoyaltyProgram,
|
||||
# Enums
|
||||
TransactionType,
|
||||
LoyaltyType,
|
||||
)
|
||||
from app.modules.loyalty.models.loyalty_transaction import (
|
||||
# Model
|
||||
LoyaltyTransaction,
|
||||
# Enums
|
||||
TransactionType,
|
||||
)
|
||||
from app.modules.loyalty.models.merchant_settings import (
|
||||
# Model
|
||||
MerchantLoyaltySettings,
|
||||
# Enums
|
||||
StaffPinPolicy,
|
||||
)
|
||||
from app.modules.loyalty.models.staff_pin import (
|
||||
# Model
|
||||
StaffPin,
|
||||
)
|
||||
from app.modules.loyalty.models.apple_device import (
|
||||
# Model
|
||||
AppleDeviceRegistration,
|
||||
)
|
||||
from app.modules.loyalty.models.merchant_settings import (
|
||||
# Enums
|
||||
StaffPinPolicy,
|
||||
# Model
|
||||
MerchantLoyaltySettings,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# Enums
|
||||
|
||||
@@ -10,8 +10,8 @@ Provides REST API endpoints for:
|
||||
"""
|
||||
|
||||
from app.modules.loyalty.routes.api.admin import admin_router
|
||||
from app.modules.loyalty.routes.api.store import store_router
|
||||
from app.modules.loyalty.routes.api.platform import platform_router
|
||||
from app.modules.loyalty.routes.api.store import store_router
|
||||
from app.modules.loyalty.routes.api.storefront import storefront_router
|
||||
|
||||
__all__ = ["admin_router", "store_router", "platform_router", "storefront_router"]
|
||||
|
||||
@@ -17,12 +17,12 @@ from app.api.deps import get_current_admin_api, require_module_access
|
||||
from app.core.database import get_db
|
||||
from app.modules.enums import FrontendType
|
||||
from app.modules.loyalty.schemas import (
|
||||
MerchantSettingsResponse,
|
||||
MerchantSettingsUpdate,
|
||||
MerchantStatsResponse,
|
||||
ProgramListResponse,
|
||||
ProgramResponse,
|
||||
ProgramStatsResponse,
|
||||
MerchantStatsResponse,
|
||||
MerchantSettingsResponse,
|
||||
MerchantSettingsUpdate,
|
||||
)
|
||||
from app.modules.loyalty.services import program_service
|
||||
from app.modules.tenancy.models import User
|
||||
@@ -182,7 +182,6 @@ def update_merchant_settings(
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""Update merchant loyalty settings (admin only)."""
|
||||
from app.modules.loyalty.models import MerchantLoyaltySettings
|
||||
|
||||
settings = program_service.get_or_create_merchant_settings(db, merchant_id)
|
||||
|
||||
@@ -211,7 +210,11 @@ def get_platform_stats(
|
||||
"""Get platform-wide loyalty statistics."""
|
||||
from sqlalchemy import func
|
||||
|
||||
from app.modules.loyalty.models import LoyaltyCard, LoyaltyProgram, LoyaltyTransaction
|
||||
from app.modules.loyalty.models import (
|
||||
LoyaltyCard,
|
||||
LoyaltyProgram,
|
||||
LoyaltyTransaction,
|
||||
)
|
||||
|
||||
# Program counts
|
||||
total_programs = db.query(func.count(LoyaltyProgram.id)).scalar() or 0
|
||||
|
||||
@@ -9,21 +9,18 @@ Platform endpoints for:
|
||||
"""
|
||||
|
||||
import logging
|
||||
from datetime import UTC, datetime
|
||||
from datetime import datetime
|
||||
|
||||
from fastapi import APIRouter, Depends, Header, HTTPException, Path, Response
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.core.database import get_db
|
||||
from app.modules.loyalty.exceptions import (
|
||||
LoyaltyCardNotFoundException,
|
||||
LoyaltyException,
|
||||
LoyaltyProgramNotFoundException,
|
||||
)
|
||||
from app.modules.loyalty.models import LoyaltyCard, LoyaltyProgram
|
||||
from app.modules.loyalty.models import LoyaltyCard
|
||||
from app.modules.loyalty.services import (
|
||||
apple_wallet_service,
|
||||
card_service,
|
||||
program_service,
|
||||
)
|
||||
|
||||
|
||||
@@ -20,34 +20,33 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from app.api.deps import get_current_store_api, require_module_access
|
||||
from app.core.database import get_db
|
||||
from app.modules.enums import FrontendType
|
||||
from app.modules.loyalty.exceptions import (
|
||||
LoyaltyCardNotFoundException,
|
||||
LoyaltyException,
|
||||
LoyaltyProgramNotFoundException,
|
||||
)
|
||||
from app.modules.loyalty.schemas import (
|
||||
CardDetailResponse,
|
||||
CardEnrollRequest,
|
||||
CardListResponse,
|
||||
CardLookupResponse,
|
||||
CardResponse,
|
||||
MerchantStatsResponse,
|
||||
PinCreate,
|
||||
PinListResponse,
|
||||
PinResponse,
|
||||
PinUpdate,
|
||||
PointsAdjustRequest,
|
||||
PointsAdjustResponse,
|
||||
PointsEarnRequest,
|
||||
PointsEarnResponse,
|
||||
PointsRedeemRequest,
|
||||
PointsRedeemResponse,
|
||||
PointsVoidRequest,
|
||||
PointsVoidResponse,
|
||||
PointsAdjustRequest,
|
||||
PointsAdjustResponse,
|
||||
ProgramCreate,
|
||||
ProgramResponse,
|
||||
ProgramStatsResponse,
|
||||
ProgramUpdate,
|
||||
MerchantStatsResponse,
|
||||
StampRedeemRequest,
|
||||
StampRedeemResponse,
|
||||
StampRequest,
|
||||
@@ -63,10 +62,8 @@ from app.modules.loyalty.services import (
|
||||
points_service,
|
||||
program_service,
|
||||
stamp_service,
|
||||
wallet_service,
|
||||
)
|
||||
from app.modules.enums import FrontendType
|
||||
from app.modules.tenancy.models import User, Store
|
||||
from app.modules.tenancy.models import Store, User
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -466,7 +463,7 @@ def get_card_transactions(
|
||||
|
||||
# Verify card belongs to this merchant
|
||||
try:
|
||||
card = card_service.lookup_card_for_store(db, store_id, card_id=card_id)
|
||||
card_service.lookup_card_for_store(db, store_id, card_id=card_id)
|
||||
except LoyaltyCardNotFoundException:
|
||||
raise HTTPException(status_code=404, detail="Card not found")
|
||||
|
||||
|
||||
@@ -19,14 +19,12 @@ from sqlalchemy.orm import Session
|
||||
from app.api.deps import get_current_customer_api
|
||||
from app.core.database import get_db
|
||||
from app.modules.customers.schemas import CustomerContext
|
||||
from app.modules.loyalty.services import card_service, program_service
|
||||
from app.modules.loyalty.schemas import (
|
||||
CardResponse,
|
||||
CardEnrollRequest,
|
||||
TransactionListResponse,
|
||||
TransactionResponse,
|
||||
CardResponse,
|
||||
ProgramResponse,
|
||||
)
|
||||
from app.modules.loyalty.services import card_service, program_service
|
||||
from app.modules.tenancy.exceptions import StoreNotFoundException
|
||||
|
||||
storefront_router = APIRouter()
|
||||
@@ -212,7 +210,7 @@ def get_my_transactions(
|
||||
for tx in transactions:
|
||||
tx_data = {
|
||||
"id": tx.id,
|
||||
"transaction_type": tx.transaction_type.value if hasattr(tx.transaction_type, 'value') else str(tx.transaction_type),
|
||||
"transaction_type": tx.transaction_type.value if hasattr(tx.transaction_type, "value") else str(tx.transaction_type),
|
||||
"points_delta": tx.points_delta,
|
||||
"stamps_delta": tx.stamps_delta,
|
||||
"points_balance_after": tx.points_balance_after,
|
||||
|
||||
@@ -13,9 +13,9 @@ from fastapi.responses import HTMLResponse
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.api.deps import get_db, require_menu_access
|
||||
from app.templates_config import templates
|
||||
from app.modules.enums import FrontendType
|
||||
from app.modules.tenancy.models import User
|
||||
from app.templates_config import templates
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@@ -16,9 +16,11 @@ from fastapi.responses import HTMLResponse
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.api.deps import get_current_store_from_cookie_or_header, get_db
|
||||
from app.modules.core.services.platform_settings_service import platform_settings_service
|
||||
from app.modules.core.services.platform_settings_service import (
|
||||
platform_settings_service,
|
||||
)
|
||||
from app.modules.tenancy.models import Store, User
|
||||
from app.templates_config import templates
|
||||
from app.modules.tenancy.models import User, Store
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -25,46 +25,29 @@ Usage:
|
||||
)
|
||||
"""
|
||||
|
||||
from app.modules.loyalty.schemas.program import (
|
||||
# Program CRUD
|
||||
ProgramCreate,
|
||||
ProgramUpdate,
|
||||
ProgramResponse,
|
||||
ProgramListResponse,
|
||||
# Points rewards
|
||||
PointsRewardConfig,
|
||||
TierConfig,
|
||||
# Stats
|
||||
ProgramStatsResponse,
|
||||
MerchantStatsResponse,
|
||||
# Merchant settings
|
||||
MerchantSettingsResponse,
|
||||
MerchantSettingsUpdate,
|
||||
)
|
||||
|
||||
from app.modules.loyalty.schemas.card import (
|
||||
CardDetailResponse,
|
||||
# Card operations
|
||||
CardEnrollRequest,
|
||||
CardResponse,
|
||||
CardDetailResponse,
|
||||
CardListResponse,
|
||||
CardLookupResponse,
|
||||
CardResponse,
|
||||
TransactionListResponse,
|
||||
# Transactions
|
||||
TransactionResponse,
|
||||
TransactionListResponse,
|
||||
)
|
||||
|
||||
from app.modules.loyalty.schemas.stamp import (
|
||||
# Stamp operations
|
||||
StampRequest,
|
||||
StampResponse,
|
||||
StampRedeemRequest,
|
||||
StampRedeemResponse,
|
||||
StampVoidRequest,
|
||||
StampVoidResponse,
|
||||
from app.modules.loyalty.schemas.pin import (
|
||||
# Staff PIN
|
||||
PinCreate,
|
||||
PinListResponse,
|
||||
PinResponse,
|
||||
PinUpdate,
|
||||
PinVerifyRequest,
|
||||
PinVerifyResponse,
|
||||
)
|
||||
|
||||
from app.modules.loyalty.schemas.points import (
|
||||
PointsAdjustRequest,
|
||||
PointsAdjustResponse,
|
||||
# Points operations
|
||||
PointsEarnRequest,
|
||||
PointsEarnResponse,
|
||||
@@ -72,18 +55,31 @@ from app.modules.loyalty.schemas.points import (
|
||||
PointsRedeemResponse,
|
||||
PointsVoidRequest,
|
||||
PointsVoidResponse,
|
||||
PointsAdjustRequest,
|
||||
PointsAdjustResponse,
|
||||
)
|
||||
|
||||
from app.modules.loyalty.schemas.pin import (
|
||||
# Staff PIN
|
||||
PinCreate,
|
||||
PinUpdate,
|
||||
PinResponse,
|
||||
PinListResponse,
|
||||
PinVerifyRequest,
|
||||
PinVerifyResponse,
|
||||
from app.modules.loyalty.schemas.program import (
|
||||
# Merchant settings
|
||||
MerchantSettingsResponse,
|
||||
MerchantSettingsUpdate,
|
||||
MerchantStatsResponse,
|
||||
# Points rewards
|
||||
PointsRewardConfig,
|
||||
# Program CRUD
|
||||
ProgramCreate,
|
||||
ProgramListResponse,
|
||||
ProgramResponse,
|
||||
# Stats
|
||||
ProgramStatsResponse,
|
||||
ProgramUpdate,
|
||||
TierConfig,
|
||||
)
|
||||
from app.modules.loyalty.schemas.stamp import (
|
||||
StampRedeemRequest,
|
||||
StampRedeemResponse,
|
||||
# Stamp operations
|
||||
StampRequest,
|
||||
StampResponse,
|
||||
StampVoidRequest,
|
||||
StampVoidResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -6,38 +6,38 @@ Provides loyalty program management, card operations, stamp/points
|
||||
handling, and wallet integration.
|
||||
"""
|
||||
|
||||
from app.modules.loyalty.services.program_service import (
|
||||
ProgramService,
|
||||
program_service,
|
||||
from app.modules.loyalty.services.apple_wallet_service import (
|
||||
AppleWalletService,
|
||||
apple_wallet_service,
|
||||
)
|
||||
from app.modules.loyalty.services.card_service import (
|
||||
CardService,
|
||||
card_service,
|
||||
)
|
||||
from app.modules.loyalty.services.stamp_service import (
|
||||
StampService,
|
||||
stamp_service,
|
||||
)
|
||||
from app.modules.loyalty.services.points_service import (
|
||||
PointsService,
|
||||
points_service,
|
||||
from app.modules.loyalty.services.google_wallet_service import (
|
||||
GoogleWalletService,
|
||||
google_wallet_service,
|
||||
)
|
||||
from app.modules.loyalty.services.pin_service import (
|
||||
PinService,
|
||||
pin_service,
|
||||
)
|
||||
from app.modules.loyalty.services.points_service import (
|
||||
PointsService,
|
||||
points_service,
|
||||
)
|
||||
from app.modules.loyalty.services.program_service import (
|
||||
ProgramService,
|
||||
program_service,
|
||||
)
|
||||
from app.modules.loyalty.services.stamp_service import (
|
||||
StampService,
|
||||
stamp_service,
|
||||
)
|
||||
from app.modules.loyalty.services.wallet_service import (
|
||||
WalletService,
|
||||
wallet_service,
|
||||
)
|
||||
from app.modules.loyalty.services.google_wallet_service import (
|
||||
GoogleWalletService,
|
||||
google_wallet_service,
|
||||
)
|
||||
from app.modules.loyalty.services.apple_wallet_service import (
|
||||
AppleWalletService,
|
||||
apple_wallet_service,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"ProgramService",
|
||||
|
||||
@@ -22,7 +22,11 @@ from app.modules.loyalty.exceptions import (
|
||||
AppleWalletNotConfiguredException,
|
||||
WalletIntegrationException,
|
||||
)
|
||||
from app.modules.loyalty.models import AppleDeviceRegistration, LoyaltyCard, LoyaltyProgram
|
||||
from app.modules.loyalty.models import (
|
||||
AppleDeviceRegistration,
|
||||
LoyaltyCard,
|
||||
LoyaltyProgram,
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ Handles Google Wallet integration including:
|
||||
- Generating "Add to Wallet" URLs
|
||||
"""
|
||||
|
||||
import json
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
@@ -135,17 +134,16 @@ class GoogleWalletService:
|
||||
|
||||
logger.info(f"Created Google Wallet class {class_id} for program {program.id}")
|
||||
return class_id
|
||||
elif response.status_code == 409:
|
||||
if response.status_code == 409:
|
||||
# Class already exists
|
||||
program.google_class_id = class_id
|
||||
db.commit()
|
||||
return class_id
|
||||
else:
|
||||
error = response.json() if response.text else {}
|
||||
raise WalletIntegrationException(
|
||||
"google",
|
||||
f"Failed to create class: {response.status_code} - {error}",
|
||||
)
|
||||
error = response.json() if response.text else {}
|
||||
raise WalletIntegrationException(
|
||||
"google",
|
||||
f"Failed to create class: {response.status_code} - {error}",
|
||||
)
|
||||
except WalletIntegrationException:
|
||||
raise
|
||||
except Exception as e:
|
||||
@@ -223,17 +221,16 @@ class GoogleWalletService:
|
||||
|
||||
logger.info(f"Created Google Wallet object {object_id} for card {card.id}")
|
||||
return object_id
|
||||
elif response.status_code == 409:
|
||||
if response.status_code == 409:
|
||||
# Object already exists
|
||||
card.google_object_id = object_id
|
||||
db.commit()
|
||||
return object_id
|
||||
else:
|
||||
error = response.json() if response.text else {}
|
||||
raise WalletIntegrationException(
|
||||
"google",
|
||||
f"Failed to create object: {response.status_code} - {error}",
|
||||
)
|
||||
error = response.json() if response.text else {}
|
||||
raise WalletIntegrationException(
|
||||
"google",
|
||||
f"Failed to create object: {response.status_code} - {error}",
|
||||
)
|
||||
except WalletIntegrationException:
|
||||
raise
|
||||
except Exception as e:
|
||||
@@ -330,9 +327,10 @@ class GoogleWalletService:
|
||||
|
||||
# Generate JWT for save link
|
||||
try:
|
||||
import jwt
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import jwt
|
||||
|
||||
credentials = self._get_credentials()
|
||||
|
||||
claims = {
|
||||
|
||||
@@ -14,7 +14,6 @@ Handles PIN operations including:
|
||||
"""
|
||||
|
||||
import logging
|
||||
from datetime import UTC, datetime
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
@@ -218,7 +217,6 @@ class PinService:
|
||||
def delete_pin(self, db: Session, pin_id: int) -> None:
|
||||
"""Delete a staff PIN."""
|
||||
pin = self.require_pin(db, pin_id)
|
||||
program_id = pin.program_id
|
||||
store_id = pin.store_id
|
||||
|
||||
db.delete(pin)
|
||||
|
||||
@@ -27,7 +27,7 @@ from app.modules.loyalty.exceptions import (
|
||||
LoyaltyProgramInactiveException,
|
||||
StaffPinRequiredException,
|
||||
)
|
||||
from app.modules.loyalty.models import LoyaltyCard, LoyaltyTransaction, TransactionType
|
||||
from app.modules.loyalty.models import LoyaltyTransaction, TransactionType
|
||||
from app.modules.loyalty.services.card_service import card_service
|
||||
from app.modules.loyalty.services.pin_service import pin_service
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ from app.modules.loyalty.exceptions import (
|
||||
)
|
||||
from app.modules.loyalty.models import (
|
||||
LoyaltyProgram,
|
||||
LoyaltyType,
|
||||
MerchantLoyaltySettings,
|
||||
)
|
||||
from app.modules.loyalty.schemas.program import (
|
||||
@@ -512,7 +511,7 @@ class ProgramService:
|
||||
"id": program.id,
|
||||
"display_name": program.display_name,
|
||||
"card_name": program.card_name,
|
||||
"loyalty_type": program.loyalty_type.value if hasattr(program.loyalty_type, 'value') else str(program.loyalty_type),
|
||||
"loyalty_type": program.loyalty_type.value if hasattr(program.loyalty_type, "value") else str(program.loyalty_type),
|
||||
"points_per_euro": program.points_per_euro,
|
||||
"welcome_bonus_points": program.welcome_bonus_points,
|
||||
"minimum_redemption_points": program.minimum_redemption_points,
|
||||
|
||||
@@ -19,16 +19,15 @@ from datetime import UTC, datetime, timedelta
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.modules.loyalty.config import config
|
||||
from app.modules.loyalty.exceptions import (
|
||||
DailyStampLimitException,
|
||||
InsufficientStampsException,
|
||||
LoyaltyCardInactiveException,
|
||||
LoyaltyProgramInactiveException,
|
||||
StampCooldownException,
|
||||
StaffPinRequiredException,
|
||||
StampCooldownException,
|
||||
)
|
||||
from app.modules.loyalty.models import LoyaltyCard, LoyaltyTransaction, TransactionType
|
||||
from app.modules.loyalty.models import LoyaltyTransaction, TransactionType
|
||||
from app.modules.loyalty.services.card_service import card_service
|
||||
from app.modules.loyalty.services.pin_service import pin_service
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import logging
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.modules.loyalty.models import LoyaltyCard, LoyaltyProgram
|
||||
from app.modules.loyalty.models import LoyaltyCard
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -33,8 +33,12 @@ class WalletService:
|
||||
Returns:
|
||||
Dict with google_wallet_url and apple_wallet_url
|
||||
"""
|
||||
from app.modules.loyalty.services.apple_wallet_service import apple_wallet_service
|
||||
from app.modules.loyalty.services.google_wallet_service import google_wallet_service
|
||||
from app.modules.loyalty.services.apple_wallet_service import (
|
||||
apple_wallet_service,
|
||||
)
|
||||
from app.modules.loyalty.services.google_wallet_service import (
|
||||
google_wallet_service,
|
||||
)
|
||||
|
||||
urls = {
|
||||
"google_wallet_url": None,
|
||||
@@ -72,15 +76,18 @@ class WalletService:
|
||||
Returns:
|
||||
Dict with success status for each wallet
|
||||
"""
|
||||
from app.modules.loyalty.services.apple_wallet_service import apple_wallet_service
|
||||
from app.modules.loyalty.services.google_wallet_service import google_wallet_service
|
||||
from app.modules.loyalty.services.apple_wallet_service import (
|
||||
apple_wallet_service,
|
||||
)
|
||||
from app.modules.loyalty.services.google_wallet_service import (
|
||||
google_wallet_service,
|
||||
)
|
||||
|
||||
results = {
|
||||
"google_wallet": False,
|
||||
"apple_wallet": False,
|
||||
}
|
||||
|
||||
program = card.program
|
||||
|
||||
# Sync to Google Wallet
|
||||
if card.google_object_id:
|
||||
@@ -113,7 +120,9 @@ class WalletService:
|
||||
Returns:
|
||||
Dict with success status for each wallet
|
||||
"""
|
||||
from app.modules.loyalty.services.google_wallet_service import google_wallet_service
|
||||
from app.modules.loyalty.services.google_wallet_service import (
|
||||
google_wallet_service,
|
||||
)
|
||||
|
||||
results = {
|
||||
"google_wallet": False,
|
||||
|
||||
Reference in New Issue
Block a user