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

inclusion-numerique / coop-mediation-numerique / 47cb785b-2be5-4a4c-86d4-892337ee6d22

21 May 2026 12:12PM UTC coverage: 6.955% (-3.7%) from 10.646%
47cb785b-2be5-4a4c-86d4-892337ee6d22

push

circleci

web-flow
MEP 2026-05-21

469 of 10876 branches covered (4.31%)

Branch coverage included in aggregate %.

0 of 1486 new or added lines in 32 files covered. (0.0%)

1334 existing lines in 141 files now uncovered.

1466 of 16944 relevant lines covered (8.65%)

35.41 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

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

UNCOV
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

UNCOV
37
  return structures
×
38
}
39

UNCOV
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