diff --git a/server/db.ts b/server/db.ts index 1ce044a..9a714c7 100644 --- a/server/db.ts +++ b/server/db.ts @@ -566,10 +566,10 @@ export async function upsertImportSettings(data: InsertImportSettings): Promise< // ============= DEPARTMENT LIST OPERATIONS ============= -export async function getDepartmentsByUser(userId: number): Promise { +export async function getDepartmentsByUser(_userId?: number): Promise { const db = await getDb(); if (!db) return []; - return await db.select().from(departmentList).where(eq(departmentList.userId, userId)).orderBy(departmentList.name); + return await db.select().from(departmentList).orderBy(departmentList.name); } export async function createDepartment(data: InsertDepartment): Promise { @@ -587,10 +587,10 @@ export async function deleteDepartment(id: number): Promise { // ============= ACCOUNTING ALLOCATION LIST OPERATIONS ============= -export async function getAccountingAllocationsByUser(userId: number): Promise { +export async function getAccountingAllocationsByUser(_userId?: number): Promise { const db = await getDb(); if (!db) return []; - return await db.select().from(accountingAllocationList).where(eq(accountingAllocationList.userId, userId)).orderBy(accountingAllocationList.name); + return await db.select().from(accountingAllocationList).orderBy(accountingAllocationList.name); } export async function createAccountingAllocation(data: InsertAccountingAllocation): Promise { @@ -742,10 +742,10 @@ export async function initializeDefaultLlmFields(userId: number): Promise // ============= SIGNATURES HELPERS ============= -export async function getSignaturesByUser(userId: number): Promise { +export async function getSignaturesByUser(_userId?: number): Promise { const db = await getDb(); if (!db) return []; - return db.select().from(signatures).where(eq(signatures.userId, userId)); + return db.select().from(signatures); } export async function getSignatureById(id: number): Promise { @@ -773,10 +773,10 @@ export async function deleteSignature(id: number): Promise { // ============= SERVICE SIGNATURES HELPERS ============= -export async function getServiceSignaturesByUser(userId: number): Promise { +export async function getServiceSignaturesByUser(_userId?: number): Promise { const db = await getDb(); if (!db) return []; - return db.select().from(serviceSignatures).where(eq(serviceSignatures.userId, userId)); + return db.select().from(serviceSignatures); } export async function getServiceSignatureByService(userId: number, serviceName: string): Promise { diff --git a/todo.md b/todo.md index 21b34a6..bf9084e 100644 --- a/todo.md +++ b/todo.md @@ -675,3 +675,12 @@ - [x] Enregistrer importSource="folder" lors d'un import par dossier (folderImportService.ts) - [x] Afficher la colonne "Source" avec badge coloré dans le tableau History.tsx (Email=bleu, Dossier=violet, Fichier=gris) - [x] Afficher la source dans le dialog de détails de l'import + +## Listes globales partagées entre tous les utilisateurs +- [ ] Modifier getAccountingAllocationsByUser → retourner toutes les ventilations (sans filtre userId) +- [ ] Modifier getAutomationRulesByUser → retourner tous les automatismes (sans filtre userId) +- [ ] Modifier getDepartmentsByUser → retourner tous les services (sans filtre userId) +- [ ] Modifier getSignaturesByUser → retourner toutes les signatures (sans filtre userId) +- [ ] Modifier getServiceSignaturesByUser → retourner toutes les signatures de service (sans filtre userId) +- [ ] Migrer les données en production : dédoublonner les listes fusionnées +- [ ] Déployer en production