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:
@@ -70,9 +70,10 @@ class ProjectModel:
|
||||
project_name: str = "",
|
||||
project_url: str = "",
|
||||
property_contacts: Dict[str, Any] = None,
|
||||
viewing_emails: List[str] = None,
|
||||
viewing_domains: List[str] = None
|
||||
):
|
||||
viewing_emails: List[str] = None,
|
||||
viewing_domains: List[str] = None,
|
||||
last_synced_at: str = ""
|
||||
):
|
||||
|
||||
self.client = client
|
||||
self.matter_description = matter_description
|
||||
@@ -131,6 +132,7 @@ class ProjectModel:
|
||||
self.property_contacts = property_contacts or {}
|
||||
self.viewing_emails = viewing_emails or []
|
||||
self.viewing_domains = viewing_domains or []
|
||||
self.last_synced_at = last_synced_at
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Convert the ProjectModel to a dictionary for Firestore storage."""
|
||||
@@ -191,7 +193,8 @@ class ProjectModel:
|
||||
"ProjectUrl": self.project_url,
|
||||
"property_contacts": self.property_contacts,
|
||||
"viewing_emails": self.viewing_emails,
|
||||
"viewing_domains": self.viewing_domains
|
||||
"viewing_domains": self.viewing_domains,
|
||||
"last_synced_at": self.last_synced_at
|
||||
}
|
||||
|
||||
@classmethod
|
||||
@@ -254,5 +257,6 @@ class ProjectModel:
|
||||
project_url=data.get("ProjectUrl", ""),
|
||||
property_contacts=data.get("property_contacts", {}),
|
||||
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