// Helper to apply tenant (company) scoping in findAll methods function applyTenantScope(where, globalAccess, options) { const userCompany = options?.currentUser?.companies?.id || null; if (!globalAccess && userCompany) { where.companiesId = userCompany; } } module.exports = { applyTenantScope };