• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

inclusion-numerique / coop-mediation-numerique / 4871e98e-f7f3-41a4-9570-0c4048921da6

01 Apr 2026 03:30PM UTC coverage: 6.869% (-3.8%) from 10.692%
4871e98e-f7f3-41a4-9570-0c4048921da6

Pull #468

circleci

marc-gavanier
feat(lieux-activite): extend visibility toggle to all mediateurs

- Rename cartography reference to "cartographie nationale des lieux
  d'inclusion numérique"
- Remove isConseillerNumerique condition for visibility toggle
- Simplify labels and add 24h update notice
Pull Request #468: feat(lieux-activite): extend visibility toggle to all mediateurs

470 of 10506 branches covered (4.47%)

Branch coverage included in aggregate %.

1355 of 16063 relevant lines covered (8.44%)

37.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/apps/web/src/features/structures/getStructuresEmployeusesOptions.ts
1
import { prismaClient } from '@app/web/prismaClient'
2

3
export type StructureEmployeuseOption = {
4
  id: string
5
  nom: string
6
  commune: string | null
7
}
8

9
export const getStructuresEmployeusesOptions = async ({
×
10
  mediateurIds,
11
}: {
12
  mediateurIds: string[]
13
}): Promise<StructureEmployeuseOption[]> => {
14
  if (mediateurIds.length === 0) return []
×
15

16
  const structures = await prismaClient.structure.findMany({
×
17
    where: {
18
      emplois: {
19
        some: {
20
          user: {
21
            mediateur: {
22
              id: { in: mediateurIds },
23
            },
24
          },
25
          suppression: null,
26
        },
27
      },
28
    },
29
    select: {
30
      id: true,
31
      nom: true,
32
      commune: true,
33
    },
34
    orderBy: { nom: 'asc' },
35
  })
36

37
  return structures
×
38
}
39

40
export const searchStructuresEmployeuses = async ({
×
41
  query,
42
  mediateurIds,
43
  excludeIds = [],
×
44
}: {
45
  query: string
46
  mediateurIds: string[]
47
  excludeIds?: string[]
48
}): Promise<{ items: StructureEmployeuseOption[] }> => {
49
  if (mediateurIds.length === 0) return { items: [] }
×
50

51
  const searchTerms = query.toLowerCase().trim()
×
52

53
  const structures = await prismaClient.structure.findMany({
×
54
    where: {
55
      AND: [
56
        {
57
          emplois: {
58
            some: {
59
              user: {
60
                mediateur: {
61
                  id: { in: mediateurIds },
62
                },
63
              },
64
              suppression: null,
65
            },
66
          },
67
        },
68
        {
69
          id: { notIn: excludeIds },
70
        },
71
        searchTerms
×
72
          ? {
73
              OR: [
74
                { nom: { contains: searchTerms, mode: 'insensitive' } },
75
                { commune: { contains: searchTerms, mode: 'insensitive' } },
76
              ],
77
            }
78
          : {},
79
      ],
80
    },
81
    select: {
82
      id: true,
83
      nom: true,
84
      commune: true,
85
    },
86
    orderBy: { nom: 'asc' },
87
    take: 20,
88
  })
89

90
  return { items: structures }
×
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc