@tricoteuses/senat 2.20.1 → 2.20.3

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.
@@ -227,24 +227,35 @@ export function createActesLegislatifs(dossier) {
227
227
  ...texte,
228
228
  }));
229
229
  // Ajout étape -COM-FOND après chaque -DEPOT
230
- let textesWithComFond = [];
230
+ let acteLegislatifsLecture = [];
231
231
  for (let i = 0; i < textesWithCodeActe.length; i++) {
232
232
  const t = textesWithCodeActe[i];
233
- textesWithComFond.push(t);
234
- if (t.code_acte && t.code_acte.endsWith("-DEPOT")) {
235
- textesWithComFond.push({
233
+ acteLegislatifsLecture.push(t);
234
+ if (t.code_acte?.endsWith("-DEPOT") && t.type === "texte de loi") {
235
+ acteLegislatifsLecture.push({
236
236
  ...t,
237
237
  code_acte: t.code_acte.replace("-DEPOT", "-COM-FOND"),
238
238
  });
239
239
  }
240
240
  }
241
+ if (lectureAss["dates_seances"]?.length > 0) {
242
+ acteLegislatifsLecture.push({
243
+ session: lectureAss["session"],
244
+ type_lecture: lecture["type_lecture"],
245
+ libelle_lecture: "Discussion en séance publique",
246
+ code_acte: `${codeParent}-DEBATS-SEANCE`,
247
+ date: lectureAss["dates_seances"][0]?.["date"],
248
+ id: lectureAss["id"],
249
+ numero: lectureAss["numero"]
250
+ });
251
+ }
241
252
  const { textes, rapports, ...lectureAssWithoutTextes } = lectureAss;
242
253
  return {
243
254
  type_lecture: lecture["type_lecture"],
244
255
  ordre_lecture: lecture["ordre_lecture"],
245
256
  libelle_lecture: lecture["libelle"],
246
257
  code_acte: codeParent,
247
- actes_legislatifs: textesWithComFond,
258
+ actes_legislatifs: acteLegislatifsLecture,
248
259
  ...lectureAssWithoutTextes,
249
260
  };
250
261
  });
@@ -337,7 +348,8 @@ export function getCodeActeTexte(codeParent, texteOrigine) {
337
348
  texteOrigine === "transmis à l'Assemblée nationale" ||
338
349
  texteOrigine === "déposé à l'Assemblée nationale" ||
339
350
  texteOrigine === "transmis à l'Assemblée Nationale" ||
340
- texteOrigine === "déposé à l'Assemblée Nationale") {
351
+ texteOrigine === "déposé à l'Assemblée Nationale" ||
352
+ texteOrigine === "transmis en application de l'article 47-1, alinéa 2, de la Constitution") {
341
353
  return `${codeParent}-DEPOT`;
342
354
  }
343
355
  if (texteOrigine === "de la commission" ||
@@ -4,7 +4,7 @@ declare const findAllScrutinsQuery: import("kysely").SelectQueryBuilder<{
4
4
  [x: string]: any;
5
5
  [x: number]: any;
6
6
  [x: symbol]: any;
7
- }, "date_seance" | "lecass" | "lecture" | "scr" | "typlec", {
7
+ }, "date_seance" | "lecass" | "lecture" | "loi" | "scr" | "typlec", {
8
8
  [x: string]: any;
9
9
  }>;
10
10
  export declare function findAllScrutins(fromSession?: number): AsyncIterableIterator<{
@@ -78,12 +78,14 @@ const findAllScrutinsQuery = dbSenat
78
78
  .leftJoin("date_seance", "scr.code", "date_seance.code")
79
79
  .leftJoin("lecass", "date_seance.lecidt", "lecass.lecassidt")
80
80
  .leftJoin("lecture", "lecture.lecidt", "lecass.lecidt")
81
+ .leftJoin("loi", "loi.loicod", "lecture.loicod")
81
82
  .leftJoin("typlec", "typlec.typleccod", "lecture.typleccod")
82
83
  .select(({ eb, ref, val }) => [
83
84
  "scr.sesann as session",
84
85
  "scr.scrnum as numero",
85
86
  rtrim(ref("date_seance.lecidt")).as("lecture_id"),
86
87
  rtrim(ref("lecture.leccom")).as("lecture_libelle"),
88
+ "loi.signet as signet_dossier",
87
89
  rtrim(ref("typlec.typleclib")).as("type_lecture"),
88
90
  toDateString(ref("scr.scrdat")).as("date_scrutin"),
89
91
  toDateString(ref("scr.scrdateff")).as("date_scrutin_effective"),
@@ -1,4 +1,4 @@
1
- import { iterLoadSenatScrutins, iterLoadSenatAmendements } from "../loaders";
1
+ import { iterLoadSenatScrutins, iterLoadSenatAmendements, iterLoadSenatDossiersLegislatifs } from "../loaders";
2
2
  import commandLineArgs from "command-line-args";
3
3
  import { dataDirDefaultOption } from "./shared/cli_helpers";
4
4
  const optionsDefinitions = [dataDirDefaultOption];
@@ -11,3 +11,6 @@ for (const { item: scrutin } of iterLoadSenatScrutins(options["dataDir"], sessio
11
11
  for (const { item: amendement } of iterLoadSenatAmendements(options["dataDir"], session, { noValidation: noValidation })) {
12
12
  console.log(amendement["numero"]);
13
13
  }
14
+ for (const { item: dossierLegislatif } of iterLoadSenatDossiersLegislatifs(options["dataDir"], session, { noValidation: noValidation })) {
15
+ console.log(dossierLegislatif["numero"]);
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tricoteuses/senat",
3
- "version": "2.20.1",
3
+ "version": "2.20.3",
4
4
  "description": "Handle French Sénat's open data",
5
5
  "keywords": [
6
6
  "France",