Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIN-3679 Add IPA code to contract PDF #244

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/resources/agreementTemplate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ <h1>Richiesta di fruizione</h1>
In data <strong>${todayDate}</strong> alle ore <strong>${todayTime}</strong>, l’Infrastruttura ha ricevuto la
richiesta di fruizione contraddistinta da id <strong>${agreementId}</strong> (di seguito “Richiesta di Fruizione”),
inviata dall’aderente
<strong>${consumerName}</strong> (di seguito “Fruitore”), tramite l’operatore amministrativo
<strong>${consumerText}</strong> (di seguito “Fruitore”), tramite l’operatore amministrativo
<strong>${submitter}</strong>,
per l’E-service <strong>${eServiceName}</strong> reso disponibile dall’aderente <strong>${producerName}</strong>
per l’E-service <strong>${eServiceName}</strong> reso disponibile dall’aderente <strong>${producerText}</strong>
(di seguito “Erogatore”) di cui il Fruitore soddisfa i seguenti requisiti di fruizione per lo stesso previsti
dall’Erogatore.
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ final class AgreementContractCreator(
agreementId = agreement.id,
eService = eService.name,
producerName = producer.name,
producerOrigin = producer.externalId.origin,
producerIPACode = producer.externalId.value,
consumerName = consumer.name,
consumerOrigin = consumer.externalId.origin,
consumerIPACode = consumer.externalId.value,
certified = certified,
declared = declared,
verified = verified,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ object PDFCreator extends PDFCreator with PDFManager {
"activationTime" -> activationTime,
"activator" -> pdfPayload.activator,
"eServiceName" -> pdfPayload.eService,
"producerName" -> pdfPayload.producerName,
"consumerName" -> pdfPayload.consumerName
"producerText" -> getTenantText(pdfPayload.producerName, pdfPayload.producerOrigin, pdfPayload.producerIPACode),
"consumerText" -> getTenantText(pdfPayload.consumerName, pdfPayload.consumerOrigin, pdfPayload.consumerIPACode)
)
}

private def getTenantText(name: String, origin: String, value: String): String = {
if (origin == "IPA")
s"$name (codice IPA: ${value})"
else name
}

private def getDeclaredAttributesText(declared: Seq[(ClientAttribute, PersistentDeclaredAttribute)]): String =
declared.map { case (clientAttribute, tenantAttribute) =>
val date = getDateText(tenantAttribute.assignmentTimestamp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ final case class PDFPayload(
agreementId: UUID,
eService: String,
producerName: String,
producerOrigin: String,
producerIPACode: String,
consumerName: String,
consumerOrigin: String,
consumerIPACode: String,
certified: Seq[(ClientAttribute, PersistentCertifiedAttribute)],
declared: Seq[(ClientAttribute, PersistentDeclaredAttribute)],
verified: Seq[(ClientAttribute, PersistentVerifiedAttribute)],
Expand Down
Loading