Skip to content

Instantly share code, notes, and snippets.

@Aliounesy
Aliounesy / 0035_sage_ledger_import.sql
Created April 30, 2026 20:46
CoaaS Sénégal — sage-ledger module (audit DAF UEMOA)
-- ═══════════════════════════════════════════════════════════════════════
-- Migration 0035 — Import grand livre Sage : mappings type pièces + idempotence
--
-- Pattern self-learning mappings (cf. memory/feedback_self_learning_mappings) :
-- chaque tenant a sa propre table de mappings (source_code → kind) éditable
-- via UI. CoaaS pré-remplit les conventions Sage Saari standards mais
-- l'utilisateur peut ajouter/modifier ses propres codes au fil des imports.
--
-- Pour traiter le grand livre auxiliaire client (qui mélange factures,
-- paiements, avoirs, annulations dans un seul export), on classifie chaque