modified: blueprints/sync_server.py

modified:   core/sync.py
This commit is contained in:
2026-06-23 17:20:06 -04:00
parent 3fb95c1617
commit fec74e24c5
2 changed files with 18 additions and 2 deletions

View File

@@ -34,6 +34,16 @@ def sync_push():
for d in data.get('deletions', []):
et = d['entity_type']
eu = d['entity_uuid']
# Log to server's sync_deletions so other pulling clients see it
existing = conn.execute(
"SELECT id FROM sync_deletions WHERE entity_type = ? AND entity_uuid = ?",
(et, eu)
).fetchone()
if not existing:
conn.execute(
"INSERT INTO sync_deletions (entity_type, entity_uuid, deleted_at) VALUES (?, ?, ?)",
(et, eu, synced_at)
)
if et == 'debtor':
conn.execute("DELETE FROM debtors WHERE uuid = ?", (eu,))
elif et == 'ticket':