Altinn / altinn-studio

Next generation open source Altinn platform and applications.
https://docs.altinn.studio
BSD 3-Clause "New" or "Revised" License
109 stars 73 forks source link

Support "paymentReceiptPdfDataType" when adding Payment Task #13020

Open framitdavid opened 5 days ago

framitdavid commented 5 days ago

User Story: As a user, I want to be able to add a payment step where Studio automatically configures the process file and applicationmetadata with the correct payment settings.

Reference: Issue from @Altinn/team-apps Altinn Studio Docs #1696.

We need to introduce support for a new data type named paymentReceiptPdfDataType. This data type will be used to store the PDF receipt for payments.

Current configuration in process.bpmn

<altinn:paymentConfig>
   <altinn:paymentDataType>paymentInformation-7aH7</altinn:paymentDataType>
</altinn:paymentConfig>

New and required configuration in process.bpmn We need to extend this configuration to include the new data type after a payment task is added, resulting in the following:

<altinn:paymentConfig>
   <altinn:paymentDataType>paymentInformation-7aH7</altinn:paymentDataType>  
   <altinn:paymentReceiptPdfDataType>paymentReceiptPdf</altinn:paymentReceiptPdfDataType>
</altinn:paymentConfig>

Note: The value of paymentReceiptPdfDataType can be anything, but it needs to match the "id" property within dataTypes array in App/config/applicationmetadata.json

Changes needed in applicaitonmetadata.json App/config/applicaitonmetadata.json should result in the following:

{
    "id": "paymentReceiptPdf",
    "allowedContentTypes": [
        "application/pdf"
    ],
    "maxCount": 1,
    "minCount": 0,
}