Skip to content

Commit

Permalink
Merge pull request #116 from lblod/feat/agendapoint-numbers
Browse files Browse the repository at this point in the history
Add agendapoint number to the output of treatment extracts
  • Loading branch information
piemonkey authored Oct 30, 2024
2 parents ce95238 + c01f198 commit 4cf6dd6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
3 changes: 3 additions & 0 deletions models/treatment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { query, sparqlEscapeString, sparqlEscapeUri } from 'mu';
import Attachment from './attachment';

export default class Treatment {
/** @returns {Promise<Treatment[]>} */
static async findAll({ meetingUuid }) {
const queryString = `
${prefixMap.get('besluit').toSparqlString()}
Expand Down Expand Up @@ -55,6 +56,7 @@ export default class Treatment {
}
}

/** @returns {Promise<Treatment>} */
static async findUri(uri) {
const queryString = `
${prefixMap.get('besluit').toSparqlString()}
Expand Down Expand Up @@ -102,6 +104,7 @@ export default class Treatment {
}
}

/** @returns {Promise<Treatment>} */
static async find(treatmentUuid) {
const queryString = `
${prefixMap.get('besluit').toSparqlString()}
Expand Down
21 changes: 17 additions & 4 deletions support/extract-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ import validateMeeting from './validate-meeting';
import validateTreatment from './validate-treatment';
import VersionedExtract from '../models/versioned-behandeling';
import { handleVersionedResource } from './pre-importer';
import { DOCUMENT_PUBLISHED_STATUS, IS_FINAL } from './constants';
import { DOCUMENT_PUBLISHED_STATUS, IS_FINAL, IS_PREVIEW } from './constants';

// This file contains helpers for exporting, signing and publishing an extract of the meeting notes
// an extract is the treatment of one agendapoint and all it's related info

/**
* This file contains helpers for exporting, signing and publishing an extract of the meeting notes
* an extract is the treatment of one agendapoint and all it's related info
* @param {Treatment} treatment
* @param {Meeting} meeting
* @param {string[]} meetingErrors
* @param {*} participantCache
*/

async function buildExtractForTreatment(
treatment,
meeting,
Expand All @@ -34,6 +38,7 @@ async function buildExtractForTreatment(
const data = await buildExtractDataForTreatment(
treatment,
meeting,
IS_PREVIEW,
true,
participantCache
);
Expand Down Expand Up @@ -88,6 +93,13 @@ export async function buildExtractData(
);
}

/**
* @param {Treatment} treatment
* @param {Meeting} meeting
* @param {string} previewType
* @param {boolean} [isPublic=true]
* @param {any} [participantCache=null]
*/
export async function buildExtractDataForTreatment(
treatment,
meeting,
Expand Down Expand Up @@ -138,6 +150,7 @@ export async function buildExtractDataForTreatment(
participationList,
votes,
content,
articleNumber: Number(treatment.position) + 1,
};
}

Expand Down
13 changes: 8 additions & 5 deletions support/templates/partials/treatment.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
<span class="au-c-template-private">Besloten behandeling van agendapunt</span>
{{/if}}
</p>
<h3 resource="{{this.treatment.agendapoint}}" property="dc:subject">
<span property="dc:title">{{this.agendapoint.title}}</span>
{{#if this.agendapoint.type}}
(<span property="besluit:Agendapunt.type" resource="{{this.agendapoint.type}}" typeof="skos:Concept">{{this.agendapoint.typeName}}</span>)
{{/if}}
<h3>
{{articleNumber}}.&ensp;<span
resource="{{this.treatment.agendapoint}}" property="dc:subject">
<span property="dc:title">{{this.agendapoint.title}}</span>
{{#if this.agendapoint.type}}
(<span property="besluit:Agendapunt.type" resource="{{this.agendapoint.type}}" typeof="skos:Concept">{{this.agendapoint.typeName}}</span>)
{{/if}}
</span>
</h3>
{{#if this.participationList}}
<h4>Aanwezigen bij agendapunt</h4>
Expand Down

0 comments on commit 4cf6dd6

Please sign in to comment.