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:
@@ -10,6 +10,8 @@ from typing import Any
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, EmailStr, Field, field_validator
|
||||
|
||||
from app.modules.tenancy.schemas.store import StoreSummary
|
||||
|
||||
|
||||
class MerchantBase(BaseModel):
|
||||
"""Base schema for merchant with common fields."""
|
||||
@@ -214,3 +216,46 @@ class MerchantTransferOwnershipResponse(BaseModel):
|
||||
|
||||
transferred_at: datetime
|
||||
transfer_reason: str | None
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Merchant Portal Schemas (for merchant-facing routes)
|
||||
# ============================================================================
|
||||
|
||||
|
||||
class MerchantPortalProfileResponse(BaseModel):
|
||||
"""Merchant profile as seen by the merchant owner."""
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
name: str
|
||||
description: str | None
|
||||
contact_email: str
|
||||
contact_phone: str | None
|
||||
website: str | None
|
||||
business_address: str | None
|
||||
tax_number: str | None
|
||||
is_verified: bool
|
||||
|
||||
|
||||
class MerchantPortalProfileUpdate(BaseModel):
|
||||
"""Merchant profile update from the merchant portal.
|
||||
Excludes admin-only fields (is_active, is_verified)."""
|
||||
|
||||
name: str | None = Field(None, min_length=2, max_length=200)
|
||||
description: str | None = None
|
||||
contact_email: EmailStr | None = None
|
||||
contact_phone: str | None = None
|
||||
website: str | None = None
|
||||
business_address: str | None = None
|
||||
tax_number: str | None = None
|
||||
|
||||
|
||||
class MerchantPortalStoreListResponse(BaseModel):
|
||||
"""Paginated store list for the merchant portal."""
|
||||
|
||||
stores: list[StoreSummary]
|
||||
total: int
|
||||
skip: int
|
||||
limit: int
|
||||
|
||||
Reference in New Issue
Block a user