Compare commits
No commits in common. "c3135e1549efdcdf70a0b56764ceb9746f6fd1b1" and "dbf468b5860edf355ada355568bc162acc8b958a" have entirely different histories.
c3135e1549
...
dbf468b586
6 changed files with 64 additions and 175 deletions
|
|
@ -1,36 +0,0 @@
|
||||||
"""add user page
|
|
||||||
|
|
||||||
Revision ID: 4324550d9c83
|
|
||||||
Revises: 31359fcda8a7
|
|
||||||
Create Date: 2025-10-03 16:08:13.898990
|
|
||||||
|
|
||||||
"""
|
|
||||||
from typing import Sequence, Union
|
|
||||||
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
|
||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
|
||||||
revision: str = '4324550d9c83'
|
|
||||||
down_revision: Union[str, Sequence[str], None] = '31359fcda8a7'
|
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
|
||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
|
||||||
"""Upgrade schema."""
|
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
|
||||||
with op.batch_alter_table('user_session', schema=None) as batch_op:
|
|
||||||
batch_op.add_column(sa.Column('page_id', sa.String(), nullable=True))
|
|
||||||
|
|
||||||
# ### end Alembic commands ###
|
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
|
||||||
"""Downgrade schema."""
|
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
|
||||||
with op.batch_alter_table('user_session', schema=None) as batch_op:
|
|
||||||
batch_op.drop_column('page_id')
|
|
||||||
|
|
||||||
# ### end Alembic commands ###
|
|
||||||
|
|
@ -16,7 +16,6 @@ async def insurance_chat(request: models.InsuranceChatRequest):
|
||||||
"""Handle insurance chat requests"""
|
"""Handle insurance chat requests"""
|
||||||
try:
|
try:
|
||||||
current_page = None
|
current_page = None
|
||||||
page_id = None
|
|
||||||
if request.context and request.context.page:
|
if request.context and request.context.page:
|
||||||
page_id = str(request.context.page).lower()
|
page_id = str(request.context.page).lower()
|
||||||
current_page = await get_page_description(page_id)
|
current_page = await get_page_description(page_id)
|
||||||
|
|
@ -33,7 +32,6 @@ async def insurance_chat(request: models.InsuranceChatRequest):
|
||||||
uid=str(request.userId) if request.userId else None,
|
uid=str(request.userId) if request.userId else None,
|
||||||
current_page=current_page,
|
current_page=current_page,
|
||||||
application=application,
|
application=application,
|
||||||
page_id=page_id
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return models.InsuranceChatResponse(
|
return models.InsuranceChatResponse(
|
||||||
|
|
@ -59,15 +57,8 @@ async def init_chat(request: models.InitializeChatRequest):
|
||||||
name = None
|
name = None
|
||||||
if request.context and request.context.name:
|
if request.context and request.context.name:
|
||||||
name = request.context.name.first_name
|
name = request.context.name.first_name
|
||||||
first_visit = True
|
|
||||||
if request.context:
|
|
||||||
first_visit = request.context.isFirstVisit
|
|
||||||
|
|
||||||
page_id = None
|
result = await chat_service.initialize_chat(str(request.userId), application, name)
|
||||||
if request.context and request.context.page:
|
|
||||||
page_id = str(request.context.page).lower()
|
|
||||||
|
|
||||||
result = await chat_service.initialize_chat(str(request.userId), application, name, first_visit, page_id)
|
|
||||||
return models.InitializeChatResponse(
|
return models.InitializeChatResponse(
|
||||||
session_id=result["session_id"],
|
session_id=result["session_id"],
|
||||||
answer=result["answer"],
|
answer=result["answer"],
|
||||||
|
|
@ -78,36 +69,14 @@ async def init_chat(request: models.InitializeChatRequest):
|
||||||
async def estimate(request: models.EstimationRequest):
|
async def estimate(request: models.EstimationRequest):
|
||||||
"""Handle insurance estimation requests"""
|
"""Handle insurance estimation requests"""
|
||||||
try:
|
try:
|
||||||
if not request.applicants:
|
if not request.applicants or not request.plans:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail="Missing required applicants or plans"
|
detail="Missing required applicants or plans"
|
||||||
)
|
)
|
||||||
|
|
||||||
print("estimation request: ", request)
|
|
||||||
|
|
||||||
has_primary = False
|
|
||||||
has_spouse = False
|
|
||||||
has_dependents = False
|
|
||||||
for applicant in request.applicants:
|
|
||||||
if applicant.applicant == 1:
|
|
||||||
has_primary = True
|
|
||||||
elif applicant.applicant == 2:
|
|
||||||
has_spouse = True
|
|
||||||
elif applicant.applicant == 3:
|
|
||||||
has_dependents = True
|
|
||||||
|
|
||||||
if has_primary and not has_spouse and not has_dependents:
|
|
||||||
coverage = 1
|
|
||||||
elif has_primary and has_spouse and not has_dependents:
|
|
||||||
coverage = 2
|
|
||||||
elif has_primary and not has_spouse and has_dependents:
|
|
||||||
coverage = 3
|
|
||||||
else:
|
|
||||||
coverage = 4
|
|
||||||
|
|
||||||
estimation_service = EstimationService()
|
estimation_service = EstimationService()
|
||||||
estimation_response = await estimation_service.estimate_insurance(request.applicants, request.phq, coverage)
|
estimation_response = await estimation_service.estimate_insurance(request.applicants, request.phq, request.plans)
|
||||||
|
|
||||||
return estimation_response
|
return estimation_response
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ class UserSession(Base):
|
||||||
id = Column(BigInteger, primary_key=True, index=True)
|
id = Column(BigInteger, primary_key=True, index=True)
|
||||||
user_id = Column(String, index=True)
|
user_id = Column(String, index=True)
|
||||||
session_id = Column(String)
|
session_id = Column(String)
|
||||||
page_id = Column(String, default=None, nullable=True)
|
|
||||||
|
|
||||||
|
|
||||||
engine = create_engine(settings.DATABASE_URL)
|
engine = create_engine(settings.DATABASE_URL)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class Applicant(BaseModel):
|
||||||
|
|
||||||
class Plan(BaseModel):
|
class Plan(BaseModel):
|
||||||
id: int
|
id: int
|
||||||
priceId: int | None = None
|
priceId: int
|
||||||
|
|
||||||
class Medication(BaseModel):
|
class Medication(BaseModel):
|
||||||
applicant: int
|
applicant: int
|
||||||
|
|
@ -61,6 +61,7 @@ class Address(BaseModel):
|
||||||
class EstimationRequest(BaseModel):
|
class EstimationRequest(BaseModel):
|
||||||
userId: str | int | None = Field(None, description="Unique identifier")
|
userId: str | int | None = Field(None, description="Unique identifier")
|
||||||
applicants: List[Applicant]
|
applicants: List[Applicant]
|
||||||
|
plans: List[Plan]
|
||||||
phq: PHQ
|
phq: PHQ
|
||||||
income: float
|
income: float
|
||||||
address: Address
|
address: Address
|
||||||
|
|
@ -68,8 +69,7 @@ class EstimationRequest(BaseModel):
|
||||||
class EstimationDetails(BaseModel):
|
class EstimationDetails(BaseModel):
|
||||||
dtq: bool
|
dtq: bool
|
||||||
reason: str
|
reason: str
|
||||||
# price_id: int = -1
|
price_id: int
|
||||||
tier: str
|
|
||||||
|
|
||||||
class EstimationResult(BaseModel):
|
class EstimationResult(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
|
|
@ -83,7 +83,7 @@ class EstimationResult(BaseModel):
|
||||||
class EstimationResponse(BaseModel):
|
class EstimationResponse(BaseModel):
|
||||||
status: str
|
status: str
|
||||||
details: EstimationDetails
|
details: EstimationDetails
|
||||||
# results: List[EstimationResult]
|
results: List[EstimationResult]
|
||||||
|
|
||||||
class UserNameContext(BaseModel):
|
class UserNameContext(BaseModel):
|
||||||
first_name: str
|
first_name: str
|
||||||
|
|
@ -94,7 +94,6 @@ class InsuranceChatContext(BaseModel):
|
||||||
application: dict | None = None
|
application: dict | None = None
|
||||||
applicationDTO: str | None = None
|
applicationDTO: str | None = None
|
||||||
name: UserNameContext | None = None
|
name: UserNameContext | None = None
|
||||||
isFirstVisit: bool = True
|
|
||||||
|
|
||||||
class InsuranceChatRequest(BaseModel):
|
class InsuranceChatRequest(BaseModel):
|
||||||
userId: str | int | None = None
|
userId: str | int | None = None
|
||||||
|
|
@ -125,12 +124,9 @@ class PlansParam(BaseModel):
|
||||||
class ApplicantParam(BaseModel):
|
class ApplicantParam(BaseModel):
|
||||||
applicants: list[Applicant]
|
applicants: list[Applicant]
|
||||||
|
|
||||||
class PageParam(BaseModel):
|
|
||||||
page: str
|
|
||||||
|
|
||||||
class ChatHook(BaseModel):
|
class ChatHook(BaseModel):
|
||||||
tool: str
|
tool: str
|
||||||
params: PlansParam | ApplicantParam | PageParam
|
params: PlansParam | ApplicantParam
|
||||||
|
|
||||||
class AIChatResponse(BaseModel):
|
class AIChatResponse(BaseModel):
|
||||||
answer: str
|
answer: str
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ from typing import Dict, Any, List, Optional
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from src.models import ApplicantParam, ChatHook, PlansParam, PageParam
|
from src.models import ApplicantParam, ChatHook, PlansParam
|
||||||
from .session_service import session_service
|
from .session_service import session_service
|
||||||
from ..api.v1.models import Source, HistoryItem
|
from ..api.v1.models import Source, HistoryItem
|
||||||
from ..config import settings
|
from ..config import settings
|
||||||
|
|
@ -87,15 +87,6 @@ class ChatService:
|
||||||
"message": f"I'm sorry, I'm experiencing technical difficulties. Please try again later. Error: {str(e)}"
|
"message": f"I'm sorry, I'm experiencing technical difficulties. Please try again later. Error: {str(e)}"
|
||||||
}
|
}
|
||||||
|
|
||||||
async def add_message_to_history(self, session_id: str, message: list):
|
|
||||||
async with await self.get_client() as client:
|
|
||||||
response = await client.post(
|
|
||||||
"/messages/",
|
|
||||||
params={"chat_session_id": session_id,},
|
|
||||||
json={"content": message}
|
|
||||||
)
|
|
||||||
return response.json()
|
|
||||||
|
|
||||||
async def get_chat_history(self, session_id: str) -> List[HistoryItem]:
|
async def get_chat_history(self, session_id: str) -> List[HistoryItem]:
|
||||||
"""Get chat history for a session and format it properly"""
|
"""Get chat history for a session and format it properly"""
|
||||||
async with await self.get_client() as client:
|
async with await self.get_client() as client:
|
||||||
|
|
@ -154,6 +145,7 @@ class ChatService:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _extract_sources_from_response(self, response_text: str) -> List[Source]:
|
def _extract_sources_from_response(self, response_text: str) -> List[Source]:
|
||||||
"""Extract sources from RAG search results if available"""
|
"""Extract sources from RAG search results if available"""
|
||||||
# This is a placeholder - in a real implementation, you would:
|
# This is a placeholder - in a real implementation, you would:
|
||||||
|
|
@ -167,10 +159,10 @@ class ChatService:
|
||||||
|
|
||||||
async def get_user_session(self, uid: str) -> str | None:
|
async def get_user_session(self, uid: str) -> str | None:
|
||||||
with Session() as session:
|
with Session() as session:
|
||||||
user_session = session.query(UserSession).filter(UserSession.user_id == uid).first()
|
session = session.query(UserSession).filter(UserSession.user_id == uid).first()
|
||||||
if not user_session:
|
if not session:
|
||||||
return None
|
return None
|
||||||
return user_session.session_id
|
return session.session_id
|
||||||
|
|
||||||
async def create_user_session(self, uid: str, session_id: str):
|
async def create_user_session(self, uid: str, session_id: str):
|
||||||
with Session() as session:
|
with Session() as session:
|
||||||
|
|
@ -181,43 +173,7 @@ class ChatService:
|
||||||
session.add(user_session)
|
session.add(user_session)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
async def update_user_page(self, uid: str, page_id: str | None):
|
async def initialize_chat(self, uid: str, application, name):
|
||||||
with Session() as session:
|
|
||||||
user_session = session.query(UserSession).filter(UserSession.user_id == uid).first()
|
|
||||||
old_page_id = user_session.page_id
|
|
||||||
user_session.page_id = page_id
|
|
||||||
session.add(user_session)
|
|
||||||
session.commit()
|
|
||||||
return old_page_id
|
|
||||||
|
|
||||||
async def get_user_page(self, uid: str):
|
|
||||||
with Session() as session:
|
|
||||||
user_session = session.query(UserSession).filter(UserSession.user_id == uid).first()
|
|
||||||
old_page_id = user_session.page_id
|
|
||||||
return old_page_id
|
|
||||||
|
|
||||||
def get_welcome_message(self, application, name, first_visit):
|
|
||||||
try:
|
|
||||||
if not name:
|
|
||||||
name = application["applicants"][0]["firstName"]
|
|
||||||
except:
|
|
||||||
return INIT_MESSAGES[0]
|
|
||||||
|
|
||||||
if first_visit:
|
|
||||||
return INIT_MESSAGES[0]
|
|
||||||
|
|
||||||
try:
|
|
||||||
applicant = application["applicants"][0]
|
|
||||||
except:
|
|
||||||
return INIT_MESSAGES[2].format(name=name)
|
|
||||||
|
|
||||||
if not applicant.get("gender") or not applicant.get("dob") or applicant.get("dob") == "-01-" or not applicant.get("weight") or applicant.get("heightFt") is None or applicant.get("heightIn") is None:
|
|
||||||
return INIT_MESSAGES[2].format(name=name)
|
|
||||||
|
|
||||||
return INIT_MESSAGES[1].format(name=name)
|
|
||||||
|
|
||||||
|
|
||||||
async def initialize_chat(self, uid: str, application, name, first_visit, page_id):
|
|
||||||
session_id = await self.get_user_session(uid)
|
session_id = await self.get_user_session(uid)
|
||||||
if not session_id or not await session_service.validate_session(session_id):
|
if not session_id or not await session_service.validate_session(session_id):
|
||||||
session_id = await session_service.create_session(agent_id=settings.TALESTORM_AGENT_ID)
|
session_id = await session_service.create_session(agent_id=settings.TALESTORM_AGENT_ID)
|
||||||
|
|
@ -225,24 +181,43 @@ class ChatService:
|
||||||
await self.create_user_session(uid, session_id)
|
await self.create_user_session(uid, session_id)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
# await self.update_user_page(uid, page_id)
|
|
||||||
|
|
||||||
welcome_msg = self.get_welcome_message(application, name, first_visit)
|
try:
|
||||||
|
if not name:
|
||||||
|
name = application["applicants"][0]["firstName"]
|
||||||
|
except:
|
||||||
|
return {
|
||||||
|
"session_id": session_id,
|
||||||
|
"answer": INIT_MESSAGES[0],
|
||||||
|
}
|
||||||
|
|
||||||
msg_history_item = [
|
last_message = self.get_last_chat_message_date(session_id)
|
||||||
{'parts': [{'content': 'Hi', 'part_kind': 'user-prompt'}],'kind': 'request'},
|
if not last_message:
|
||||||
{'parts': [{'content': welcome_msg, 'part_kind': 'text'}], 'kind': 'response'}
|
return {
|
||||||
]
|
"session_id": session_id,
|
||||||
|
"answer": INIT_MESSAGES[0],
|
||||||
|
}
|
||||||
|
|
||||||
await self.add_message_to_history(session_id, msg_history_item)
|
try:
|
||||||
|
applicant = application["applicants"][0]
|
||||||
|
except:
|
||||||
|
return {
|
||||||
|
"session_id": session_id,
|
||||||
|
"answer": INIT_MESSAGES[2].format(name=name)
|
||||||
|
}
|
||||||
|
if not applicant.get("gender") or not applicant.get("dob") or applicant.get("dob") == "-01-" or not applicant.get("weight") or applicant.get("heightFt") is None or applicant.get("heightIn") is None:
|
||||||
|
return {
|
||||||
|
"session_id": session_id,
|
||||||
|
"answer": INIT_MESSAGES[2].format(name=name)
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"session_id": session_id,
|
"session_id": session_id,
|
||||||
"answer": welcome_msg
|
"answer": INIT_MESSAGES[1].format(name=name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async def process_insurance_chat(self, message: str, session_id: Optional[str] = None, uid: Optional[str] = None, current_page: Optional[str] = None, application: Optional[dict] = None, page_id = None) -> Dict[str, Any]:
|
async def process_insurance_chat(self, message: str, session_id: Optional[str] = None, uid: Optional[str] = None, current_page: Optional[str] = None, application: Optional[dict] = None) -> Dict[str, Any]:
|
||||||
"""Process an insurance chat request"""
|
"""Process an insurance chat request"""
|
||||||
try:
|
try:
|
||||||
if not session_id or not await session_service.validate_session(session_id):
|
if not session_id or not await session_service.validate_session(session_id):
|
||||||
|
|
@ -257,10 +232,6 @@ class ChatService:
|
||||||
else:
|
else:
|
||||||
session_id = await session_service.create_session(agent_id=settings.TALESTORM_AGENT_ID)
|
session_id = await session_service.create_session(agent_id=settings.TALESTORM_AGENT_ID)
|
||||||
|
|
||||||
if page_id.lower() != 'welcome':
|
|
||||||
old_page_id = await self.update_user_page(uid, page_id)
|
|
||||||
else:
|
|
||||||
old_page_id = await self.get_user_page(uid)
|
|
||||||
|
|
||||||
instructions = ""
|
instructions = ""
|
||||||
if uid:
|
if uid:
|
||||||
|
|
@ -295,7 +266,6 @@ class ChatService:
|
||||||
compare_plans = ai_response.get("compare_plans")
|
compare_plans = ai_response.get("compare_plans")
|
||||||
show_plans = ai_response.get("show_plans")
|
show_plans = ai_response.get("show_plans")
|
||||||
update_applicants = ai_response.get("update_applicants")
|
update_applicants = ai_response.get("update_applicants")
|
||||||
show_page = ai_response.get("show_page")
|
|
||||||
hooks = []
|
hooks = []
|
||||||
if update_applicants:
|
if update_applicants:
|
||||||
hooks.append(ChatHook(
|
hooks.append(ChatHook(
|
||||||
|
|
@ -314,12 +284,6 @@ class ChatService:
|
||||||
tool="show_plans",
|
tool="show_plans",
|
||||||
params=PlansParam(plans=show_plans)
|
params=PlansParam(plans=show_plans)
|
||||||
))
|
))
|
||||||
elif show_page and old_page_id:
|
|
||||||
hooks.append(ChatHook(
|
|
||||||
tool="show_page",
|
|
||||||
params=PageParam(page=old_page_id)
|
|
||||||
))
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"session_id": session_id,
|
"session_id": session_id,
|
||||||
|
|
|
||||||
|
|
@ -458,7 +458,7 @@ class EstimationService:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
async def estimate_insurance(self, applicants: list[Applicant], phq: PHQ, plan_coverage: int):
|
async def estimate_insurance(self, applicants: list[Applicant], phq: PHQ, plans: list[Plan]):
|
||||||
estimation_results = []
|
estimation_results = []
|
||||||
is_review = False
|
is_review = False
|
||||||
review_reasons = []
|
review_reasons = []
|
||||||
|
|
@ -478,6 +478,7 @@ class EstimationService:
|
||||||
base_tier = tier
|
base_tier = tier
|
||||||
break
|
break
|
||||||
|
|
||||||
|
plan_coverage = self.get_plan_coverage(plans[0])
|
||||||
rx_spend = 0
|
rx_spend = 0
|
||||||
for applicant_id, applicant in enumerate(applicants):
|
for applicant_id, applicant in enumerate(applicants):
|
||||||
applicant_review_reasons = []
|
applicant_review_reasons = []
|
||||||
|
|
@ -559,7 +560,7 @@ class EstimationService:
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# plan_price_id = self.get_plan_price(plans[0], base_tier, plan_coverage)
|
plan_price_id = self.get_plan_price(plans[0], base_tier, plan_coverage)
|
||||||
|
|
||||||
if is_dtq:
|
if is_dtq:
|
||||||
reason = "\n".join(dtq_reasons)
|
reason = "\n".join(dtq_reasons)
|
||||||
|
|
@ -568,10 +569,9 @@ class EstimationService:
|
||||||
details=EstimationDetails(
|
details=EstimationDetails(
|
||||||
dtq=is_dtq,
|
dtq=is_dtq,
|
||||||
reason=reason,
|
reason=reason,
|
||||||
# price_id=plan_price_id,
|
price_id=plan_price_id,
|
||||||
tier=f"Tier {base_tier.value}",
|
|
||||||
),
|
),
|
||||||
# results=estimation_results
|
results=estimation_results
|
||||||
)
|
)
|
||||||
|
|
||||||
if is_review:
|
if is_review:
|
||||||
|
|
@ -581,10 +581,9 @@ class EstimationService:
|
||||||
details=EstimationDetails(
|
details=EstimationDetails(
|
||||||
dtq=is_dtq,
|
dtq=is_dtq,
|
||||||
reason=reason,
|
reason=reason,
|
||||||
# price_id=plan_price_id,
|
price_id=plan_price_id,
|
||||||
tier=f"Tier {base_tier.value}",
|
|
||||||
),
|
),
|
||||||
# results=estimation_results
|
results=estimation_results
|
||||||
)
|
)
|
||||||
|
|
||||||
new_tier, tier_reason = self.get_tier(plan_coverage, rx_spend)
|
new_tier, tier_reason = self.get_tier(plan_coverage, rx_spend)
|
||||||
|
|
@ -597,16 +596,15 @@ class EstimationService:
|
||||||
details=EstimationDetails(
|
details=EstimationDetails(
|
||||||
dtq=True,
|
dtq=True,
|
||||||
reason=reason,
|
reason=reason,
|
||||||
# price_id=plan_price_id,
|
price_id=plan_price_id,
|
||||||
tier=f"Tier {base_tier.value}",
|
|
||||||
),
|
),
|
||||||
# results=estimation_results
|
results=estimation_results
|
||||||
)
|
)
|
||||||
|
|
||||||
if new_tier > base_tier:
|
if new_tier > base_tier:
|
||||||
base_tier = new_tier
|
base_tier = new_tier
|
||||||
|
|
||||||
# plan_price_id = self.get_plan_price(plans[0], base_tier, plan_coverage)
|
plan_price_id = self.get_plan_price(plans[0], base_tier, plan_coverage)
|
||||||
|
|
||||||
if base_tier is not None:
|
if base_tier is not None:
|
||||||
reason = "\n".join(accept_reasons)
|
reason = "\n".join(accept_reasons)
|
||||||
|
|
@ -615,10 +613,9 @@ class EstimationService:
|
||||||
details=EstimationDetails(
|
details=EstimationDetails(
|
||||||
dtq=is_dtq,
|
dtq=is_dtq,
|
||||||
reason=reason,
|
reason=reason,
|
||||||
# price_id=plan_price_id,
|
price_id=plan_price_id,
|
||||||
tier=f"Tier {base_tier.value}",
|
|
||||||
),
|
),
|
||||||
# results=estimation_results
|
results=estimation_results
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
reason = "\n".join(dtq_reasons)
|
reason = "\n".join(dtq_reasons)
|
||||||
|
|
@ -627,8 +624,8 @@ class EstimationService:
|
||||||
details=EstimationDetails(
|
details=EstimationDetails(
|
||||||
dtq=is_dtq,
|
dtq=is_dtq,
|
||||||
reason=reason,
|
reason=reason,
|
||||||
# price_id=plan_price_id,
|
price_id=plan_price_id,
|
||||||
tier=f"Tier {base_tier.value}",
|
|
||||||
),
|
),
|
||||||
# results=estimation_results
|
results=estimation_results
|
||||||
)
|
)
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue