Skip to content
Snippets Groups Projects
Commit 3ba9964a authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Add columns for years, PJL IDs & Amendement IDs.

parent 097760a5
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@ async function main() {
Legislature.Quinze,
)
const rows = []
const columns = new Set<string>(["text"])
const columns = new Set<string>(["text", "texteLegislatifUid", "uid", "year"])
for (const amendement of Object.values(amendementByUid)) {
const { corps, cycleDeVie, texteLegislatifRef, uid } = amendement
const document = documentByUid[texteLegislatifRef]
......@@ -104,10 +104,11 @@ async function main() {
for (const link of links) {
for (const flattenedReferences of iterFlattenedReferences(link.tree)) {
const countByType = new Map<ReferenceType, number>()
const row: { [name: string]: Reference | string } = {
const row: { [name: string]: Reference | string | undefined } = {
text: link.text,
texteLegislatifUid: texteLegislatifRef,
uid,
text: link.text,
year: cycleDeVie.dateSort?.getFullYear().toString(),
}
for (const reference of flattenedReferences) {
assert(reference.type.endsWith("-reference"))
......
......@@ -128,7 +128,7 @@ async function main() {
Legislature.Quinze,
)
const rows = []
const columns = new Set<string>(["text"])
const columns = new Set<string>(["text", "texteLegislatifUid", "uid", "year"])
for (const amendement of Object.values(amendementByUid)) {
const { corps, cycleDeVie, texteLegislatifRef, uid } = amendement
if (!documentsLegislatifsUid.has(texteLegislatifRef)) {
......@@ -151,10 +151,11 @@ async function main() {
for (const link of links) {
for (const flattenedReferences of iterFlattenedReferences(link.tree)) {
const countByType = new Map<ReferenceType, number>()
const row: { [name: string]: Reference | string } = {
const row: { [name: string]: Reference | string | undefined } = {
text: link.text,
texteLegislatifUid: texteLegislatifRef,
uid,
text: link.text,
year: cycleDeVie.dateSort?.getFullYear().toString(),
}
for (const reference of flattenedReferences) {
assert(reference.type.endsWith("-reference"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment