@tricoteuses/senat 2.20.4 → 2.20.5

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.
@@ -4,7 +4,7 @@ declare const findAllAmendementsQuery: import("kysely").SelectQueryBuilder<{
4
4
  [x: string]: any;
5
5
  [x: number]: any;
6
6
  [x: symbol]: any;
7
- }, "ameli.amd" | "ameli.sub" | "ameli.typsub" | "ameli.typrect" | "ameli.txt_ameli" | "ameli.etatxt" | "ameli.ses" | "ameli.typses" | "ameli.nat" | "ameli.lec_ameli" | "ameli.mot" | "ameli.avicom" | "ameli.avigvt" | "ameli.sor" | "ameli.irr" | "ameli.grppol_ameli" | "ameli.com_ameli" | "ameli.cab" | "dosleg.amescr", {
7
+ }, "ameli.amd" | "ameli.sub" | "ameli.typsub" | "ameli.typrect" | "ameli.txt_ameli" | "ameli.etatxt" | "ameli.ses" | "ameli.typses" | "ameli.nat" | "ameli.lec_ameli" | "dosleg.texte" | "dosleg.lecass" | "ameli.mot" | "ameli.avicom" | "ameli.avigvt" | "ameli.sor" | "ameli.irr" | "ameli.grppol_ameli" | "ameli.com_ameli" | "ameli.cab", {
8
8
  [x: string]: any;
9
9
  nature: string;
10
10
  date_depot: string;
@@ -12,6 +12,7 @@ declare const findAllAmendementsQuery: import("kysely").SelectQueryBuilder<{
12
12
  sort: any;
13
13
  url: string;
14
14
  auteur_est_gouvernement: boolean;
15
+ scrutin_num: any;
15
16
  auteurs: {
16
17
  prenom: any;
17
18
  homonyme: any;
@@ -33,6 +34,7 @@ export declare function findAllAmendements(fromSession?: number): AsyncIterableI
33
34
  sort: any;
34
35
  url: string;
35
36
  auteur_est_gouvernement: boolean;
37
+ scrutin_num: any;
36
38
  auteurs: {
37
39
  prenom: any;
38
40
  homonyme: any;
@@ -21,6 +21,16 @@ function auteurs(amendementId) {
21
21
  ])
22
22
  .orderBy("ameli.amdsen.rng", "asc"));
23
23
  }
24
+ function scrutin(amendementNum, sesann) {
25
+ return dbSenat
26
+ .selectFrom("dosleg.amescr")
27
+ .leftJoin("dosleg.scr", "dosleg.amescr.scrnum", "dosleg.scr.scrnum")
28
+ .where("dosleg.amescr.amescrnum", "=", amendementNum)
29
+ .where("dosleg.amescr.sesann", "=", sesann)
30
+ .select(["dosleg.amescr.scrnum as scrutin_num"])
31
+ .limit(1)
32
+ .as("scrutin_num");
33
+ }
24
34
  const findAllAmendementsQuery = dbSenat
25
35
  .selectFrom("ameli.amd")
26
36
  .leftJoin("ameli.sub", "ameli.amd.subid", "ameli.sub.id")
@@ -32,6 +42,8 @@ const findAllAmendementsQuery = dbSenat
32
42
  .leftJoin("ameli.typses", "ameli.typses.id", "ameli.ses.typid")
33
43
  .leftJoin("ameli.nat", "ameli.txt_ameli.natid", "ameli.nat.id")
34
44
  .leftJoin("ameli.lec_ameli", "ameli.txt_ameli.lecid", "ameli.lec_ameli.id")
45
+ .leftJoin("dosleg.texte", "ameli.txt_ameli.id", "dosleg.texte.texcod")
46
+ .leftJoin("dosleg.lecass", "dosleg.texte.lecassidt", "dosleg.lecass.lecassidt")
35
47
  .leftJoin("ameli.mot", "ameli.amd.motid", "ameli.mot.id")
36
48
  .leftJoin("ameli.avicom", "ameli.amd.avcid", "ameli.avicom.id")
37
49
  .leftJoin("ameli.avigvt", "ameli.amd.avgid", "ameli.avigvt.id")
@@ -40,7 +52,6 @@ const findAllAmendementsQuery = dbSenat
40
52
  .leftJoin("ameli.grppol_ameli", "ameli.amd.nomentid", "ameli.grppol_ameli.entid")
41
53
  .leftJoin("ameli.com_ameli", "ameli.amd.nomentid", "ameli.com_ameli.entid")
42
54
  .leftJoin("ameli.cab", "ameli.amd.nomentid", "ameli.cab.entid")
43
- .leftJoin("dosleg.amescr", "ameli.amd.num", "dosleg.amescr.amescrnum")
44
55
  .select(({ eb, ref, val }) => [
45
56
  "ameli.ses.ann as session",
46
57
  "ameli.ses.lil as session_libelle",
@@ -74,7 +85,7 @@ const findAllAmendementsQuery = dbSenat
74
85
  "ameli.amd.numabs as numero_absolu",
75
86
  "ameli.amd.ord as ordre",
76
87
  "ameli.amd.accgou as accepte_gouvernement",
77
- "dosleg.amescr.scrnum as scrutin_id",
88
+ "ameli.amd.txtid as texte_id",
78
89
  "ameli.sub.lib as subdivision_libelle",
79
90
  "ameli.sub.lic as subdivision_libelle_court",
80
91
  "ameli.sub.pos as subdivision_position_texte",
@@ -115,6 +126,7 @@ const findAllAmendementsQuery = dbSenat
115
126
  "ameli.grppol_ameli.lilcou as au_nom_de_groupe_politique",
116
127
  "ameli.com_ameli.lil as au_nom_de_commission",
117
128
  eb.case().when("ameli.cab.entid", "is not", null).then(true).else(false).end().as("auteur_est_gouvernement"),
129
+ scrutin(ref("ameli.amd.num"), ref("ameli.ses.ann")),
118
130
  auteurs(ref("ameli.amd.id")).as("auteurs"),
119
131
  ]);
120
132
  export function findAllAmendements(fromSession) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tricoteuses/senat",
3
- "version": "2.20.4",
3
+ "version": "2.20.5",
4
4
  "description": "Handle French Sénat's open data",
5
5
  "keywords": [
6
6
  "France",