From 96ef8ad5b3b22baf9b72b8072e07e0264fbce09d Mon Sep 17 00:00:00 2001 From: Sondre Jahrsengene Date: Fri, 16 Aug 2024 13:29:08 +0200 Subject: [PATCH] feat: add service context text templates to dantest --- .../DanTestServiceContextTextTemplate.cs | 78 +++++++++++++++++++ Dan.Core/Services/ServiceContextService.cs | 3 +- 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 Dan.Core/ServiceContextTexts/DanTestServiceContextTextTemplate.cs diff --git a/Dan.Core/ServiceContextTexts/DanTestServiceContextTextTemplate.cs b/Dan.Core/ServiceContextTexts/DanTestServiceContextTextTemplate.cs new file mode 100644 index 0000000..15aad41 --- /dev/null +++ b/Dan.Core/ServiceContextTexts/DanTestServiceContextTextTemplate.cs @@ -0,0 +1,78 @@ +using Dan.Common; +using Dan.Common.Interfaces; +using Dan.Common.Models; + +namespace Dan.Core.ServiceContextTexts; + +/// +/// All texts pertaining to the DAN-test service context +/// +public class DanTestServiceContextTextTemplate : IServiceContextTextTemplate +{ + public LocalizedString ConsentDelegationContexts => new() + { + En = $"In relation to a data.altinn.no test process {TextMacros.RequestorName} wants to get consent from you.", + NoNn = $"I forbindelse med en testprosess i data.altinn.no, ønskjer {TextMacros.RequestorName} å få samtykkje frå deg.", + NoNb = $"I forbindelse med en testprosess i data.altinn.no, ønsker {TextMacros.RequestorName} å få samtykke fra deg." + }; + + public LocalizedString CorrespondenceBody => new() + { + NoNb = $"For at {TextMacros.RequestorName} skal kunne gjennomføre testprosessen må det utstedes fullmakt for {TextMacros.SubjectName}." + }; + + public LocalizedString CorrespondenceSender => new() + { + NoNb = "DAN-test" + }; + + public LocalizedString CorrespondenceSummary => new() + { + NoNb = $"{TextMacros.RequestorName} har sendt en forespørsel om fullmakt for en testprosess." + }; + + public LocalizedString CorrespondenceTitle => new() + { + NoNb = $"{TextMacros.RequestorName} trenger fullmakt {TextMacros.ConsentReference}" + }; + + public LocalizedString EmailNotificationContent => new() + { + NoNb = $"Forespørselen gjelder testprosessen knyttet til {TextMacros.ConsentReference}." + }; + + public LocalizedString EmailNotificationSubject => new() + { + NoNb = $"{TextMacros.SubjectName} har mottatt en ny forespørsel om fullmakt fra {TextMacros.RequestorName} i Altinn" + }; + + + public LocalizedString SMSNotificationContent => new() + { + NoNb = $"{TextMacros.SubjectName} har mottatt en ny forespørsel om fullmakt fra {TextMacros.RequestorName} i Altinn" + }; + + + public LocalizedString ConsentButtonText => new() + { + NoNb = "Behandle forespørsel om fullmakt" + }; + + + public LocalizedString ConsentGivenReceiptText => new() + { + NoNb = $"Din fullmakt til {TextMacros.Requestor} {TextMacros.RequestorName} på vegne av {TextMacros.Subject} {TextMacros.SubjectName} er registrert som gitt." + }; + + public LocalizedString ConsentDeniedReceiptText => new() + { + NoNb = $"Fullmakt til {TextMacros.Requestor} {TextMacros.RequestorName} på vegne av {TextMacros.Subject} {TextMacros.SubjectName} er registrert som avslått." + }; + + + public LocalizedString ConsentTitleText => new() + { + NoNb = "Fullmakt" + }; + +} \ No newline at end of file diff --git a/Dan.Core/Services/ServiceContextService.cs b/Dan.Core/Services/ServiceContextService.cs index a37351a..b6a4c28 100644 --- a/Dan.Core/Services/ServiceContextService.cs +++ b/Dan.Core/Services/ServiceContextService.cs @@ -249,7 +249,8 @@ public async Task> GetRegisteredServiceContexts() AuthorizationRequirements = [ new MaskinportenScopeRequirement{RequiredScopes = ["dan:test"]} - ] + ], + ServiceContextTextTemplate = new DanTestServiceContextTextTemplate() } };