Skip to content

Commit

Permalink
PIN-3679 Resolved PR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nttdata-rtorsoli committed Jul 26, 2023
1 parent df7fe77 commit 406c832
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
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} (codice IPA: ${consumerValue}) </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} (codice IPA: ${producerValue})</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,9 +157,11 @@ final class AgreementContractCreator(
agreementId = agreement.id,
eService = eService.name,
producerName = producer.name,
producerValue = producer.externalId.value,
producerOrigin = producer.externalId.origin,
producerIPACode = producer.externalId.value,
consumerName = consumer.name,
consumerValue = consumer.externalId.value,
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,13 +65,17 @@ object PDFCreator extends PDFCreator with PDFManager {
"activationTime" -> activationTime,
"activator" -> pdfPayload.activator,
"eServiceName" -> pdfPayload.eService,
"producerName" -> pdfPayload.producerName,
"producerValue" -> pdfPayload.producerValue,
"consumerName" -> pdfPayload.consumerName,
"consumerValue" -> pdfPayload.consumerValue
"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,9 +15,11 @@ final case class PDFPayload(
agreementId: UUID,
eService: String,
producerName: String,
producerOrigin: String,
producerIPACode: String,
consumerName: String,
producerValue: String,
consumerValue: String,
consumerOrigin: String,
consumerIPACode: String,
certified: Seq[(ClientAttribute, PersistentCertifiedAttribute)],
declared: Seq[(ClientAttribute, PersistentDeclaredAttribute)],
verified: Seq[(ClientAttribute, PersistentVerifiedAttribute)],
Expand Down

0 comments on commit 406c832

Please sign in to comment.