#925 — Refactor sync process to new logic without Pay Engine
Repo: Twill-AI/facade State: closed | Status: done Assignee: meliascosta
Created: 2026-01-15 · Updated: 2026-01-20
Description
Refactor sync architecture to cleanly separate hourly status sync and nightly TBDD sync, move processor-specific mapping into EMS/Luqra mappings, and simplify sync outputs (no officers/KPIs/documents). Ensure get_merchants returns mapped DbMerchant objects and add a master endpoint to create missing merchants from EMS/Luqra MIDs and assign them to partner 001.
AC:
- Status sync updates only merchant status fields for partner-linked MIDs; no officer/KPI/document syncing occurs anywhere in the status sync path.
- EMSProxy.get_merchants and LuqraProxy.get_merchants return list[DbMerchant] using mapping logic in integrations/*/mappings.py (raw EMS list accessible via get_merchants_raw).
- Master endpoint to link unlinked merchants only creates missing merchants from EMS/Luqra MIDs and assigns them to partner 001, with updated docs/descriptions.
- Jobs/routes use the new sync services and
- All affected tests/linters pass.
Notes
Add implementation notes, blockers, and context here
Related
Add wikilinks to related people, meetings, or other tickets