Files
orion/app/modules/prospecting/schemas/score.py
Samir Boulahtit 8a70259445
Some checks failed
CI / ruff (push) Successful in 15s
CI / pytest (push) Has been cancelled
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
fix(tenancy): use absolute URL in team invitation email link
Email clients need absolute URLs to make links clickable. The
acceptance_link was a relative path (/store/invitation/accept?token=...)
which rendered as plain text. Now prepends the platform domain with
the correct protocol.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 17:39:46 +02:00

43 lines
1.0 KiB
Python

# app/modules/prospecting/schemas/score.py
"""Pydantic schemas for opportunity scoring."""
import json
from datetime import datetime
from pydantic import BaseModel, field_validator
class ProspectScoreResponse(BaseModel):
"""Schema for prospect score response."""
id: int
prospect_id: int
score: int
technical_health_score: int
modernity_score: int
business_value_score: int
engagement_score: int
reason_flags: list[str] = []
score_breakdown: dict[str, int] | None = None
lead_tier: str | None = None
notes: str | None = None
created_at: datetime
updated_at: datetime
@field_validator("reason_flags", mode="before")
@classmethod
def parse_reason_flags(cls, v):
if isinstance(v, str):
return json.loads(v)
return v
@field_validator("score_breakdown", mode="before")
@classmethod
def parse_score_breakdown(cls, v):
if isinstance(v, str):
return json.loads(v)
return v
class Config:
from_attributes = True