refactor(arch): eliminate all cross-module model imports in service layer
Some checks failed
Some checks failed
Enforce MOD-025/MOD-026 rules: zero top-level cross-module model imports remain in any service file. All 66 files migrated using deferred import patterns (method-body, _get_model() helpers, instance-cached self._Model) and new cross-module service methods in tenancy. Documentation updated with Pattern 6 (deferred imports), migration plan marked complete, and violations status reflects 84→0 service-layer violations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -125,6 +125,21 @@ class MerchantService:
|
||||
|
||||
return merchant
|
||||
|
||||
def get_merchant_by_id_optional(
|
||||
self, db: Session, merchant_id: int
|
||||
) -> Merchant | None:
|
||||
"""
|
||||
Get merchant by ID, returns None if not found.
|
||||
|
||||
Args:
|
||||
db: Database session
|
||||
merchant_id: Merchant ID
|
||||
|
||||
Returns:
|
||||
Merchant object or None
|
||||
"""
|
||||
return db.query(Merchant).filter(Merchant.id == merchant_id).first()
|
||||
|
||||
def get_merchants(
|
||||
self,
|
||||
db: Session,
|
||||
|
||||
Reference in New Issue
Block a user