Skip to content

Commit

Permalink
Merge pull request #93 from ElemarJR/bug_fixes_lead_info_and_more
Browse files Browse the repository at this point in the history
Bug fixes lead info and more
  • Loading branch information
ElemarJR authored Jan 3, 2025
2 parents 2f675cc + bdf339f commit 67016e4
Show file tree
Hide file tree
Showing 5 changed files with 280 additions and 21 deletions.
4 changes: 2 additions & 2 deletions backend/models/src/omni_models/domain/active_deals.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def get_by_id(self, id: int) -> Optional[ActiveDeal]:
def get_by_everhour_id(self, everhour_id: str) -> Optional[ActiveDeal]:
if self.__data is None:
self.__build_data()
return next((deal for deal in self.__data if deal.everhour_id == everhour_id), None)
return next((deal for deal in self.__data if deal.everhour_id and everhour_id in deal.everhour_id.split(";")), None)

def __create_active_deal(self, deal) -> ActiveDeal:
return ActiveDeal(**deal.model_dump())
return ActiveDeal(**deal.model_dump(), client_or_prospect_name=deal.client_name)

def __build_data(self):
self.__active_deals = [
Expand Down
2 changes: 1 addition & 1 deletion backend/models/src/omni_models/domain/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def __build_data(self) -> Dict[str, Case]:
for case in cases_dict.values():
for tracker_project in case.tracker_info:
deal = self.deals_repository.get_by_everhour_id(tracker_project.id)
if deal:
if deal and (deal not in case.deals):
case.deals.append(deal)

self.__data = cases_dict
2 changes: 1 addition & 1 deletion frontend/src/app/about-us/cases/tracking-projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function TrackingProjectsPage() {
{cases.map((caseItem: any) =>
caseItem.tracker?.map((tracker: any) => {
const matchingDeal = caseItem.deals?.find(
(deal: any) => deal.everhourId === tracker.id
(deal: any) => deal.everhourId && deal.everhourId.split(";").includes(tracker.id)
);
const salesCycle =
matchingDeal?.addTime && matchingDeal?.wonTime
Expand Down
Loading

0 comments on commit 67016e4

Please sign in to comment.