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:
@@ -9,7 +9,6 @@ from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Tier Information Schemas
|
||||
# ============================================================================
|
||||
@@ -141,3 +140,82 @@ class FeatureCheckResponse(BaseModel):
|
||||
message: str | None = None
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Merchant Portal Schemas (for merchant-facing routes)
|
||||
# ============================================================================
|
||||
|
||||
|
||||
class MerchantPortalSubscriptionItem(BaseModel):
|
||||
"""Subscription item with tier and platform names for merchant portal list."""
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
# Base subscription fields (mirror MerchantSubscriptionResponse)
|
||||
id: int
|
||||
merchant_id: int
|
||||
platform_id: int
|
||||
tier_id: int | None
|
||||
status: str
|
||||
is_annual: bool
|
||||
period_start: datetime
|
||||
period_end: datetime
|
||||
trial_ends_at: datetime | None
|
||||
stripe_customer_id: str | None = None
|
||||
cancelled_at: datetime | None = None
|
||||
is_active: bool
|
||||
is_trial: bool
|
||||
trial_days_remaining: int | None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
# Enrichment fields
|
||||
tier: str | None = None
|
||||
tier_name: str | None = None
|
||||
platform_name: str = ""
|
||||
|
||||
|
||||
class MerchantPortalSubscriptionListResponse(BaseModel):
|
||||
"""Paginated subscription list for merchant portal."""
|
||||
|
||||
subscriptions: list[MerchantPortalSubscriptionItem]
|
||||
total: int
|
||||
|
||||
|
||||
class MerchantPortalSubscriptionDetailResponse(BaseModel):
|
||||
"""Subscription detail with tier info for merchant portal."""
|
||||
|
||||
subscription: MerchantPortalSubscriptionItem
|
||||
tier: TierInfo | None = None
|
||||
|
||||
|
||||
class MerchantPortalAvailableTiersResponse(BaseModel):
|
||||
"""Available tiers for a platform."""
|
||||
|
||||
tiers: list[dict]
|
||||
current_tier: str | None = None
|
||||
|
||||
|
||||
class ChangeTierRequest(BaseModel):
|
||||
"""Request for changing subscription tier."""
|
||||
|
||||
tier_code: str
|
||||
is_annual: bool = False
|
||||
|
||||
|
||||
class ChangeTierResponse(BaseModel):
|
||||
"""Response after tier change."""
|
||||
|
||||
message: str
|
||||
new_tier: str | None = None
|
||||
effective_immediately: bool = False
|
||||
|
||||
|
||||
class MerchantPortalInvoiceListResponse(BaseModel):
|
||||
"""Paginated invoice list for merchant portal."""
|
||||
|
||||
invoices: list[dict]
|
||||
total: int
|
||||
skip: int
|
||||
limit: int
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user