@tricoteuses/senat 2.22.11 → 2.22.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,6 +54,24 @@ declare const findAllQuery: import("kysely").SelectQueryBuilder<{
54
54
  date_fin: string;
55
55
  libelle: unknown;
56
56
  }[];
57
+ points_contact: {
58
+ [x: string]: any;
59
+ adresses: {
60
+ numero_voie: any;
61
+ nom_voie: any;
62
+ complement: any;
63
+ complement2: any;
64
+ code_postal: any;
65
+ commune: any;
66
+ code_cedex: any;
67
+ libelle_cedex: any;
68
+ bureau_distributeur: any;
69
+ }[];
70
+ telephones: {
71
+ type: any;
72
+ numero: any;
73
+ }[];
74
+ }[];
57
75
  }>;
58
76
  declare const findAllCirconscriptionsQuery: import("kysely").SelectQueryBuilder<{
59
77
  [x: string]: any;
@@ -124,6 +142,24 @@ export declare function findAll(): AsyncIterableIterator<{
124
142
  date_fin: string;
125
143
  libelle: unknown;
126
144
  }[];
145
+ points_contact: {
146
+ [x: string]: any;
147
+ adresses: {
148
+ numero_voie: any;
149
+ nom_voie: any;
150
+ complement: any;
151
+ complement2: any;
152
+ code_postal: any;
153
+ commune: any;
154
+ code_cedex: any;
155
+ libelle_cedex: any;
156
+ bureau_distributeur: any;
157
+ }[];
158
+ telephones: {
159
+ type: any;
160
+ numero: any;
161
+ }[];
162
+ }[];
127
163
  }>;
128
164
  export declare function findAllCirconscriptions(): AsyncIterableIterator<{
129
165
  [x: string]: any;
@@ -290,14 +290,44 @@ function mandatsMinistre(senMat) {
290
290
  .where("minind.senmat", "=", senMat)
291
291
  .orderBy("minind.mindatdeb", "desc"));
292
292
  }
293
- function contacts(senMat) {
293
+ function adressesPoicon(poiconId) {
294
+ return jsonArrayFrom(dbSenat
295
+ .withSchema("sens")
296
+ .selectFrom("adresse")
297
+ .where("adresse.poiconid", "=", poiconId)
298
+ .select([
299
+ "adresse.adrnumvoi as numero_voie",
300
+ "adresse.adrnomvoi as nom_voie",
301
+ "adresse.adrcmp as complement",
302
+ "adresse.adrcmp2 as complement2",
303
+ "adresse.adrcodpos as code_postal",
304
+ "adresse.adrcom as commune",
305
+ "adresse.adrcdxcod as code_cedex",
306
+ "adresse.adrcdxlib as libelle_cedex",
307
+ "adresse.adrburdis as bureau_distributeur",
308
+ ])
309
+ .orderBy("adresse.adrnumtri", "asc"));
310
+ }
311
+ function telephonesPoicon(poiconId) {
312
+ return jsonArrayFrom(dbSenat
313
+ .withSchema("sens")
314
+ .selectFrom("telephone")
315
+ .where("telephone.poiconid", "=", poiconId)
316
+ .select(["telephone.typtelcod as type", "telephone.telnum as numero"])
317
+ .orderBy("telephone.telnumtri", "asc"));
318
+ }
319
+ function pointsContact(senMat) {
294
320
  return jsonArrayFrom(dbSenat
295
321
  .withSchema("sens")
296
322
  .selectFrom("poicon")
297
- .leftJoin("adresse", "poicon.poiconid", "adresse.poiconid")
298
- .leftJoin("mel", "poicon.poiconid", "mel.poiconid")
299
- .leftJoin("telephone", "poicon.poiconid", "telephone.poiconid")
300
323
  .where("poicon.senmat", "=", senMat)
324
+ .select(({ ref }) => [
325
+ "poicon.poiconid as id",
326
+ "poicon.typpoiconcod as type",
327
+ "poicon.poiconlib as libelle",
328
+ adressesPoicon(ref("poicon.poiconid")).as("adresses"),
329
+ telephonesPoicon(ref("poicon.poiconid")).as("telephones"),
330
+ ])
301
331
  .orderBy("poicon.poiconnumtri", "asc"));
302
332
  }
303
333
  function urls(senMat) {
@@ -347,6 +377,7 @@ const findAllQuery = dbSenat
347
377
  mandatsMembreDelegation(ref("sen.senmat")).as("delegations"),
348
378
  mandatsMembreGroupePolitique(ref("sen.senmat")).as("groupes"),
349
379
  fonctionsBureau(ref("sen.senmat")).as("fonctions_bureau"),
380
+ pointsContact(ref("sen.senmat")).as("points_contact"),
350
381
  ]);
351
382
  const findAllCirconscriptionsQuery = dbSenat
352
383
  .withSchema("sens")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tricoteuses/senat",
3
- "version": "2.22.11",
3
+ "version": "2.22.12",
4
4
  "description": "Handle French Sénat's open data",
5
5
  "keywords": [
6
6
  "France",