feat: add last_synced_at field to ProjectModel
Track when each project was last synced from Filevine for incremental sync strategies.
This commit is contained in:
@@ -71,7 +71,8 @@ class ProjectModel:
|
|||||||
project_url: str = "",
|
project_url: str = "",
|
||||||
property_contacts: Dict[str, Any] = None,
|
property_contacts: Dict[str, Any] = None,
|
||||||
viewing_emails: List[str] = None,
|
viewing_emails: List[str] = None,
|
||||||
viewing_domains: List[str] = None
|
viewing_domains: List[str] = None,
|
||||||
|
last_synced_at: str = ""
|
||||||
):
|
):
|
||||||
|
|
||||||
self.client = client
|
self.client = client
|
||||||
@@ -131,6 +132,7 @@ class ProjectModel:
|
|||||||
self.property_contacts = property_contacts or {}
|
self.property_contacts = property_contacts or {}
|
||||||
self.viewing_emails = viewing_emails or []
|
self.viewing_emails = viewing_emails or []
|
||||||
self.viewing_domains = viewing_domains or []
|
self.viewing_domains = viewing_domains or []
|
||||||
|
self.last_synced_at = last_synced_at
|
||||||
|
|
||||||
def to_dict(self) -> Dict[str, Any]:
|
def to_dict(self) -> Dict[str, Any]:
|
||||||
"""Convert the ProjectModel to a dictionary for Firestore storage."""
|
"""Convert the ProjectModel to a dictionary for Firestore storage."""
|
||||||
@@ -191,7 +193,8 @@ class ProjectModel:
|
|||||||
"ProjectUrl": self.project_url,
|
"ProjectUrl": self.project_url,
|
||||||
"property_contacts": self.property_contacts,
|
"property_contacts": self.property_contacts,
|
||||||
"viewing_emails": self.viewing_emails,
|
"viewing_emails": self.viewing_emails,
|
||||||
"viewing_domains": self.viewing_domains
|
"viewing_domains": self.viewing_domains,
|
||||||
|
"last_synced_at": self.last_synced_at
|
||||||
}
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -254,5 +257,6 @@ class ProjectModel:
|
|||||||
project_url=data.get("ProjectUrl", ""),
|
project_url=data.get("ProjectUrl", ""),
|
||||||
property_contacts=data.get("property_contacts", {}),
|
property_contacts=data.get("property_contacts", {}),
|
||||||
viewing_emails=data.get("viewing_emails", []),
|
viewing_emails=data.get("viewing_emails", []),
|
||||||
viewing_domains=data.get("viewing_domains", [])
|
viewing_domains=data.get("viewing_domains", []),
|
||||||
|
last_synced_at=data.get("last_synced_at", "")
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user