(self, doc_id: str, current: dict)
| 431 | return self.data["documents"].get(doc_id) |
| 432 | |
| 433 | def upsert(self, doc_id: str, current: dict): |
| 434 | existing = self.data["documents"].get(doc_id, {}) |
| 435 | history = existing.get("history", []) |
| 436 | if existing.get("current"): |
| 437 | history.append(existing["current"]) |
| 438 | self.data["documents"][doc_id] = {"current": current, "history": history} |
| 439 | |
| 440 | def find_outdated(self, days: int = 180) -> list: |
| 441 | cutoff = datetime.now() - timedelta(days=days) |