Skip to content

feat: add title page to generated pdf#150

Open
MailineN wants to merge 7 commits intomainfrom
feat/add-title-page
Open

feat: add title page to generated pdf#150
MailineN wants to merge 7 commits intomainfrom
feat/add-title-page

Conversation

@MailineN
Copy link
Contributor

@MailineN MailineN commented Feb 9, 2026

No description provided.

@MailineN MailineN requested a review from laurentC35 February 9, 2026 14:43
@MailineN MailineN marked this pull request as ready for review February 12, 2026 09:47
@MailineN MailineN requested a review from RemiVerriez February 12, 2026 09:48
@sonarqubecloud
Copy link

type Props = {
source: LunaticSource;
data: LunaticData;
data: PdfRequestFromBody;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A retirer, laisser les lunaticData et ajouter un autre paramètre interrogationInfos ou renommer en objet "interrogation" pour plus de clarté. (cf ma remarque sur generateStream)

Donc par exemple, typer comme ceci

type Props = {
   source: LunaticSource,
   data: LunaticData,
   interrogationInfo: InterrogationInfo
}

const data = data;
const surveyTitle = InterrogationInfo.collectionInstrumentId;
const usualSurveyUnitId = InterrogationInfo.usualSurveyUnitId;
const validationDate = InterrogationInfo.validationDate;

// avec InterrogationInfo un nouveau type comprenant tous l'objet interrogation (mais sans data)


/************************************************************************************************/


// ou bien
type Props = {
   source: LunaticSource,
   interrogation: Interrogation,
}

const data = interrogation.data;
const surveyTitle = interrogation.collectionInstrumentId;
const usualSurveyUnitId = interrogation.usualSurveyUnitId;
const validationDate = interrogation.validationDate;

A choisir entre les 2.

Mais, remarque plus générale, à ce niveau de couche logiciel, on préfère être indépendant des objet de type "requêtes" http, qui est une couche plus haut.

const data = readAndValidateLunaticData(res, interrogationData);
logger.info(`generate PDF with params: ${JSON.stringify(requestBody.interrogation)}`)
const data = readAndValidateLunaticData(res, requestBody.interrogation.data);
await generatePdfStream(res, source, data);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapter la méthode generatePdfStream

generatePdfStream(res, source, data, interrogationInfos)

// ou
generatePdfStream(res, source, interrogation)

Car data (renvoyé par const data = readAndValidateLunaticData(res, requestBody.interrogation.data); contient uniquement les données Lunatic (LunaticData)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments