Compare commits

280 Commits

Author SHA1 Message Date
OlgunR
4d34eb7adc Funktion zur Behebung der Rotation - Class EnvelopeEditorController, Class FixPageRotation 2025-04-22 10:26:03 +02:00
Developer01
7481691b4e MS 2025-04-07 15:00:48 +02:00
Developer01
0d635830f9 MS Merge 2025-04-07 14:57:30 +02:00
Developer01
9b72a7b472 MS Update DocumentViewer 2025-04-07 14:55:48 +02:00
Developer 02
ea09edbc7f chore: Hinzufügen von Infrastruktur- und Präsentationsprojekten zur Lösung
- Einführung der neuen Projekte "Infrastruktur" und "Präsentation" mit ihren jeweiligen GUIDs.
- Die Projektkonfiguration wurde aktualisiert und enthält nun eine „Release“-Einstellung für das angegebene Projekt.
- Angepasste verschachtelte Projektbeziehungen, um die neuen Projekte einzubeziehen.
2025-03-31 11:48:11 +02:00
Developer 02
bd150bf0c0 chore: Aktualisiert auf 3.1.1 2025-03-31 10:31:16 +02:00
Developer 02
4a53e24618 refacto(DocumentStatusDto): Eigenschaft-Value veränderbar gemacht 2025-03-28 15:14:45 +01:00
Developer 02
7c969c8950 ignore annotations.json for bug fix 2025-03-28 15:12:26 +01:00
Developer 02
77831592f9 ignore bug fix test 2025-03-28 15:07:56 +01:00
Developer 02
55290c93e7 feat(mock): Unterstützung für echte Datenbankkonfiguration hinzugefügt
- Parameter `useRealDb` zur Methode `CreateHost` hinzugefügt, um zwischen In-Memory- und echter Datenbank zu wechseln.
- `Microsoft.EntityFrameworkCore` für die Datenbankkonfiguration integriert.
- SQL Server-Verbindung konfiguriert, wenn `useRealDb` auf `true` gesetzt ist, ansonsten wird standardmäßig eine In-Memory-Datenbank verwendet.
2025-03-28 14:08:38 +01:00
Developer 02
77713997bf refactor(DIExtensions): Option zum Hinzufügen von db-Kontext über dbContextOptions-Eingang hinzugefügt 2025-03-28 13:42:49 +01:00
Developer 02
8824bfef00 refactor(DocumentStatusServiceTests): Service-Verzeichnis verschieben. 2025-03-28 13:29:09 +01:00
Developer 02
cc6b4e63a9 feat(Mock): Erstellt, um gefälschte Daten zu erzeugen.
- Methode zur Erstellung eines gefälschten Hosts hinzugefügt.
2025-03-28 13:14:30 +01:00
Developer 02
99f7a5ee43 refactor(EnvelopeGenerator.Tests): umbenannt in EnvelopeGenerator.Tests.Application 2025-03-28 11:45:48 +01:00
Developer 02
b566785668 chore(EnvelopeGenerator.Tests): Fügen Sie das Paket Microsoft.Extensions.DependencyInjection.Abstractions entsprechend der Framework-Version hinzu 2025-03-28 11:40:31 +01:00
Developer 02
0e0f3f412d feat(DocumentStatusServiceTests): initalisiert 2025-03-28 11:27:35 +01:00
Developer 02
f8920a573b feat(EnvelopeGenerator.Test): Erstellt, um Einheitstest von Projekten zu behandeln 2025-03-28 10:57:19 +01:00
Developer 02
cc07a65f09 refactor(Service): Unnötige Importe entfernen 2025-03-28 10:25:25 +01:00
Developer 02
fbba7f2bfc refactor(EnvelopeGenerator.BBTests): Hinzufügen des Nuget-Pakets DigitalData.Controls.DocumentViewer 2025-03-28 10:23:52 +01:00
Developer 02
ba392eb128 Fix: Konflikte beim Zusammenführen 2025-03-28 10:12:07 +01:00
Developer 02
e4906ad9be refactor(EnvelopeGenerator.Test): Umbenennung von EnvelopeGenerator.BBTests 2025-03-28 10:05:54 +01:00
Developer 02
98773eb888 chore: Projekte sind in zwei separate Lösungsdateien unterteilt, „src“ und „tests“. 2025-03-28 09:54:04 +01:00
Developer 02
943481da80 refactor(Core): in Kleinbuchstaben umgewandelt 2025-03-28 09:46:26 +01:00
Developer01
b5579a68cd Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-03-27 17:16:59 +01:00
Developer01
fb069d0ee2 MS 2025-03-27 17:16:50 +01:00
Developer 02
559c4b6340 chore: Aufgerüstet auf 3.1.0 2025-03-27 16:47:12 +01:00
Developer 02
891436ceef refactor(frmFinalizePDF): _ignoredLabels „Position“, „Stellung“ hinzufügen 2025-03-27 16:19:57 +01:00
Developer 02
88777e0c27 refactor(Config): Standardliste IgnoredLabels aktualisieren 2025-03-27 14:01:33 +01:00
Developer 02
7eb8ae6697 Merge branch 'master' into feat/position 2025-03-26 15:10:57 +01:00
Developer01
deda2480b0 MS EG.Test Baget Refresh 2025-03-26 15:10:11 +01:00
Developer01
269be5109c MS Form Baget References 2025-03-26 14:59:28 +01:00
Developer01
3b40a889a3 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-03-26 14:41:08 +01:00
Developer01
5b60326fbe MS Common GDPicture Update, Baget Integration 2025-03-26 14:40:52 +01:00
Developer 02
6083eea496 refactor(frmFinalizePDF): Aktualisiert, um die Datei aus der DB zu lesen 2025-03-26 13:55:24 +01:00
Developer 02
88c2721ba5 refactor(appsettings): bearbeitete Größenparameter der annotations 2025-03-26 10:55:46 +01:00
Developer 02
db5a2a8640 feat(AnnotationParams): Hinzufügen der Eigenschaft AnnotationDictionary, um Anmerkungen in Form eines Wörterbuchs zu speichern. 2025-03-26 10:42:34 +01:00
Developer 02
fb0022bd2c fix(annotation): Die klassenbasierte Struktur wurde entfernt und die Methode createSignature in die Methode createAnnotations integriert. 2025-03-26 10:15:05 +01:00
Developer 02
c45e6875d0 feat(postion): Hinzufügen und Konfigurieren von Positions- und Positionsbeschriftungsannotationen. 2025-03-25 17:13:51 +01:00
Developer 02
0f855158c3 fix(annotation.js): Unnötige Variablen entfernen. 2025-03-24 13:19:59 +01:00
Developer 02
e9cb49c6a7 feat(annotation.js): Konfigurierte Beschriftungen 2025-03-24 12:48:28 +01:00
Developer 02
9ae1efb946 refactor(network): Die Methode getAnnotationParams wurde aktualisiert, um die Anmerkung übersetzen und das Verhältnis ihrer Größe ändern zu können. 2025-03-24 10:24:35 +01:00
Developer 02
eef6bf27f1 feat(ConfigController): GetAnnotationParams aktualisiert, um Wörterbuch zu senden 2025-03-21 16:14:31 +01:00
Developer 02
2dfe508552 feat(network.js): Methode zum Abrufen von Anmerkungsparametern hinzugefügt 2025-03-21 15:39:24 +01:00
Developer 02
a7b980bd28 refactor(Annotation): Aktualisiert, um null anstelle von Standard zu verwenden 2025-03-21 14:13:49 +01:00
Developer 02
2d7c0a292b feat(appsettings): Konfigurierte AnnotationParams 2025-03-21 13:11:54 +01:00
Developer 02
91f1296e9b Revert "feat(ClientCoefficient): Erstellt, um die Dimensionen für den Kunden bis zu einem gewissen Grad zu erhöhen"
This reverts commit 80e1e7dcf3.
2025-03-21 12:29:39 +01:00
Developer 02
80e1e7dcf3 feat(ClientCoefficient): Erstellt, um die Dimensionen für den Kunden bis zu einem gewissen Grad zu erhöhen 2025-03-21 12:01:42 +01:00
Developer 02
eb024acfa7 featAnnotation): Hinzufügen von Verhältnisanteilen, um die Konfiguration über das Verhältnis zu ermöglichen 2025-03-20 17:16:42 +01:00
Developer 02
210ce072f8 refactor(AnnotationParams): vereinfacht 2025-03-20 17:01:13 +01:00
Developer 02
036e1f68a8 refactor(Annotation): Default.set hinzugefügt, um Standardwerte zu setzen 2025-03-20 16:48:42 +01:00
Developer 02
0b87a3746a fix(Annotation): Aktualisiert, um MarginLeft und Top bei der Berechnung von HorBoundary und VerBoundary zu berücksichtigen 2025-03-20 15:52:21 +01:00
Developer 02
db84abf0e7 feat(Anmerkung): JsonIgnore-Attribut für nicht-clientbezogene Entitäten hinzugefügt 2025-03-20 14:58:41 +01:00
Developer 02
14be46d3d6 refactor(Annotation): Umbenennen von left in marginLeft, top in marginTop, posX in Left und posY in top für eine CSS-ähnlichere Benennung 2025-03-20 14:56:36 +01:00
Developer 02
78b5e3f5cc feat(Annotations): Konvertiere _annots von Dictionary zu IEnumerable.
- Zugehörige Index- und TryGet-Methoden hinzugefügt.
2025-03-20 14:44:57 +01:00
Developer 02
093e64de81 feat(Annotation): Hinzufügen der Eigenschaft Name 2025-03-20 14:27:58 +01:00
Developer 02
43db4e275b fix(Annotation): JsonIgnore-Attribut zu HorBoundAnnot und VerBoundAnnot hinzufügen 2025-03-20 12:46:57 +01:00
Developer 02
353f7698f4 feat(ConfigController): Erstellt, um Webanwendungen über den Server zu konfigurieren.
- GetAnnotationParams Endpunkt hinzufügen, um Annotationsdaten zu senden
2025-03-20 11:50:59 +01:00
Developer 02
d5b4ea46d3 feat(DefaultAnnotation): Hinzufügen der Möglichkeit, eine Annotation mit zentralen Standardwerten zu konfigurieren. 2025-03-20 11:39:40 +01:00
Developer 02
b6563d71b0 feat(Annotation): marginX in left und marginY in top umbenannt. 2025-03-20 10:27:53 +01:00
Developer 02
8a6a11c1bc feat(AnnotationParams): Aktualisiert, um Standardwerte in Annots.init zu setzen. 2025-03-20 10:23:33 +01:00
Developer 02
cbd71aa2b9 feat(AnnotationParams): Logik zur Initialisierung von gebundenen Annotationen hinzugefügt Annots.init 2025-03-20 09:41:51 +01:00
Developer 02
df019a7243 feat(AnnotationParams): Erstellt, um Annotationen über Appsettings zu konfigurieren. 2025-03-20 09:22:36 +01:00
Developer 02
6c222ca9ad Merge branch 'master' into feat/position 2025-03-20 09:05:36 +01:00
Developer 02
53c64ef83e feat(Annotation): Erstellt, um Größe und Layout der Anmerkungen von Umschlägen zu handhaben 2025-03-20 09:00:56 +01:00
Developer 02
3ac0cbeaae chore(frmFinalizePDF): Modul „Encryption“ hinzufügen. 2025-03-18 12:00:58 +01:00
Developer 02
b471c469b5 chore(frmFinalizePDF): GdPicture-Lizenzschlüssel aktualisieren 2025-03-18 11:58:44 +01:00
Developer 02
31a1c0e3a8 chore: GdPicture aktualisieren 2025-03-18 11:57:49 +01:00
Developer 02
08dd6a9aa7 feat(EnvelopeReceiverService): Erstellen der Methode ReadWithSecretByUuidAsync ohne Implementierung. 2025-03-18 11:50:20 +01:00
Developer 02
b6e15dbf03 fix(EnvelopeGenerator.Web): DDModules-Abhängigkeiten unter 2_DLL Projekte verschoben. 2025-03-18 11:46:53 +01:00
Developer 02
146dd2e9d3 Revert "refactor: Erforderliche Abhängigkeiten für GdPicture hinzugefügt und Lizenzschlüssel von frmFinalizePDF aktualisiert"
This reverts commit fa70360c9e.
2025-03-18 11:21:44 +01:00
Developer 02
2cca1b6d4d Revert "refactor(EnvelopeGenerator.Form): GdPicture aktualisieren"
This reverts commit ddc96b96e7.
2025-03-18 11:21:26 +01:00
Developer 02
ddc96b96e7 refactor(EnvelopeGenerator.Form): GdPicture aktualisieren 2025-03-18 10:59:57 +01:00
Developer 02
fa70360c9e refactor: Erforderliche Abhängigkeiten für GdPicture hinzugefügt und Lizenzschlüssel von frmFinalizePDF aktualisiert 2025-03-18 10:38:12 +01:00
Developer 02
da3c7bc0c2 feat(annotation.js): Datum und Ort wurden vertauscht, um die Lesbarkeit zu verbessern. 2025-03-17 15:47:38 +01:00
Developer 02
0692922f12 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-03-05 11:45:12 +01:00
Developer01
e15e27db16 MS Layout Signaturfeld 2025-02-25 16:23:24 +01:00
Developer01
ac279148ba MS Handling Löschen 2025-02-25 15:17:47 +01:00
Developer01
ab5fdbd41e Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-02-25 10:22:47 +01:00
Developer01
0b93f96a20 MS 2025-02-25 10:22:32 +01:00
Developer 02
1a8d3c2e76 chore(Web): Hochgestuft auf 3 2025-02-13 01:32:07 +01:00
Developer 02
43019e6710 feat(Main.cshtml): Bindung des Titels mit Appettigns über MainViewModel 2025-02-13 01:27:44 +01:00
Developer 02
2f634f18bd refactor(Main.cshtml): App-Logo mit Appsettings über CustomImages verbunden.
- Logo aktualisiert.
 - CSS für Logo hinzugefügt
2025-02-13 01:06:46 +01:00
Developer 02
41b5b62f2c feat(CustomImages): Implementiert anstelle von Bildern, um mehrere Bilder über ein Wörterbuch zu konfigurieren 2025-02-13 00:48:47 +01:00
Developer 02
1e34042f77 refactor(Logo): umbenannt in Img 2025-02-13 00:30:03 +01:00
Developer 02
54e3eed557 feat(Logo): Konvertierung von Klassen in ein Wörterbuch anstelle von getrennten Eigenschaften 2025-02-13 00:19:59 +01:00
Developer 02
934414c3b6 fix(EGDbContext): Unnötige Trigger-Konfiguration entfernt 2025-02-12 21:12:40 +01:00
Developer 02
f9c34ef8fd refactor(EGDbContext): AddTrigger zur Konfiguration von Triggern über appsettings.json erstellt und implementiert 2025-02-12 21:11:08 +01:00
Developer 02
4615205aa5 refactor: Aktualisierung der Anwendungs- und Infrastrukturebenen, so dass die Infrastruktur von der Anwendung abhängig ist.
- Repository-Schnittstellen wurden in die Anwendungsschicht verschoben.
 - Erweiterungsmethoden für die Injektion von Repository-Abhängigkeiten wurden in die Infrastruktur verschoben.
2025-02-12 19:31:13 +01:00
Developer 02
a5a8a9e416 refactor(DbTriggerParams): Erstellt, um Trigger über appsettings.json zu konfigurieren 2025-02-12 18:49:53 +01:00
Developer 02
255843d760 chore: Hochgestuft auf 2.11 2025-02-11 16:44:51 +01:00
Developer 02
121f0568ad feat(network.js): Aktualisiertes Logout, um bei erfolgreicher Logout-Anfrage auf die Startseite umzuleiten 2025-02-11 16:44:06 +01:00
Developer 02
5d95f2f221 feat(network.js): Logout-Anforderungsmethode hinzugefügt.
- Logout-Methode zum LOGOUT-Ereignis hinzugefügt
2025-02-11 16:28:50 +01:00
Developer 02
3d5053d177 feat(TFARegController): Logout-Methode hinzugefügt 2025-02-11 16:13:24 +01:00
Developer 02
b79bc2e418 feat(ui.js): Schaltfläche zum Abmelden mit Icon hinzugefügt.
- Mock-Button auf der rechten Seite hinzugefügt, um ein Padding auf die rechte Seite zu setzen
 - Mock-Aktion zur Abmelde-Schaltfläche hinzugefügt
2025-02-11 16:07:38 +01:00
Developer 02
b4154b60a7 feat(HomeController): LogInEnvelope-Methode aktualisiert, um show-envelope-view zu senden, wenn der Client die FullyAuth-Rolle hat 2025-02-11 15:47:27 +01:00
Developer 02
0090fc0dfa fix(EnvelopeReceiverBase): HasPhoneNumber getter Methode aktualisiert, um false nicht nur für null, sondern auch für Leerzeichen zurückzugeben. 2025-02-11 15:42:00 +01:00
Developer 02
6eac92b7cb refactor(HomeController): renamed TryShowEnvelope as CreateShowEnvelopeView 2025-02-11 15:18:09 +01:00
Developer 02
1b1edca23c feat(HomeController): TryShowEnvelope-Methode erstellt, um die Generierung der Show-Envelope-Ansicht zu zentrieren
- TryShowEnvelope-Methode zum EnvelopeLocked-Endpunkt hinzugefügt, um den Umschlag anzuzeigen, wenn der Benutzer bereits autorisiert wurde.
2025-02-11 15:02:10 +01:00
Developer01
57ea9e01f8 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-02-11 14:04:11 +01:00
Developer01
1a99041c60 MS Changes OrderFiles, TFA without OPhone 2025-02-11 14:03:58 +01:00
Developer 02
56c735890d Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-02-11 13:52:39 +01:00
Developer 02
3688373481 fix(_Layout): sanitzer entfernt, um Json-Deserilisationsfehler zu vermeiden. 2025-02-11 13:43:01 +01:00
Developer 02
b8fbeee322 fix(HomeController): Zugehörige Datenbindungen hinzugefügt 2025-02-10 17:17:11 +01:00
Developer 02
57e4dfb3fb feat(EnvelopeLocked): Link zum Senden von E-Mails zu LockedFooterBodyAccess hinzugefügt.
- Gebunden mit Modell.
2025-02-10 16:58:57 +01:00
Developer 02
afc8d3baf0 chore: Upgegradet auf 2.10.4
- Resx-Felder aktualisiert.
2025-02-10 15:23:51 +01:00
Developer 02
51d77367ca fix(DIExtensions): aktualisiert, um den richtigen Abschnittsnamen einzugeben.
- ConfigureByTypeName entfernt
2025-02-10 15:05:46 +01:00
Developer 02
614f3768d9 chore(EnvelopeGenerator): Hochgestuft auf 2.10.3 2025-02-10 13:08:57 +01:00
Developer 02
5f780f8d1e fix(EnvelopeSmsHandler): Korrekte Ablaufprüfung und Cache-Aktualisierung in SendTotpAsync
- Die Bedingung für die Überprüfung des Ablaufs wurde korrigiert, so dass sie korrekt null zurückgibt, wenn der gespeicherte Ablauf in der Zukunft liegt.
- Fehlende Cache-Aktualisierung zur Speicherung des neuen Verfallsdatums nach dem Versand der TOTP-SMS hinzugefügt.
2025-02-10 11:48:36 +01:00
Developer 02
20825aa3ea feat(HomeController): Rollenprüfung für 2FA hinzugefügt
- wenn der Benutzer keine PreAuth Rolle hat, wird Status401Unauthorized zurückgegeben
2025-02-10 11:18:54 +01:00
Developer 02
c5b508d274 chore(EnvelopeGenerator): Hochgestuft auf 2.10.2 2025-02-07 14:49:39 +01:00
Developer 02
4eec4451b2 feat(TFARegController): Authentifizierungsbedingung zum Registrierungsendpunkt hinzugefügt 2025-02-07 13:31:54 +01:00
Developer 02
ca4718e159 feat(ControllerBaseExtensions): Erstellte Erweiterungsmethode zum Login über HttpContext mit Umschlag Empfänger und Rolle.
- Implementiert in HomeController
2025-02-07 13:12:27 +01:00
Developer 02
33fcb5b70e refactor(Controllers): FullyAuth-Rollenbedingung für jedes bestehende Auth-Attribut hinzugefügt, um die Autorisierung in Stufen aufzuteilen. 2025-02-07 10:53:17 +01:00
Developer 02
82d8521a25 feat(Constants): Erstellen von Konstanten für die Empfängerrolle, um die Authentifizierungsschritte des Empfängers zu trennen 2025-02-07 09:47:32 +01:00
Developer 02
2f9d07312b chore(Web): Hochgestuft auf 2.10.0 2025-02-06 19:41:47 +01:00
Developer 02
fa36593b26 refactor(Receiver): Entfernt TotpExpiration aus allen DTOs und Entitäten. 2025-02-06 19:41:11 +01:00
Developer 02
9cdb1409c0 feat(TFARegController): Try-Catch zur Methode reg'e hinzugefügt.
- Ausnahme ist so eingestellt, dass sie protokolliert wird.
2025-02-06 19:31:50 +01:00
Developer 02
95785e8c8b chore(Web): Hochgestuft auf 2.10.0 2025-02-06 18:40:37 +01:00
Developer 02
6d6e62c8d0 feat(EnvelopeLocked): Unterstützung für TFA-Registrierungsfrist auf der gesperrten Seite hinzufügen
- Einführung der TFA-Registrierungsfrist, um einen Link zur Einrichtung der Authenticator-App innerhalb eines gültigen Zeitfensters anzuzeigen.
- Aktualisierung der Ansicht, um die Registrierungsfrist anzuzeigen, falls zutreffend, und den Benutzer zur Einrichtung von TFA zu leiten.
2025-02-06 18:39:32 +01:00
Developer 02
1720e137f9 feat(Reg.cshtml): Zeitüberschreitung hinzugefügt.
- TFARegController.Reg aktualisiert, um die Seite _Expired view zu senden, wenn receiver.TfaRegDeadline abläuft.
 - TFARegParams Klasse für TimeLimit Configuration erstellt und mit appsettings konfiguriert.
2025-02-06 17:59:19 +01:00
Developer 02
3e6e2078bb feat(auth): Unterstützung für Authenticator-App-Setup-Link hinzugefügt
- Es wurde ein neuer Abschnitt eingeführt, der einen Link für Benutzer anzeigt, um ihre Authenticator-App einzurichten, wenn viaAuthenticator aktiviert ist.
 - Abruf von envelopeKey aus ViewData hinzugefügt, um den Einrichtungslink zu erstellen.
 - Refactored codeKeyName Initialisierung für saubereren Code.
2025-02-06 15:49:05 +01:00
Developer 02
6b0ec9386c chore: Bootstrap-icons-Bibliothek hinzufügen 2025-02-06 11:55:15 +01:00
Developer 02
ee49538f1e feat(Receiver): EnvelopeReceiver-Eigenschaft zu Entität, ReadDto und Updated Dto hinzugefügt. 2025-02-05 17:17:44 +01:00
Developer 02
311009bc97 feat(Reg): CSS zu .tfaQrCode hinzugefügt 2025-02-05 16:48:11 +01:00
Developer 02
f5028a82fa feat(Reg View): TFA-Registrierungsschritt erstellt 2025-02-05 16:12:42 +01:00
Developer 02
07d70dbd22 feat(TFARegController): QR-Code zu RegView hinzugefügt. 2025-02-05 13:42:55 +01:00
Developer 02
152050ebf4 feat(ViewControllerBase): Erstellt, um allgemeine Eigenschaften von ViewControllern zu behandeln.
- Implementiert in TFARegController.
 - Implementiert in HomeController.
2025-02-05 12:58:30 +01:00
Developer 02
e27daa4b90 feat(TFARegController): Initialisiert den MVC-Controller und den View zur Bearbeitung der TFA-Registrierung. 2025-02-05 11:32:34 +01:00
Developer01
c63f369bd6 Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-02-04 15:08:07 +01:00
Developer01
c50e16d74f MS Überarbeitung 2025-02-04 15:07:53 +01:00
Developer 02
808a02968b refactor(CodeGenerator): umbenannt in Authenticator 2025-02-03 09:58:57 +01:00
Developer 02
bbd03615e1 feat(EnvelopeSmsHandler): Methode VerifyTotp hinzugefügt, um Totp mit TotpVerificationWindow von TotpSmsParams zu verifizieren. 2025-02-03 09:52:46 +01:00
Developer 02
772d510705 feat(EnvelopeSmsService): SendTotpAsync-Methode hinzufügen, um totp unter Berücksichtigung der Ablaufzeit zu senden. 2025-01-31 14:59:39 +01:00
Developer 02
aa918d875d refactor(JWT): Ungenutzte Schnittstelle und Controller entfernt 2025-01-31 13:10:55 +01:00
Developer 02
28fdf0a115 renamed(SmsParams): umbenannt in GtxMessagingParams 2025-01-31 13:06:11 +01:00
Developer 02
120c8623dd refactor(Application.Configurations): Config-Suffix in Params umbenannt. 2025-01-31 12:51:44 +01:00
Developer 02
363329ca18 refaktor: Vereinfachung der DI-Konfiguration und Verbesserung der Wiederverwendbarkeit
- Entfernte redundante `AddEnvelopeGenerator`-Überladung.
- Einführung der Erweiterungsmethode `ConfigureByTypeName<TOptions>` für eine sauberere Konfiguration.
- Ersetzte explizite Konfigurationsaufrufe durch `ConfigureByTypeName<TOptions>`.
- Verbesserte Wartbarkeit durch Reduzierung von redundantem Code.
- Markierte `ConfigureByTypeName<TOptions>` zur zukünftigen Verlagerung nach `DigitalData.Core`.
2025-01-31 11:54:49 +01:00
Developer 02
eb0c6dabf4 Revert "refactor(EnvelopeSmsService): Initialisiert mit Schnittstelle, DI-Injektion und Konfigurationen."
This reverts commit cd88af6807.
2025-01-31 11:20:43 +01:00
Developer 02
cd88af6807 refactor(EnvelopeSmsService): Initialisiert mit Schnittstelle, DI-Injektion und Konfigurationen. 2025-01-31 11:20:24 +01:00
Developer 02
1941de1928 refactor(EnvelopeSmsService): Initialisiert mit Schnittstelle, DI-Injektion und Konfigurationen. 2025-01-31 11:15:53 +01:00
Developer 02
22347a0202 refactor(MessagingService): umbenannt in SmsSender 2025-01-31 10:37:59 +01:00
Developer 02
e54d9d2da8 feat(TotpSmsParams): Erstellt, um die Konfiguration von Totp zu handhaben 2025-01-31 10:22:37 +01:00
Developer 02
06b1aa9560 refactor(appsetings): Unnötige Konfigurations-Parameter entfernt. 2025-01-30 16:43:14 +01:00
Developer 02
4f35fe54be fix(HomeController): Berechnungsmethode new_expiration aktualisiert, um AddSeconds zu verwenden 2025-01-30 16:37:01 +01:00
Developer 02
84e3e4e18d refactor(HomeController): renamed authentication methods with Handle prefix for clarity 2025-01-30 16:27:09 +01:00
Developer 02
7f26bb4766 refactor(HomeController): Aufteilung in Sub-TFAView-Methoden, um die Lesbarkeit zu verbessern. 2025-01-30 16:12:42 +01:00
Developer 02
f674be5200 chore: Projekt wurde auf 2.9.0 aktualisiert 2025-01-28 10:21:47 +01:00
Developer 02
0718f24339 feat(HomeController): TFAView wurde als separate Methode geschrieben, um Verwirrung zu vermeiden 2025-01-27 17:12:19 +01:00
Developer 02
6abc17c3bf feat(HomeController): Aktualisiert, um SMS über zu senden.
- Unnötige Parameter in SmsParams entfernt.
 - Code-Sendefunktion von IMessagingService entfernt.
 - GetTotpExpirationTime Methode im CodeGenerator entfernt.
2025-01-27 17:09:23 +01:00
Developer 02
cf300d3ade Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-01-27 16:50:44 +01:00
Developer 02
be44f9f436 refactor(HomeController): Statische Eigenschaften SmsTotpStep und SmsFormat hinzugefügt. 2025-01-27 15:01:34 +01:00
Developer 02
80f9107e4e feat(cache): Unterstützung für GetOrSetAsync mit DateTime-Typ hinzugefügt
- GetOrSetAsync für DateTime mit synchronen und asynchronen Fabrikmethoden implementiert.
- Bestehende GetOrSetAsync-Methoden für Zeichenfolgen und asynchrone Zeichenfolgen refaktoriert, um Klarheit und Struktur zu verbessern.
- Code mit Regionen organisiert, um ähnliche Methoden für bessere Lesbarkeit zu gruppieren.
- TODO für weitere Verbesserungen bei der Codegenerierung für GetOrSetAsync-Methoden hinzugefügt.
2025-01-27 14:50:23 +01:00
Developer 02
c6e9ecfbca refactor(cache): Unterstützung für CancellationToken in IDistributedCache-Erweiterungsmethoden hinzufügen
- Aktualisierte `SetLongAsync`, `GetLongAsync`, `SetDateTimeAsync`, `GetDateTimeAsync`, `SetTimeSpanAsync` und `GetTimeSpanAsync`, um optionale `CancellationToken`-Parameter zu unterstützen.
- Modifizierte `GetOrSetAsync`, um zwischen synchronen und asynchronen Fabrikfunktionen zu unterscheiden.
- Sicherstellung einer konsistenten Handhabung von `CancellationToken` in allen Cache-bezogenen Operationen.
2025-01-27 14:23:06 +01:00
Developer 02
af5d7c289d refactor(HomeController): LogInEnvelope aktualisiert, um SMS-Code als TOTP zu verifizieren 2025-01-27 13:47:26 +01:00
Developer 02
3267acbeb3 feat(CodeGenerator): GenerateTotp und VerifyTotp Methoden hinzugefügt. 2025-01-25 00:35:19 +01:00
Developer 02
95efe58e1b chore(Web): Hochgestuft auf 2.8.2 2025-01-24 20:42:01 +01:00
Developer 02
867756242e refactor(EnvelopeReceiver): TFAEnabled wurde in die Envelope-Tabelle für Entität und DTO verschoben.
- Aktualisierte zugehörige Felder in HomeController.
2025-01-24 18:13:29 +01:00
Developer 02
713c2f3ed2 refactor(GTXMessagingResponse): In die Anwendungsschicht verschoben. 2025-01-24 17:11:38 +01:00
Developer01
5a0e258b35 Ms Auswertungen, Dokument anzeigen, Drag and Drop 2025-01-24 14:34:28 +01:00
Developer01
651095976a Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2025-01-03 10:25:22 +01:00
Developer01
fcbee75b9b MS Common 2.1 - Enum VerificationType 2025-01-03 10:25:06 +01:00
Developer 02
dcb25ffc4c chore(Web): auf Projekt 2.8.1 hochgerüstet 2024-12-12 18:49:20 +01:00
Developer 02
618e295634 fix(EnvelopeLocked): falschen Buchstaben aus html entfernen 2024-12-12 18:48:14 +01:00
Developer 02
8a2fa2035a chore : alle Projekte als Debugger konfiguriert. 2024-12-12 18:47:27 +01:00
Developer 02
60109e4deb refactor(annotation.js): Standortzuweisung für mobile Geräte entfernt. 2024-12-12 18:21:28 +01:00
Developer 02
ed6a00dfdf refactor(util): Verschieben von Methoden über Standort nach util.location.js. 2024-12-12 17:11:45 +01:00
Developer 02
c693495928 chore(Web): hochgestuft auf 2.8 2024-12-11 20:09:34 +01:00
Developer 02
241991721d feat(DTOExtension): Erweiterungsmethode hinzugefügt, um totp direkt über Receiver zu prüfen 2024-12-11 18:42:23 +01:00
Developer 02
c41d5c4a76 feat(HomeController): Funktion zur Überprüfung des Authenticator-Codes hinzugefügt. 2024-12-11 18:32:35 +01:00
Developer 02
27db664b4d feat(StringExtension): Erstellen, um erforderliche String-Erweiterungsmethoden hinzuzufügen.
- IsValidTotp Erweiterung hinzugefügt, um die totp zu überprüfen.
2024-12-11 18:22:45 +01:00
Developer 02
ba2518cdd2 refactor(EnvelopeLocked): QRCodeExpiration hinzugefügt 2024-12-11 18:06:36 +01:00
Developer 02
72a0cb78c7 refactor(EnvelopeLocked): Umbenennung von Expiration in SmsExpiration.
- HomeController aktualisiert.
2024-12-11 18:00:48 +01:00
Developer 02
e82d7552c2 refactor(EnvelopeLocked): Formatierbare Schlüsselnamen hinzugefügt. 2024-12-11 17:58:46 +01:00
Developer 02
4b50b6c35d refactor(Resource.resx): Schlüssel-Werte für Authenticators hinzugefügt 2024-12-11 17:32:17 +01:00
Developer 02
103d8da6b2 refactor(Resource.resx): Aktualisierte Schlüsselnamen für Schlüsselformate 2024-12-11 16:54:02 +01:00
Developer 02
15f3bd1bbd refactor(WebKey.Formate): Aktualisiert, um in der resx-Datei in alphabetischer Reihenfolge gruppieren zu können. 2024-12-11 16:39:01 +01:00
Developer 02
10a5adeeee fix: LocakedOpen entfernt. 2024-12-11 16:29:20 +01:00
Developer 02
3b5c6086a9 feat(WebKey): Statische Klasse Formats zur Aufnahme von Schlüsselformaten hinzugefügt.
- Erweiterungsmethoden für die Formatierung von Tastenformaten hinzugefügt.
2024-12-11 16:21:31 +01:00
Developer 02
abda0d14e8 fix: Behebung der falschen Variablenbenennung bei der Zuweisung von codeType 2024-12-11 15:41:31 +01:00
Developer 02
569ebc87cc refactor(site.css): aktualisiert, um den Klassennamen tfa hinzuzufügen, um alle TFA-Seiten zu verwenden.
- Umbenennung des Klassennamens sms-tfa in tfa.
2024-12-11 15:32:21 +01:00
Developer 02
6b6c8e407c refactor(EnvelopeLocked): Umbenennung von AccessCodeName in CodeType.
- HomeController aktualisiert.
2024-12-11 15:22:33 +01:00
Developer 02
556d02870e refactor(CodeGeneratorParams): DefaultTotpSecretKeyLength auf 20 setzen. 2024-12-11 14:56:30 +01:00
Developer 02
c6fc665002 refactor(EnvelopeMailService): Hinzufügen von [TFA_EXPIRATION] über optionale Platzhalter in der Methode SendTFAQrCodeAsync. 2024-12-11 14:45:36 +01:00
Developer 02
030fd0e45b refactor(HomeController): Aktualisierung zur Verwendung der SendTFAQrCodeAsync-Methode anstelle von SendAsync durch den Maildienst. 2024-12-11 12:55:53 +01:00
Developer 02
31e647d3e5 feat(EnvelopeMailService): SendTFAQrCodeAsync als Schnittstellenimplementierung zum Senden von QR-Code-E-Mails hinzugefügt. 2024-12-11 12:53:45 +01:00
Developer 02
6dfdd48ec0 fix(IEnvelopeMailService): Optionale Platzhalter in die richtige Methode verschoben. 2024-12-11 12:16:53 +01:00
Developer 02
85cacc822d feat(EnvelopeMailService): Optionale Platzhalter als Wörterbuch hinzugefügt.
- Als Standard ist es null
2024-12-11 12:14:10 +01:00
Developer 02
535ca23c86 feat(HomeController): Befehl zum Senden von E-Mails hinzugefügt, um QR-Code zu senden.
- TotpSecret zu EmailTemplateType hinzugefügt.
2024-12-11 11:44:39 +01:00
Developer 02
7f1009e402 feat(mapping): Ignorierregel für EnvelopeReceivers in ReceiverReadDto-Mapping hinzugefügt.
- ReceiverReadDto-Mapping aktualisiert, um die Eigenschaft EnvelopeReceivers in der Entität Receiver zu ignorieren.
 - Stellt sicher, dass die Datenzuordnung sauber bleibt und keine unbeabsichtigten Eigenschaften einbezogen werden.
2024-12-11 10:02:53 +01:00
Developer 02
ea4b35f4b4 feat(HomeController): Anweisung hinzugefügt, um den geheimen Totp-Schlüssel zu aktualisieren, wenn er in Kraft ist. 2024-12-11 00:04:29 +01:00
Developer 02
8e1b4e0832 feat(ReceiverService): Generische Update-Methode hinzugefügt 2024-12-10 23:48:01 +01:00
Developer 02
4f5b8f9d76 feat(EnvelopeReceiverService): Optionale schreibgeschützte Eingabe als Schnittstellenimplementierung hinzugefügt.
- als Standard ist Nur-Lesen wahr.
2024-12-10 22:48:43 +01:00
Developer 02
f06b41492e feat(EnvelopeReceiverRepository): Standardwert readOnly als true aktualisiert. 2024-12-10 22:43:53 +01:00
Developer 02
f0f1275e75 feat(EnvelopeReceiverRepository): Optionale schreibgeschützte Eingabe als Schnittstellenimplementierung hinzugefügt.
- Standardmäßig ist schreibgeschützt falsch.
2024-12-10 22:33:32 +01:00
Developer 02
085f37de16 feat(CodeGenerator): Die Methoden GenerateTotpSecretKey, GenerateTotpQrCode und GenerateTotpQrCode wurden als Schnittstellenimplementierung hinzugefügt. 2024-12-10 22:05:52 +01:00
Developer 02
1657a99aa6 feat(DTOExtensions): Optionale minutesBeforeExpiration Eingaben zu IsTotpSecretInvalid und IsTotpSecretValid Methoden hinzugefügt. 2024-12-10 20:34:22 +01:00
Developer 02
ff6d27df8e feat(DTOExtensions): Erstellt, um Erweiterungsmethoden für DTOs hinzuzufügen.
- IsTotpSecretExpired, IsTotpSecretInvalid und IsTotpSecretValid Erweiterungsmethoden für ReceiverReadDto hinzugefügt, um den Zustand des geheimen Schlüssels zu behandeln.
2024-12-10 20:32:09 +01:00
Developer 02
76bd1a102f fix(EnvelopedLocked): asp-for tag helper verwendet, um die Daten der UserSelectSMS Eigenschaft zu erhalten.
- nullibility und null check von UserSelectSMS entfernt, weil es für tag helper nicht akzeptabel ist
2024-12-10 20:13:26 +01:00
Developer 02
6a6da39bc4 refactor(HomeController): Aktualisiert, um zu prüfen, ob der UserSelectSMS-Wert falsch ist.
- Relevante Variablen zu EnvelopeLocked.cshtml hinzugefügt
2024-12-10 18:48:05 +01:00
Developer 02
137d8e09d4 refactor(HomeController): Aktualisiert, um zu prüfen, ob der UserSelectSMS-Status null ist. 2024-12-10 18:24:29 +01:00
Developer 02
bed51992d2 feat(Auth): Proproty mit dem Namen AuthenticatorCode für die Verwendung von Authenticators hinzugefügt.
- Getter mit dem Namen HasAuthenticatorCode hinzugefügt.
 - Aktualisierte HasMulti und HasNone Getter Methoden, die dies berücksichtigen.
2024-12-10 18:08:01 +01:00
Developer 02
a371abaabe feat(Auth): Nullbare Eigenschaft namens 'UserSelectSMS' hinzugefügt.
- Sie wird standardmäßig als null zugewiesen.
 - Die Checkbox des Formulars in Envelope.cshtml wurde userSelectSMS genannt.
2024-12-10 17:47:45 +01:00
Developer 02
90c6e87224 feat(EnvelopeLocked): Kontrollkästchen hinzugefügt, um TFA per SMS auswählen zu können oder nicht, wenn tfa aktiviert ist.
- Das Kontrollkästchen ist standardmäßig nicht aktiviert.
 - Das Kontrollkästchen ist deaktiviert, wenn der Benutzer keine Telefonnummer hat.
2024-12-10 17:26:09 +01:00
Developer 02
4af1534194 fix(Receiver): Behoben TotpExpiration Eigenschaft Column atribute name. 2024-12-10 13:15:25 +01:00
Developer 02
f39ac57009 feat(EnvelopeReceiver): TFAEnabled-Eigenschaft zu Entität und Basis-Dto hinzugefügt. 2024-12-10 12:11:58 +01:00
Developer 02
88d01e4ac7 refactor(Receiver): TotpSecretkey und TotpExpiration Eigenschaften zu Entity und DTOs hinzugefügt. 2024-12-10 11:09:25 +01:00
Developer 02
85c33eb0f8 refactor(CacheExtensions): Umbenennung der GetOrCreate-Methoden in GetOrSet 2024-12-09 17:18:24 +01:00
Developer 02
1bc31fe0ee feat: GetOrCreate und GetOrCreateAsync-Methoden zu CacheExtensions hinzugefügt
- GetOrCreate und GetOrCreateAsync-Methoden hinzugefügt, um Caching mit optionalem Hintergrund-Caching zu ermöglichen.
- Methoden prüfen zuerst den Cache, und wenn der Wert nicht gefunden wird, wird der Wert mit einer bereitgestellten Fabrikfunktion erstellt und zwischengespeichert.
- Unterstützt asynchrones und synchrones Caching mit optionalen DistributedCacheEntryOptions.
2024-12-09 17:13:10 +01:00
Developer 02
2e790b4e4c Revert "feat: Hinzufügen und Konfigurieren von EntityFrameworkCore und UI-Paketen von Microsoft.AspNetCore.Identity."
This reverts commit 19485860a5.
2024-12-09 15:29:30 +01:00
Developer 02
19485860a5 feat: Hinzufügen und Konfigurieren von EntityFrameworkCore und UI-Paketen von Microsoft.AspNetCore.Identity. 2024-12-09 09:37:49 +01:00
Developer 02
e33d859603 refactor(ShowEnvelope): änderte die Farbe der Schaltfläche via Bootstrap in 2024-12-02 14:57:10 +01:00
Developer 02
46b8bde162 chore(Web): Aktualisiert auf 2.7.0. 2024-12-02 10:12:10 +01:00
Developer 02
a6468c2ff1 feat(HomeController): Funktionalität zur Überprüfung des SMS-Codes hinzugefügt 2024-11-30 04:23:24 +01:00
Developer 02
40a21a0b89 feat(EnvelopeReceiverCache): zum Abrufen und Setzen von Caches über Envelope Receiver unter Verwendung von Standard-Schlüsselwörtern als Schnittstellenimplementierung erstellt.
- Erstellte Optionen.
 - Zu DI hinzugefügt.
2024-11-30 03:46:40 +01:00
Developer 02
fa44b82493 feat(EnvelopeLocked): Timer mit CSS-Konfiguration und Javascript-Ereignis hinzugefügt.
- Ablauf über Home-Controller-Ansichtsdaten hinzugefügt
2024-11-30 01:56:02 +01:00
Developer 02
cdec5485c6 feat(GtxMessagingService): Zwischenspeicherung für SMS-Code und Ablauf des SMS-Codes mittels Envelope-Receiver-ID hinzugefügt
- Erweiterungsmethode für Zeitcaching hinzugefügt.
2024-11-29 16:25:20 +01:00
Developer 02
2a963a1861 feat(Web): Verteilter Sql Server-Cache hinzugefügt.
- Bat-Datei erstellt, um Tabelle für Cache zu erstellen.
 - Sql-Datei zum Erstellen einer Tabelle für den Cache erstellt
2024-11-29 14:08:07 +01:00
Developer 02
9d1a2e7254 refactor(HomeController): SMS-Code zum Senden hinzugefügt 2024-11-29 12:05:07 +01:00
Developer 02
b779ef6f0b feat(GtxMessagingService): Konfigurierte Codelänge über ioptions.
- Standardmäßig ist sie 5
2024-11-29 11:16:08 +01:00
Developer 02
0c81a86610 feat(GtxMessagingService): SendSmsCodeAsync mit Basisfunktionalität als Schnittstellenimplementierung hinzugefügt 2024-11-29 11:13:59 +01:00
Developer 02
b11f32bd3c feat: CodeGenerator-Service mit Konfigurationsunterstützung implementiert
- CodeGenerator-Service erstellt, der zufällige Codes basierend auf einem konfigurierbaren Zeichensatz generiert.
- IOptions<CodeGeneratorConfig> für DI-Injektion der Konfigurationseinstellungen integriert.
- Lazy-Initialisierung für statische Instanz des CodeGenerators hinzugefügt.
- Validierung hinzugefügt, um sicherzustellen, dass die Code-Länge größer als null ist.
- Geplante zukünftige Verbesserung: Random als Singleton injizieren, um die Multithreading-Performance zu verbessern.
2024-11-29 11:08:01 +01:00
Developer 02
b8d9963fac refactor(HomeController): ReadWithSecretByUuidSignatureAsync implementiert, um alle Informationen in einer einzigen Sql-Transaktion zu erhalten.
- Methode hinzugefügt, um geheimes dto in dto zu konvertieren
2024-11-29 10:22:11 +01:00
Developer 02
e77532ebfd feat(EnvelopeReceiverService): ReadWithSecretByUuidSignatureAsync zum Lesen mit Zugangscode und Telefonnummer hinzugefügt 2024-11-29 10:11:33 +01:00
Developer 02
ec37518245 feat(EnvelopeReceiverSecretDto): Erstellt als Erbe von EnvelopeReceiverDto, hinzugefügt AccessCode und PhoneNumber. 2024-11-29 10:07:09 +01:00
Developer 02
a1618fc8d0 refactor(HomeController): EnvelopeReceiverSecretDto zur Vereinfachung entfernt und direkt String verwendet 2024-11-29 10:01:28 +01:00
Developer 02
6b65fc28fd refactor(HomeController): log message format more appropriately written 2024-11-29 09:29:27 +01:00
Developer 02
a763fd6a24 feat(EnvelopeLocked): Textkörper und Fußzeile für SMS-Ansicht hinzugefügt. 2024-11-29 01:10:08 +01:00
Developer 02
28a8e20b63 feat(WebKey): Lokalisierungstasten sms tfa in EnvelopeLocked Ansicht hinzugefügt. 2024-11-29 00:45:21 +01:00
Developer 02
155f80e8b3 feat(EnvelopeLocked): Angepasste Icon-Farbe für sms TFA 2024-11-29 00:38:18 +01:00
Developer 02
d8f74971f3 feat(EnvelopeLocked): Der Parameter viaSms wurde hinzugefügt, um die Seite sowohl für die Überprüfung des Zugangscodes als auch des SMS-Codes zu verwenden.
- accessCodeName und accessCodeLabel wurden aktualisiert, um bedingt zugewiesen zu werden.
2024-11-29 00:26:29 +01:00
Developer 02
44dc7185c6 feat(Auth): Getter-Methoden zur Werteprüfung hinzugefügt 2024-11-28 23:57:18 +01:00
Developer 02
551ba595b6 refactor(EnvelopeLocked): envelopeRecevier-Modell aus der Ansicht entfernt. 2024-11-28 23:56:18 +01:00
Developer 02
4b77713df4 Merge branch 'master' into feat/two-factor-auth 2024-11-28 23:39:12 +01:00
Developer 02
f1ca1e9067 feat(Auth): Erstellung eines Authentifizierungsmodells anstelle der direkten Verwendung des Zugriffscodes. 2024-11-28 23:38:51 +01:00
Developer 02
0469f057c9 refactor(HomeController): Aktualisiert, um den Envelope-Empfänger als Modell zur EnvelopeLocked-Ansicht hinzuzufügen 2024-11-28 21:50:05 +01:00
Developer 02
b4a97abe6b feat(EnvelopeReceiverBase): HasPhoneNumber-Eigenschaft sowohl zur Entität als auch zum DTO hinzugefügt 2024-11-28 20:46:51 +01:00
Developer 02
423b293197 feat(MessagingService): Möglichkeit hinzugefügt, den Anbieter des Messaging-Servers zu benachrichtigen. 2024-11-27 17:46:32 +01:00
Developer 02
27618a343e feat(EnvelopeReceiverService): SendSmsAsync hinzugefügt, um SMS an den Benutzer über die Umschlag-Empfänger-ID mithilfe des Messaging-Services zu senden. 2024-11-27 17:35:38 +01:00
Developer 02
fe106c5a8c feat(EnvelopeReceiverBase): Eigenschaft „Telefonnummer“ hinzugefügt. 2024-11-27 17:09:17 +01:00
Developer 02
941b98b1a4 feat(SmsResponse): Erstellung eines Standardantwort-DTOs für SMS-Anfragen.
- GtxMessagingResponse für rohe dynamische Antwort erstellt.
 - Mapping-Profil hinzufügen
2024-11-27 15:13:41 +01:00
Developer 02
168c33bfea chore(Application): Core.Client auf 2.0.3 hochgerüstet 2024-11-26 23:58:07 +01:00
Developer 02
40c25ee111 fix(appsettings): Leerzeichen aus SmsConfig.QueryParams.from entfernt, da vom SMS-Dienst nicht erlaubt 2024-11-26 23:47:42 +01:00
Developer 02
608d79d35b chore(Web): upgraded to 2.6.0 2024-11-25 15:54:15 +01:00
Developer 02
62d396932d refactor(EnvelopeDocument): removed Filename, Filepath and FilenameOriginal properties. 2024-11-25 15:42:51 +01:00
Developer 02
62dcb41526 Refactor: Unnötige alte Fußzeilen aus den Ansichten „Umschlag abgelaufen“, „Abgelehnt“ und „Signiert“ entfernt. 2024-11-25 15:37:28 +01:00
Developer 02
360bb9b3d8 refactor(_layout.cshtml): Datenschutz-Link in der Fußzeile aktualisiert, unterstützt mehrere Sprachen 2024-11-25 15:24:18 +01:00
Developer 02
1f57914f9e refactor(_Layout.cshtml): aktualisiert, um Datenschutz und die Website der Digital Data GmbH bei Klick in einem neuen Tab zu öffnen. 2024-11-25 15:12:48 +01:00
Developer 02
9c431ddf56 refactor(Config): DocumentPathDmz, ExportPathDmz und DocumentPathMoveAftsend sowohl in der Entität als auch im DTO entfernt. 2024-11-25 14:58:32 +01:00
Developer 02
61ff2f8cde Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2024-11-25 14:42:56 +01:00
Developer 02
f2ee509727 chore: Upgrade von Core.Abstractions 2.2.1 und Core.Client auf 2.0.2 2024-11-25 14:40:52 +01:00
Developer 02
da06daf776 refactor(GtxMessagingService): Optionen für generische und dynamische Antworttypen zur SendSmsAsync-Methode hinzugefügt. 2024-11-25 14:13:34 +01:00
Developer 02
d3104500d4 refactor(Application): Aufrüstung von Core.Client auf 2.0.1 2024-11-25 14:08:47 +01:00
Developer 02
d23b8b9187 feat(TestMessagingController): initialized 2024-11-25 13:32:50 +01:00
Developer 02
ec206ab33a feat(DIExtensions): Gtx-Nachrichtendienst hinzugefügt 2024-11-25 13:27:09 +01:00
Developer 02
de6d4b9dd8 feat(DIExtensions): HTTP-Client-Dienst hinzugefügt 2024-11-25 13:25:22 +01:00
Developer 02
2943fe0e2d refactor(DIExtensions): Aktualisiert, um TryAddScoped anstelle von AddScoped für sicherere DI-Injektion zu verwenden. 2024-11-25 13:10:43 +01:00
Developer 02
33e99f584a feat(IMessagingService): Initialisiert und implementiert in GtxMessagingService 2024-11-25 13:07:39 +01:00
Developer 02
4a62ab0c56 feat(GtxMessagingService): Umbenennung von SendSms in SendSmsAsync 2024-11-25 13:01:43 +01:00
Developer 02
132acd35cc feat(GtxMessagingService): Empfänger- und Nachrichteneingaben zur SendSms-Methode über SMS-Parameter hinzugefügt 2024-11-25 13:01:12 +01:00
Developer 02
ed80839777 feat(SmsParams): Aktualisiert, um IHttpClientOptions zu implementieren 2024-11-25 12:47:30 +01:00
Developer01
2114615584 MS Removed PathColumns 2024-11-25 12:38:02 +01:00
Developer 02
6e6f3fd2ed chore: Aktualisierung von Core.Abstraction auf 2.2.0 2024-11-25 11:55:09 +01:00
Developer 02
5da306acd3 feat(GtxMessagingService): SendSms-Methode initialisiert und Authentifizierungspfad hinzugefügt. 2024-11-22 15:37:59 +01:00
Developer 02
18ef1d19b5 feat(GtxMessagingService): Eingespritzter Client.IHttpClientService 2024-11-22 15:20:19 +01:00
Developer 02
b76ebd2abc chore: Aktualisierung von Core.Abstraction auf 2.1.0
- Core.Client zur Anwendungsschicht hinzufügen
2024-11-22 14:57:20 +01:00
Developer 02
d55233061d feat: erweitere SmsParams um zusätzliche Eigenschaften für die SMS-API-Integration
- Neue erforderliche Eigenschaft `Endpoint` hinzugefügt, mit einem Standardwert für den GTX Messaging REST-API-Endpunkt.
- Optionale Eigenschaften wie `Format`, `Accept`, `ContentType` und SMS-spezifische Parameter (`From`, `Texts`, `DlrMask` usw.) hinzugefügt, um API-Anforderungen zu erfüllen.
- XML-Dokumentation mit API-Referenzlink aktualisiert, um besseren Kontext zu bieten.
- TODO hinzugefügt, um Regex-Validierung in `init`-Methoden zu implementieren und Eingabefehler zu reduzieren.
2024-11-21 18:25:14 +01:00
Developer 02
949001791c refactor: Umbenennung von GTX in Gtx und GTXMessagingConfig in SmsParams 2024-11-21 17:22:21 +01:00
Developer 02
30f93f2439 feat(GTXMessagingService): initialisiert mit Konfigurationsoption 2024-11-21 11:46:15 +01:00
Developer01
36ffb9511c Merge branch 'master' of http://git.dd:3000/AppStd/EnvelopeGenerator 2024-11-12 08:30:32 +01:00
Developer01
bf84d5c63a MS Common v1.5.9 email Valdiation, email Resending, Clientintegration 2024-11-12 08:30:14 +01:00
Developer01
57f8d0e398 MS Multiple Files Dialog, Qualifizierte Signatur weg 2024-11-08 11:48:58 +01:00
Developer 02
bb8bd8ed40 chore: Aktualisiert auf 2.5.0. 2024-11-06 00:37:57 +01:00
Developer 02
ba832acad3 feat(Main.cshtml): Bootstrap-Warnung hinzugefügt. 2024-11-06 00:31:25 +01:00
Developer 02
6490a3cb82 feat(home-description): gestaltetes CSS 2024-11-05 23:48:30 +01:00
Developer 02
4c077c90db feat(Main.cshtml): Typed.js für die Beschreibung der Startseite hinzugefügt. 2024-11-05 23:05:30 +01:00
Developer 02
9bd5e63128 feat(Typed.js): hinzugefügt 2024-11-04 17:21:47 +01:00
Developer 02
15ce7c9384 feat(localizer): Wert für HomePageDescription in Deutsch und Englisch hinzugefügt 2024-11-04 17:02:21 +01:00
Developer 02
8707a5cdb5 feat(HomeController): Kultur-Cookie zur Hauptseite hinzugefügt. 2024-11-04 16:28:37 +01:00
Developer 02
47c7070700 feat(Main.cshtml): sign_flow_min.svg hinzugefügt 2024-11-04 15:03:00 +01:00
Developer 02
fcc3223eb1 feat(HomeController): Endpunkt für Stammverzeichnis als Startseite hinzugefügt. 2024-11-04 14:30:09 +01:00
2400 changed files with 24658 additions and 3261 deletions

2
.gitignore vendored
View File

@@ -363,3 +363,5 @@ MigrationBackup/
FodyWeavers.xsd
/EnvelopeGenerator.Web/.config/dotnet-tools.json
/EnvelopeGenerator.GeneratorAPI/ClientApp/envelope-generator-ui/.vscode
/EnvelopeGenerator.Tests.Application/Services/BugFixTests.cs
/EnvelopeGenerator.Tests.Application/annotations.json

View File

@@ -0,0 +1,19 @@
namespace EnvelopeGenerator.Application.Configurations
{
public class AuthenticatorParams
{
public string CharPool { get; init; } = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789012345678901234567890123456789";
//TODO: Increase the DefaultTotpSecretKeyLength (e.g. to 32) but make sure that the QR code is generated correctly and can be scanned by the authenticator.
public int DefaultTotpSecretKeyLength { get; init; } = 20;
public string TotpIssuer { get; init; } = "signFlow";
/// <summary>
/// 0 is user email, 1 is secret key and 2 is issuer.
/// </summary>
public string TotpUrlFormat { get; init; } = "otpauth://totp/{0}?secret={1}&issuer={2}";
public int TotpQRPixelsPerModule { get; init; } = 20;
}
}

View File

@@ -0,0 +1,5 @@
namespace EnvelopeGenerator.Application.Configurations;
public class DbTriggerParams : Dictionary<string, IEnumerable<string>>
{
}

View File

@@ -1,13 +0,0 @@
namespace EnvelopeGenerator.Application.Configurations
{
public class DispatcherConfig
{
public int SendingProfile { get; init; } = 1;
public string AddedWho { get; init; } = "DDEnvelopGenerator";
public int ReminderTypeId { get; init; } = 202377;
public string EmailAttmt1 { get; init; } = string.Empty;
}
}

View File

@@ -0,0 +1,12 @@
namespace EnvelopeGenerator.Application.Configurations;
public class DispatcherParams
{
public int SendingProfile { get; init; } = 1;
public string AddedWho { get; init; } = "DDEnvelopGenerator";
public int ReminderTypeId { get; init; } = 202377;
public string EmailAttmt1 { get; init; } = string.Empty;
}

View File

@@ -0,0 +1,20 @@
using DigitalData.Core.Abstractions.Client;
namespace EnvelopeGenerator.Application.Configurations;
/// <summary>
/// https://www.gtx-messaging.com/en/api-docs/sms-rest-api/
/// </summary>
public class GtxMessagingParams : IHttpClientOptions
{
public required string Uri { get; init; }
public string? Path { get; init; }
public Dictionary<string, object>? Headers { get; init; }
public Dictionary<string, object?>? QueryParams { get; init; }
public string RecipientQueryParamName { get; init; } = "to";
public string MessageQueryParamName { get; init; } = "text";
}

View File

@@ -1,7 +0,0 @@
namespace EnvelopeGenerator.Application.Configurations
{
public class MailConfig
{
public required Dictionary<string, string> Placeholders { get; init; }
}
}

View File

@@ -0,0 +1,6 @@
namespace EnvelopeGenerator.Application.Configurations;
public class MailParams
{
public required Dictionary<string, string> Placeholders { get; init; }
}

View File

@@ -0,0 +1,49 @@
using OtpNet;
using System.Globalization;
namespace EnvelopeGenerator.Application.Configurations
{
public class TotpSmsParams
{
/// <summary>
/// The unit is second.
/// </summary>
public int TotpStep { get; init; } = 90;
public string Format { get; init; } = "Ihr 2FA-Passwort lautet {0}. Gültig bis {1}";
public ExpirationHandler Expiration { get; init; } = new();
public VerificationWindow? TotpVerificationWindow { get; private init; } = VerificationWindow.RfcSpecifiedNetworkDelay;
private IEnumerable<int>? _tvwParams;
public IEnumerable<int>? TotpVerificationWindowParams
{
get => _tvwParams;
init
{
_tvwParams = value;
if(_tvwParams is not null)
TotpVerificationWindow = new(previous: _tvwParams.ElementAtOrDefault(0), future: _tvwParams.ElementAtOrDefault(0));
}
}
public class ExpirationHandler
{
public string CacheKeyFormat { get; init; } = "e{0}_r{1}_sms_code_expiration";
public string Format { get; init; } = "HH:mm:ss";
public string CultureName
{
get => _cultureInfo.Name;
init => _cultureInfo = new(value);
}
private CultureInfo _cultureInfo = new("de-DE");
public CultureInfo CultureInfo => _cultureInfo;
}
}
}

View File

@@ -1,17 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IConfigService : IReadService<ConfigDto, Config, int>
{
Task<DataResult<ConfigDto>> ReadFirstAsync();
Task<ConfigDto> ReadDefaultAsync();
Task<string> ReadDefaultSignatureHost();
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IDocumentReceiverElementService : IBasicCRUDService<DocumentReceiverElementDto, DocumentReceiverElement, int>
{
}
}

View File

@@ -1,9 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IDocumentStatusService : IBasicCRUDService<DocumentStatusDto, DocumentStatus, int>
{
}
}

View File

@@ -1,13 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEmailTemplateService : IBasicCRUDService<EmailTemplateDto, EmailTemplate, int>
{
Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type);
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeCertificateService : IBasicCRUDService<EnvelopeCertificateDto, EnvelopeCertificate, int>
{
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeDocumentService : IBasicCRUDService<EnvelopeDocumentDto, EnvelopeDocument, int>
{
}
}

View File

@@ -1,28 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistoryDto, EnvelopeHistory, long>
{
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null);
Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference);
Task<bool> IsSigned(int envelopeId, string userReference);
Task<bool> IsRejected(int envelopeId, string? userReference = null);
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false);
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId);
Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null);
}
}

View File

@@ -1,17 +0,0 @@
using DigitalData.Core.DTO;
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Common;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeMailService : IEmailOutService
{
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType);
Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto);
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeReceiverReadOnlyService : ICRUDService<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly, long>
{
}
}

View File

@@ -1,34 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>
{
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false);
Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadSecretByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true);
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true);
Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true);
Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true);
Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId);
Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode);
Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode);
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail);
}
}

View File

@@ -1,16 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeService : IBasicCRUDService<EnvelopeDto, Envelope, int>
{
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[]ignore_statuses);
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IEnvelopeTypeService : IBasicCRUDService<EnvelopeTypeDto, EnvelopeType, int>
{
}
}

View File

@@ -1,24 +0,0 @@
using Microsoft.IdentityModel.Tokens;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Security.Cryptography;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IJWTService<TClaimValue>
{
public static SymmetricSecurityKey GenerateSecurityKey(int byteSize = 32)
{
using var rng = RandomNumberGenerator.Create();
var randomBytes = new byte[byteSize];
rng.GetBytes(randomBytes);
var securityKey = new SymmetricSecurityKey(randomBytes);
return securityKey;
}
string GenerateToken(TClaimValue claimValue);
JwtSecurityToken? ReadSecurityToken(string token);
}
}

View File

@@ -1,14 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverReadDto, ReceiverUpdateDto, Receiver, int>
{
public Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
public Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
}
}

View File

@@ -1,10 +0,0 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts
{
public interface IUserReceiverService : IBasicCRUDService<UserReceiverDto, UserReceiver, int>
{
}
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IConfigRepository : ICRUDRepository<Config, int>
{
Task<Config?> ReadFirstAsync();
}

View File

@@ -0,0 +1,8 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IDocumentReceiverElementRepository : ICRUDRepository<DocumentReceiverElement, int>
{
}

View File

@@ -0,0 +1,8 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IDocumentStatusRepository : ICRUDRepository<DocumentStatus, int>
{
}

View File

@@ -0,0 +1,10 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IEmailTemplateRepository : ICRUDRepository<EmailTemplate, int>
{
Task<EmailTemplate?> ReadByNameAsync(EmailTemplateType type);
}

View File

@@ -0,0 +1,8 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IEnvelopeCertificateRepository : ICRUDRepository<EnvelopeCertificate, int>
{
}

View File

@@ -0,0 +1,8 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IEnvelopeDocumentRepository : ICRUDRepository<EnvelopeDocument, int>
{
}

View File

@@ -0,0 +1,11 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IEnvelopeHistoryRepository : ICRUDRepository<EnvelopeHistory, long>
{
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null);
Task<IEnumerable<EnvelopeHistory>> ReadAsync(int? envelopeId = null, string? userReference = null, int? status = null, bool withSender = false, bool withReceiver = false);
}

View File

@@ -0,0 +1,8 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IEnvelopeReceiverReadOnlyRepository : ICRUDRepository<EnvelopeReceiverReadOnly, long>
{
}

View File

@@ -0,0 +1,25 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IEnvelopeReceiverRepository : ICRUDRepository<EnvelopeReceiver, (int Envelope, int Receiver)>
{
Task<IEnumerable<EnvelopeReceiver>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true);
Task<IEnumerable<EnvelopeReceiver>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true);
Task<EnvelopeReceiver?> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
Task<string?> ReadAccessCodeAsync(string uuid, string signature, bool readOnly = true);
Task<int> CountAsync(string uuid, string signature);
Task<EnvelopeReceiver?> ReadByIdAsync(int envelopeId, int receiverId, bool readOnly = true);
Task<string?> ReadAccessCodeByIdAsync(int envelopeId, int receiverId, bool readOnly = true);
Task<IEnumerable<EnvelopeReceiver>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
Task<EnvelopeReceiver?> ReadLastByReceiver(string email);
}

View File

@@ -0,0 +1,13 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IEnvelopeRepository : ICRUDRepository<Envelope, int>
{
Task<IEnumerable<Envelope>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
Task<Envelope?> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
Task<IEnumerable<Envelope>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
}

View File

@@ -0,0 +1,8 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IEnvelopeTypeRepository : ICRUDRepository<EnvelopeType, int>
{
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IReceiverRepository : ICRUDRepository<Receiver, int>
{
Task<Receiver?> ReadByAsync(string? emailAddress = null, string? signature = null);
}

View File

@@ -0,0 +1,8 @@
using DigitalData.Core.Abstractions.Infrastructure;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Repositories;
public interface IUserReceiverRepository : ICRUDRepository<UserReceiver, int>
{
}

View File

@@ -0,0 +1,18 @@
using OtpNet;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IAuthenticator
{
string GenerateCode(int length);
string GenerateTotpSecretKey(int? length = null);
byte[] GenerateTotpQrCode(string userEmail, string secretKey, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null);
byte[] GenerateTotpQrCode(string userEmail, int? length = null, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null);
string GenerateTotp(string secretKey, int step = 30);
bool VerifyTotp(string totpCode, string secretKey, int step = 30, VerificationWindow? window = null);
}

View File

@@ -0,0 +1,16 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IConfigService : IReadService<ConfigDto, Config, int>
{
Task<DataResult<ConfigDto>> ReadFirstAsync();
Task<ConfigDto> ReadDefaultAsync();
Task<string> ReadDefaultSignatureHost();
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IDocumentReceiverElementService : IBasicCRUDService<DocumentReceiverElementDto, DocumentReceiverElement, int>
{
}

View File

@@ -0,0 +1,8 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IDocumentStatusService : IBasicCRUDService<DocumentStatusDto, DocumentStatus, int>
{
}

View File

@@ -0,0 +1,12 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IEmailTemplateService : IBasicCRUDService<EmailTemplateDto, EmailTemplate, int>
{
Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type);
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IEnvelopeCertificateService : IBasicCRUDService<EnvelopeCertificateDto, EnvelopeCertificate, int>
{
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IEnvelopeDocumentService : IBasicCRUDService<EnvelopeDocumentDto, EnvelopeDocument, int>
{
}

View File

@@ -0,0 +1,27 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IEnvelopeHistoryService : ICRUDService<EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistoryDto, EnvelopeHistory, long>
{
Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null);
Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference);
Task<bool> IsSigned(int envelopeId, string userReference);
Task<bool> IsRejected(int envelopeId, string? userReference = null);
Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false);
Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null);
Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId);
Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null);
}

View File

@@ -0,0 +1,18 @@
using DigitalData.Core.DTO;
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Common;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IEnvelopeMailService : IEmailOutService
{
Task<DataResult<int>> SendAsync(EnvelopeReceiverDto envelopeReceiverDto, Constants.EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null);
Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto, Dictionary<string, object>? optionalPlaceholders = null);
Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto envelopeReceiverDto);
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IEnvelopeReceiverReadOnlyService : ICRUDService<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly, long>
{
}

View File

@@ -0,0 +1,38 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IEnvelopeReceiverService : IBasicCRUDService<EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>
{
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true);
Task<DataResult<IEnumerable<string?>>> ReadAccessCodeByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true);
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true);
Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
Task<DataResult<EnvelopeReceiverSecretDto>> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true);
Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId);
Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode);
Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode);
Task<DataResult<bool>> IsExisting(string envelopeReceiverId);
Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail);
Task<DataResult<SmsResponse>> SendSmsAsync(string envelopeReceiverId, string message);
Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadWithSecretByUuidAsync(string uuid);
}

View File

@@ -0,0 +1,15 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IEnvelopeService : IBasicCRUDService<EnvelopeDto, Envelope, int>
{
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false);
Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false);
Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses);
}

View File

@@ -0,0 +1,17 @@
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IEnvelopeSmsHandler
{
/// <summary>
/// If expiration is passed then, sends sms and returns smsResponse and up-to-date expiration; otherwise send expiration.
/// </summary>
/// <param name="er_secret"></param>
/// <param name="cToken"></param>
/// <returns></returns>
Task<(SmsResponse? SmsResponse, DateTime Expiration)> SendTotpAsync(EnvelopeReceiverSecretDto er_secret, CancellationToken cToken = default);
bool VerifyTotp(string totpCode, string secretKey);
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IEnvelopeTypeService : IBasicCRUDService<EnvelopeTypeDto, EnvelopeType, int>
{
}

View File

@@ -0,0 +1,16 @@
using DigitalData.Core.Abstractions;
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IReceiverService : ICRUDService<ReceiverCreateDto, ReceiverReadDto, ReceiverUpdateDto, Receiver, int>
{
Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null);
Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null);
Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto) where TUpdateDto : IUnique<int>;
}

View File

@@ -0,0 +1,11 @@
using EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Contracts.Services;
//TODO: move to DigitalData.Core
public interface ISmsSender
{
string ServiceProvider { get; }
Task<SmsResponse> SendSmsAsync(string recipient, string message);
}

View File

@@ -0,0 +1,9 @@
using DigitalData.Core.Abstractions.Application;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.Contracts.Services;
public interface IUserReceiverService : IBasicCRUDService<UserReceiverDto, UserReceiver, int>
{
}

View File

@@ -1,63 +0,0 @@
using DigitalData.UserManager.Application.MappingProfiles;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.MappingProfiles;
using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Services;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Infrastructure.Repositories;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace EnvelopeGenerator.Application
{
public static class DIExtensions
{
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration dispatcherConfigSection, IConfiguration mailConfigSection)
{
//Inject CRUD Service and repositoriesad
services.AddScoped<IConfigRepository, ConfigRepository>();
services.AddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
services.AddScoped<IEnvelopeDocumentRepository, EnvelopeDocumentRepository>();
services.AddScoped<IConfigRepository, ConfigRepository>();
services.AddScoped<IDocumentReceiverElementRepository, DocumentReceiverElementRepository>();
services.AddScoped<IDocumentStatusRepository, DocumentStatusRepository>();
services.AddScoped<IEmailTemplateRepository, EmailTemplateRepository>();
services.AddScoped<IEnvelopeRepository, EnvelopeRepository>();
services.AddScoped<IEnvelopeCertificateRepository, EnvelopeCertificateRepository>();
services.AddScoped<IEnvelopeDocumentRepository, EnvelopeDocumentRepository>();
services.AddScoped<IEnvelopeHistoryRepository, EnvelopeHistoryRepository>();
services.AddScoped<IEnvelopeReceiverRepository, EnvelopeReceiverRepository>();
services.AddScoped<IEnvelopeTypeRepository, EnvelopeTypeRepository>();
services.AddScoped<IReceiverRepository, ReceiverRepository>();
services.AddScoped<IUserReceiverRepository, UserReceiverRepository>();
services.AddScoped<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyRepository>();
services.AddScoped<IConfigService, ConfigService>();
services.AddScoped<IDocumentReceiverElementService, DocumentReceiverElementService>();
services.AddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
services.AddScoped<IEnvelopeHistoryService, EnvelopeHistoryService>();
services.AddScoped<IDocumentStatusService, DocumentStatusService>();
services.AddScoped<IEmailTemplateService, EmailTemplateService>();
services.AddScoped<IEnvelopeService, EnvelopeService>();
services.AddScoped<IEnvelopeCertificateService, EnvelopeCertificateService>();
services.AddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
services.AddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
services.AddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
services.AddScoped<IReceiverService, ReceiverService>();
services.AddScoped<IUserReceiverService, UserReceiverService>();
services.AddScoped<IEnvelopeReceiverReadOnlyService, EnvelopeReceiverReadOnlyService>();
//Auto mapping profiles
services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly);
services.AddAutoMapper(typeof(UserMappingProfile).Assembly);
services.Configure<DispatcherConfig>(dispatcherConfigSection);
services.Configure<MailConfig>(mailConfigSection);
return services;
}
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration config) => services.AddEnvelopeGenerator(
dispatcherConfigSection: config.GetSection("DispatcherConfig"),
mailConfigSection: config.GetSection("MailConfig"));
}
}

View File

@@ -1,4 +1,5 @@
using DigitalData.Core.Abstractions;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs
@@ -8,11 +9,9 @@ namespace EnvelopeGenerator.Application.DTOs
int SendingProfile,
string SignatureHost,
string ExternalProgramName,
string ExportPath,
string DocumentPathDmz,
string ExportPathDmz,
string DocumentPathMoveAftsend) : IUnique<int>
string ExportPath) : IUnique<int>
{
[NotMapped]
[JsonIgnore]
[Obsolete("Configuration does not have an ID; it represents a single table in the database.")]
public int Id => throw new InvalidOperationException("This configuration does not support an ID as it represents a single row in the database.");

View File

@@ -8,7 +8,9 @@ namespace EnvelopeGenerator.Application.DTOs
int ReceiverId,
int Status,
DateTime? StatusChangedWhen,
string Value,
DateTime AddedWhen,
DateTime? ChangedWhen) : IUnique<int>;
DateTime? ChangedWhen) : IUnique<int>
{
public string? Value { get; set; }
};
}

View File

@@ -51,7 +51,9 @@ namespace EnvelopeGenerator.Application.DTOs
public int? ExpiresWarningWhenDays { get; set; }
public bool DmzMoved { get; set; }
public bool TFAEnabled { get; init; }
public bool DmzMoved { get; set; }
public UserReadDto? User { get; set; }
public EnvelopeType? EnvelopeType { get; set; }

View File

@@ -25,5 +25,7 @@ namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
public DateTime AddedWhen { get; init; }
public DateTime? ChangedWhen { get; init; }
public bool HasPhoneNumber { get; init; }
}
}

View File

@@ -1,4 +1,9 @@
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
{
public record EnvelopeReceiverSecretDto(string? AccessCode) : EnvelopeReceiverDto;
public record EnvelopeReceiverSecretDto() : EnvelopeReceiverDto()
{
public string? AccessCode { get; init; }
public string? PhoneNumber { get; init; }
}
}

View File

@@ -0,0 +1,4 @@
namespace EnvelopeGenerator.Application.DTOs.Messaging
{
public class GtxMessagingResponse : Dictionary<string, object?> { }
}

View File

@@ -0,0 +1,11 @@
namespace EnvelopeGenerator.Application.DTOs.Messaging
{
public record SmsResponse
{
public required bool Ok { get; init; }
public bool Failed => !Ok;
public dynamic? Errors { get; init; }
}
}

View File

@@ -4,7 +4,7 @@ using System.Text;
namespace EnvelopeGenerator.Application.DTOs.Receiver
{
public record ReceiverCreateDto([EmailAddress] string EmailAddress)
public record ReceiverCreateDto([EmailAddress] string EmailAddress, string? TotpSecretkey = null)
{
public string Signature => sha256HexOfMail.Value;

View File

@@ -1,19 +1,24 @@
using DigitalData.Core.DTO;
using DigitalData.Core.Abstractions;
using DigitalData.Core.DTO;
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs.Receiver
{
public record ReceiverReadDto(
int Id,
string EmailAddress,
string Signature,
DateTime AddedWhen
) : BaseDTO<int>(Id)
{
[JsonIgnore]
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; }
namespace EnvelopeGenerator.Application.DTOs.Receiver;
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
};
}
public record ReceiverReadDto(
int Id,
string EmailAddress,
string Signature,
DateTime AddedWhen
) : BaseDTO<int>(Id), IUnique<int>
{
[JsonIgnore]
public IEnumerable<EnvelopeReceiverBasicDto>? EnvelopeReceivers { get; init; }
public string? LastUsedName => EnvelopeReceivers?.LastOrDefault()?.Name;
public string? TotpSecretkey { get; set; } = null;
public DateTime? TfaRegDeadline { get; set; }
};

View File

@@ -1,6 +1,5 @@
using DigitalData.Core.Abstractions;
namespace EnvelopeGenerator.Application.DTOs.Receiver
{
public record ReceiverUpdateDto(int Id) : IUnique<int>;
}
namespace EnvelopeGenerator.Application.DTOs.Receiver;
public record ReceiverUpdateDto(int Id, string? TotpSecretkey = null, DateTime? TfaRegDeadline = null) : IUnique<int>;

View File

@@ -1,56 +1,60 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\Model.Designer.vb" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\Model.Designer.vb" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="DigitalData.Core.Abstractions" Version="2.0.0" />
<PackageReference Include="DigitalData.Core.Application" Version="2.0.0" />
<PackageReference Include="DigitalData.Core.DTO" Version="2.0.0" />
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
<PackageReference Include="UserManager.Application" Version="2.0.0" />
<PackageReference Include="UserManager.Infrastructure" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="DigitalData.Core.Abstractions" Version="2.2.1" />
<PackageReference Include="DigitalData.Core.Application" Version="2.0.0" />
<PackageReference Include="DigitalData.Core.Client" Version="2.0.3" />
<PackageReference Include="DigitalData.Core.DTO" Version="2.0.0" />
<PackageReference Include="DigitalData.EmailProfilerDispatcher" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.18" />
<PackageReference Include="Otp.NET" Version="1.4.0" />
<PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="QRCoder-ImageSharp" Version="0.10.0" />
<PackageReference Include="UserManager.Application" Version="2.0.0" />
<PackageReference Include="UserManager.Infrastructure" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Domain\EnvelopeGenerator.Domain.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.Extensions\EnvelopeGenerator.Extensions.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resources\Model.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Model.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Update="Resources\Model.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Model.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\Model.en.resx">
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<LastGenOutput>Model.en.Designer.vb</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Model.resx">
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<LastGenOutput>Model.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Resource.de-DE.resx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Resource.en-US.resx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\Model.en.resx">
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<LastGenOutput>Model.en.Designer.vb</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Model.resx">
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<LastGenOutput>Model.Designer.cs</LastGenOutput>
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Resource.de-DE.resx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Resource.en-US.resx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,131 @@
using Microsoft.Extensions.Caching.Distributed;
namespace EnvelopeGenerator.Application.Extensions
{
public static class CacheExtensions
{
public static Task SetLongAsync(this IDistributedCache cache, string key, long value, DistributedCacheEntryOptions? options = null, CancellationToken cToken = default)
=> options is null
? cache.SetAsync(key, BitConverter.GetBytes(value), token: cToken)
: cache.SetAsync(key, BitConverter.GetBytes(value), options: options, token: cToken);
public static async Task<long?> GetLongAsync(this IDistributedCache cache, string key, CancellationToken cToken = default)
{
var value = await cache.GetAsync(key, cToken);
return value is null ? null : BitConverter.ToInt64(value, 0);
}
public static Task SetDateTimeAsync(this IDistributedCache cache, string key, DateTime value, DistributedCacheEntryOptions? options = null, CancellationToken cToken = default)
=> cache.SetLongAsync(key: key, value: value.Ticks, options: options, cToken: cToken);
public static async Task<DateTime?> GetDateTimeAsync(this IDistributedCache cache, string key, CancellationToken cToken = default)
{
var value = await cache.GetAsync(key, cToken);
return value is null ? null : new(BitConverter.ToInt64(value, 0));
}
public static Task SetTimeSpanAsync(this IDistributedCache cache, string key, TimeSpan value, DistributedCacheEntryOptions? options = null, CancellationToken cToken = default)
=> cache.SetLongAsync(key: key, value: value.Ticks, options: options, cToken);
public static async Task<TimeSpan?> GetTimeSpanAsync(this IDistributedCache cache, string key, CancellationToken cToken = default)
{
var value = await cache.GetAsync(key, cToken);
return value is null ? null : new(BitConverter.ToInt64(value, 0));
}
//TODO: use code generator
#region GetOrSetAsync
#region string
public static async Task<string> GetOrSetAsync(this IDistributedCache cache, string key, Func<string> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
{
var value = await cache.GetStringAsync(key, cToken);
if (value is null)
{
// create new and save
value = factory();
Task CacheAsync() => options is null
? cache.SetStringAsync(key, value, cToken)
: cache.SetStringAsync(key, value, options, cToken);
if (cacheInBackground)
_ = Task.Run(async () => await CacheAsync(), cToken);
else
await CacheAsync();
}
return value;
}
public static async Task<string> GetOrSetAsync(this IDistributedCache cache, string key, Func<Task<string>> factoryAsync, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
{
var value = await cache.GetStringAsync(key, cToken);
if(value is null)
{
// create new and save
value = await factoryAsync();
Task CacheAsync() => options is null
? cache.SetStringAsync(key: key, value: value, token: cToken)
: cache.SetStringAsync(key: key, value: value, options: options, token: cToken);
if (cacheInBackground)
_ = Task.Run(async () => await CacheAsync(), cToken);
else
await CacheAsync();
}
return value;
}
#endregion
#region DateTime
public static async Task<DateTime> GetOrSetAsync(this IDistributedCache cache, string key, Func<DateTime> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
{
if (await cache.GetDateTimeAsync(key, cToken) is DateTime dateTimeValue)
return dateTimeValue;
else
{
// create new and save
var newValue = factory();
Task CacheAsync() => options is null
? cache.SetDateTimeAsync(key, newValue, cToken: cToken)
: cache.SetDateTimeAsync(key, newValue, options, cToken);
if (cacheInBackground)
_ = Task.Run(async () => await CacheAsync(), cToken);
else
await CacheAsync();
return newValue;
}
}
public static async Task<DateTime> GetOrSetAsync(this IDistributedCache cache, string key, Func<Task<DateTime>> factory, DistributedCacheEntryOptions? options = null, bool cacheInBackground = false, CancellationToken cToken = default)
{
if (await cache.GetDateTimeAsync(key, cToken) is DateTime dateTimeValue)
return dateTimeValue;
else
{
// create new and save
var newValue = await factory();
Task CacheAsync() => options is null
? cache.SetDateTimeAsync(key, newValue, cToken: cToken)
: cache.SetDateTimeAsync(key, newValue, options, cToken);
if (cacheInBackground)
_ = Task.Run(async () => await CacheAsync(), cToken);
else
await CacheAsync();
return newValue;
}
}
#endregion
#endregion
}
}

View File

@@ -0,0 +1,52 @@
using DigitalData.UserManager.Application.MappingProfiles;
using EnvelopeGenerator.Application.MappingProfiles;
using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using DigitalData.Core.Client;
using QRCoder;
using EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Extensions;
public static class DIExtensions
{
public static IServiceCollection AddEnvelopeGeneratorServices(this IServiceCollection services, IConfiguration config)
{
//Inject CRUD Service and repositoriesad
services.TryAddScoped<IConfigService, ConfigService>();
services.TryAddScoped<IDocumentReceiverElementService, DocumentReceiverElementService>();
services.TryAddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
services.TryAddScoped<IEnvelopeHistoryService, EnvelopeHistoryService>();
services.TryAddScoped<IDocumentStatusService, DocumentStatusService>();
services.TryAddScoped<IEmailTemplateService, EmailTemplateService>();
services.TryAddScoped<IEnvelopeService, EnvelopeService>();
services.TryAddScoped<IEnvelopeCertificateService, EnvelopeCertificateService>();
services.TryAddScoped<IEnvelopeDocumentService, EnvelopeDocumentService>();
services.TryAddScoped<IEnvelopeReceiverService, EnvelopeReceiverService>();
services.TryAddScoped<IEnvelopeTypeService, EnvelopeTypeService>();
services.TryAddScoped<IReceiverService, ReceiverService>();
services.TryAddScoped<IUserReceiverService, UserReceiverService>();
services.TryAddScoped<IEnvelopeReceiverReadOnlyService, EnvelopeReceiverReadOnlyService>();
//Auto mapping profiles
services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly);
services.AddAutoMapper(typeof(UserMappingProfile).Assembly);
services.Configure<DispatcherParams>(config.GetSection(nameof(DispatcherParams)));
services.Configure<MailParams>(config.GetSection(nameof(MailParams)));
services.Configure<AuthenticatorParams>(config.GetSection(nameof(AuthenticatorParams)));
services.Configure<TotpSmsParams>(config.GetSection(nameof(TotpSmsParams)));
services.Configure<DbTriggerParams>(config.GetSection(nameof(DbTriggerParams)));
services.AddHttpClientService<GtxMessagingParams>(config.GetSection(nameof(GtxMessagingParams)));
services.TryAddSingleton<ISmsSender, GTXSmsSender>();
services.TryAddSingleton<IEnvelopeSmsHandler, EnvelopeSmsHandler>();
services.TryAddSingleton<IAuthenticator, Authenticator>();
services.TryAddSingleton<QRCodeGenerator>();
return services;
}
}

View File

@@ -0,0 +1,14 @@
using EnvelopeGenerator.Application.DTOs.Messaging;
namespace EnvelopeGenerator.Application.Extensions
{
public static class MappingExtensions
{
public static bool Ok(this GtxMessagingResponse gtxMessagingResponse)
=> gtxMessagingResponse.TryGetValue("message-status", out var status)
&& status?.ToString()?.ToLower() == "ok";
public static string ToBase64String(this byte[] bytes)
=> Convert.ToBase64String(bytes);
}
}

View File

@@ -14,6 +14,7 @@
public static readonly string PossibleSecurityBreach = nameof(PossibleSecurityBreach);
public static readonly string WrongEnvelopeReceiverId = nameof(WrongEnvelopeReceiverId);
public static readonly string EnvelopeOrReceiverNonexists = nameof(EnvelopeOrReceiverNonexists);
public static readonly string PhoneNumberNonexists = nameof(PhoneNumberNonexists);
public static readonly string Default = nameof(Default);
}
}

View File

@@ -3,7 +3,9 @@ using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Extensions;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Application.MappingProfiles
@@ -43,13 +45,20 @@ namespace EnvelopeGenerator.Application.MappingProfiles
CreateMap<EnvelopeHistoryCreateDto, EnvelopeHistory>();
CreateMap<EnvelopeReceiverDto, EnvelopeReceiver>();
CreateMap<EnvelopeTypeDto, EnvelopeType>();
CreateMap<ReceiverReadDto, Receiver>();
CreateMap<ReceiverReadDto, Receiver>().ForMember(rcv => rcv.EnvelopeReceivers, rcvReadDto => rcvReadDto.Ignore());
CreateMap<ReceiverCreateDto, Receiver>();
CreateMap<ReceiverUpdateDto, Receiver>();
CreateMap<UserReceiverDto, UserReceiver>();
CreateMap<EnvelopeReceiverBase, EnvelopeReceiverBasicDto>();
CreateMap<EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnly>();
CreateMap<EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly>();
// Messaging mappings
// for GTX messaging
CreateMap<GtxMessagingResponse, SmsResponse>()
.ConstructUsing(gtxRes => gtxRes.Ok()
? new SmsResponse() { Ok = true }
: new SmsResponse() { Ok = false, Errors = gtxRes });
}
}
}

View File

@@ -156,27 +156,63 @@
<data name="Hello" xml:space="preserve">
<value>Hallo</value>
</data>
<data name="LocakedOpen" xml:space="preserve">
<value>Öffnen</value>
<data name="HomePageDescription" xml:space="preserve">
<value>Das digitale Unterschriftenportal ist eine Plattform, die entwickelt wurde, um Ihre Dokumente sicher zu unterschreiben und zu verwalten. Mit seiner benutzerfreundlichen Oberfläche können Sie Ihre Dokumente schnell hochladen, die Unterschriftsprozesse verfolgen und Ihre digitalen Unterschriftenanwendungen einfach durchführen. Dieses Portal beschleunigt Ihren Arbeitsablauf mit rechtlich gültigen Unterschriften und erhöht gleichzeitig die Sicherheit Ihrer Dokumente.</value>
</data>
<data name="LocationWarning" xml:space="preserve">
<value>Bitte überprüfen Sie die Standortinformationen. Wenn sie falsch sind, korrigieren Sie diese bitte.</value>
</data>
<data name="LockedAccessCode" xml:space="preserve">
<data name="LockedBodyAccess" xml:space="preserve">
<value>Wir senden Ihnen nun einen Zugriffscode an Ihre hinterlegte Email-Adresse. Dies kann evtl. einige Minuten dauern!</value>
</data>
<data name="LockedBodyAuthenticator" xml:space="preserve">
<value>Bitte geben Sie den in Ihrer Authenticator-App angegebenen TOTP-Code ein.</value>
</data>
<data name="LockedBodyAuthenticatorNew" xml:space="preserve">
<value>Wir haben den QR-Code an Ihre E-Mail-Adresse gesendet. Ihr QR-Code ist bis {0} gültig. Sie können ihn für alle Umschläge verwenden, die Sie an diese E-Mail-Adresse erhalten.</value>
</data>
<data name="LockedBodySms" xml:space="preserve">
<value>Wir haben soeben den Zugangscode als SMS an die von Ihnen angegebene Telefonnummer gesendet.</value>
</data>
<data name="LockedCodeLabelAccess" xml:space="preserve">
<value>Zugriffscode</value>
</data>
<data name="LockedBody" xml:space="preserve">
<value>Wir haben Ihnen gerade den Zugriffscode an die hinterlegte Email Adresse gesendet. Dies kann evtl. einige Minuten dauern.</value>
<data name="LockedCodeLabelAuthenticator" xml:space="preserve">
<value>TOTP</value>
</data>
<data name="LockedFooterBody" xml:space="preserve">
<value>Bitte überprüfen Sie Ihr Email Postfach inklusive Spam-Ordner. Sie können auch den Absender bitten, Ihnen den Code auf anderem Wege zukommen zu lassen.</value>
<data name="LockedCodeLabelSms" xml:space="preserve">
<value>SMS-Code</value>
</data>
<data name="LockedFooterTitle" xml:space="preserve">
<data name="LockedFooterBodyAccess" xml:space="preserve">
<value>Bitte überprüfen Sie Ihr Email Postfach inklusive Spam-Ordner. Sie können auch den Absender &lt;a class="mail-link" href="mailto:{0}?subject={1}&amp;body={2}" target="_blank"&gt;{0}&lt;/a&gt; bitten, Ihnen den Code auf anderem Wege zukommen zu lassen.</value>
</data>
<data name="LockedFooterBodyAuthenticator" xml:space="preserve">
<value>Der neue QR-Code wird nur einmal für einen bestimmten Zeitraum gesendet und nach dem Scannen in Ihrer Authenticator-App gespeichert. Er kann für alle Umschläge verwendet werden, die an dieselbe E-Mail-Adresse gesendet werden, bis er abläuft. Wenn Sie die QR-Code-Mail nicht erhalten oder sie sowohl aus der Mail als auch aus authenticator löschen, kontaktieren Sie bitte den Absender.</value>
</data>
<data name="LockedFooterBodySms" xml:space="preserve">
<value>Sie können den Absender bitten, Ihre Rufnummer zu überprüfen. Die Telefonnummer muss mit der Ortsvorwahl eingegeben werden. Andernfalls können Sie beantragen, den Zwei-Faktor-Schutz zu entfernen.</value>
</data>
<data name="LockedFooterTitleAccess" xml:space="preserve">
<value>Sie haben keinen Zugriffscode erhalten?</value>
</data>
<data name="LockedTitle" xml:space="preserve">
<data name="LockedFooterTitleAuthenticator" xml:space="preserve">
<value>Sie haben keinen QR-Code erhalten?</value>
</data>
<data name="LockedFooterTitleSms" xml:space="preserve">
<value>Sie haben keine SMS erhalten?</value>
</data>
<data name="LockedTitleAccess" xml:space="preserve">
<value>Dokument erfordert einen Zugriffscode</value>
</data>
<data name="LockedTitleAuthenticator" xml:space="preserve">
<value>2-Faktor-Authentifizierung</value>
</data>
<data name="LockedTitleSms" xml:space="preserve">
<value>2-Faktor-Authentifizierung</value>
</data>
<data name="Privacy" xml:space="preserve">
<value>Datenschutz</value>
</data>
<data name="ReadOnlyMessage" xml:space="preserve">
<value>Weitergeleitet von {0}. Gültig bis {1}.</value>
</data>

View File

@@ -156,27 +156,63 @@
<data name="Hello" xml:space="preserve">
<value>Hello</value>
</data>
<data name="LocakedOpen" xml:space="preserve">
<value>Open</value>
<data name="HomePageDescription" xml:space="preserve">
<value>The Digital Signature Portal is a platform developed for securely signing and managing your documents. With its user-friendly interface, you can quickly upload your documents, track the signing processes, and easily carry out your digital signature applications. This portal accelerates your workflow with legally valid signatures while enhancing the security of your documents.</value>
</data>
<data name="LocationWarning" xml:space="preserve">
<value>Please review the location information. If it is incorrect, kindly make the necessary corrections.</value>
</data>
<data name="LockedAccessCode" xml:space="preserve">
<data name="LockedBodyAccess" xml:space="preserve">
<value>We will now send you an access code to your registered e-mail address. This may take a few minutes!</value>
</data>
<data name="LockedBodyAuthenticator" xml:space="preserve">
<value>Please enter the TOTP provided in your Authenticator app.</value>
</data>
<data name="LockedBodyAuthenticatorNew" xml:space="preserve">
<value>We have sent the QR code to your e-mail address. Your QR code is valid until {0}. You can use it for all envelopes received at this email address.</value>
</data>
<data name="LockedBodySms" xml:space="preserve">
<value>We have just sent the access code as an SMS to the phone number you provided.</value>
</data>
<data name="LockedCodeLabelAccess" xml:space="preserve">
<value>Access Code</value>
</data>
<data name="LockedBody" xml:space="preserve">
<value>We have just sent you the access code to the email address you provided. This may take a few minutes.</value>
<data name="LockedCodeLabelAuthenticator" xml:space="preserve">
<value>TOTP</value>
</data>
<data name="LockedFooterBody" xml:space="preserve">
<value>Please check your email inbox including your spam folder. Furthermore, you can also ask the sender to send the code by other means.</value>
<data name="LockedCodeLabelSms" xml:space="preserve">
<value>SMS Code</value>
</data>
<data name="LockedFooterTitle" xml:space="preserve">
<data name="LockedFooterBodyAccess" xml:space="preserve">
<value>Please check your email inbox including the spam folder. You can also ask the sender &lt;a class="mail-link" href="mailto:{0}?subject={1}&amp;body={2}" target="_blank"&gt;{0}&lt;/a&gt; to send you the code by other means.</value>
</data>
<data name="LockedFooterBodyAuthenticator" xml:space="preserve">
<value>The new QR code is sent only once for a given period and is saved in your authenticator app once scanned. It can be used for all envelopes received at the same email address until it expires. If you do not receive the QR code mail or delete it both from the mail and from authenticator, please contact the sender.</value>
</data>
<data name="LockedFooterBodySms" xml:space="preserve">
<value>You can ask the sender to check your phone number. The phone number must be entered with the area code. Otherwise you can request to remove the two-factor protection.</value>
</data>
<data name="LockedFooterTitleAccess" xml:space="preserve">
<value>You have not received an access code?</value>
</data>
<data name="LockedTitle" xml:space="preserve">
<data name="LockedFooterTitleAuthenticator" xml:space="preserve">
<value>You have not received a QR code?</value>
</data>
<data name="LockedFooterTitleSms" xml:space="preserve">
<value>You have not received an SMS?</value>
</data>
<data name="LockedTitleAccess" xml:space="preserve">
<value>Document requires an access code</value>
</data>
<data name="LockedTitleAuthenticator" xml:space="preserve">
<value>2-Factor Authentication</value>
</data>
<data name="LockedTitleSms" xml:space="preserve">
<value>2-Factor Authentication</value>
</data>
<data name="Privacy" xml:space="preserve">
<value>Privacy</value>
</data>
<data name="ReadOnlyMessage" xml:space="preserve">
<value>Forwarded by {0}. Valid until {1}.</value>
</data>

View File

@@ -0,0 +1,71 @@
using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Contracts.Services;
using Microsoft.Extensions.Options;
using OtpNet;
using QRCoder;
using System.Text;
namespace EnvelopeGenerator.Application.Services
{
public class Authenticator : IAuthenticator
{
public static Lazy<Authenticator> LazyStatic => new(() => new Authenticator(Options.Create<AuthenticatorParams>(new()), new QRCodeGenerator()));
public static Authenticator Static => LazyStatic.Value;
private readonly AuthenticatorParams _params;
private readonly QRCodeGenerator _qrCodeGenerator;
public Authenticator(IOptions<AuthenticatorParams> options, QRCodeGenerator qrCodeGenerator)
{
_params = options.Value;
_qrCodeGenerator = qrCodeGenerator;
}
public string GenerateCode(int length)
{
//TODO: Inject Random as a singleton to support multithreading to improve performance.
Random random = new();
if (length <= 0)
throw new ArgumentException("Password length must be greater than 0.");
var passwordBuilder = new StringBuilder(length);
for (int i = 0; i < length; i++)
passwordBuilder.Append(_params.CharPool[random.Next(_params.CharPool.Length)]);
return passwordBuilder.ToString();
}
public string GenerateTotpSecretKey(int? length = null)
=> Base32Encoding.ToString(KeyGeneration.GenerateRandomKey(length ?? _params.DefaultTotpSecretKeyLength));
public byte[] GenerateTotpQrCode(string userEmail, string secretKey, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null)
{
var url = string.Format(totpUrlFormat ?? _params.TotpUrlFormat,
Uri.EscapeDataString(userEmail),
Uri.EscapeDataString(secretKey),
Uri.EscapeDataString(issuer ?? _params.TotpIssuer));
using var qrCodeData = _qrCodeGenerator.CreateQrCode(url, QRCodeGenerator.ECCLevel.Q);
using var qrCode = new BitmapByteQRCode(qrCodeData);
return qrCode.GetGraphic(pixelsPerModule ?? _params.TotpQRPixelsPerModule);
}
public byte[] GenerateTotpQrCode(string userEmail, int? length = null, string? issuer = null, string? totpUrlFormat = null, int? pixelsPerModule = null)
{
return GenerateTotpQrCode(
userEmail: userEmail,
secretKey: GenerateTotpSecretKey(length: length),
issuer: issuer,
totpUrlFormat: totpUrlFormat,
pixelsPerModule: pixelsPerModule);
}
public string GenerateTotp(string secretKey, int step = 30) => new Totp(Base32Encoding.ToBytes(secretKey), step).ComputeTotp();
public bool VerifyTotp(string totpCode, string secretKey, int step = 30, VerificationWindow? window = null)
=> new Totp(Base32Encoding.ToBytes(secretKey), step).VerifyTotp(totpCode, out _, window);
}
}

View File

@@ -1,33 +1,33 @@
using AutoMapper;
using DigitalData.Core.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Logging;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class ConfigService : ReadService<IConfigRepository, ConfigDto, Config, int>, IConfigService
{
public class ConfigService : ReadService<IConfigRepository, ConfigDto, Config, int>, IConfigService
{
private static readonly Guid DefaultConfigCacheId = Guid.NewGuid();
private readonly IMemoryCache _cache;
private readonly ILogger<ConfigService> _logger;
private readonly ILogger<ConfigService> _logger;
public ConfigService(IConfigRepository repository, IMapper mapper, IMemoryCache memoryCache, ILogger<ConfigService> logger) : base(repository, mapper)
{
{
_cache = memoryCache;
_logger = logger;
}
_logger = logger;
}
public async Task<DataResult<ConfigDto>> ReadFirstAsync()
{
var config = await _repository.ReadFirstAsync();
return config is null
? Result.Fail<ConfigDto>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, "There is no configuration in DB.")
: Result.Success(_mapper.Map<ConfigDto>(config));
}
public async Task<DataResult<ConfigDto>> ReadFirstAsync()
{
var config = await _repository.ReadFirstAsync();
return config is null
? Result.Fail<ConfigDto>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, "There is no configuration in DB.")
: Result.Success(_mapper.Map<ConfigDto>(config));
}
/// <summary>
/// Reads the default configuration asynchronously.
@@ -43,18 +43,17 @@ namespace EnvelopeGenerator.Application.Services
/// Thrown when the default configuration cannot be found.
/// </exception>
public async Task<ConfigDto> ReadDefaultAsync()
{
var config = await _cache.GetOrCreateAsync(DefaultConfigCacheId, _ => ReadFirstAsync().ThenAsync(
Success: config => config,
Fail: (mssg, ntc) =>
{
_logger.LogNotice(ntc);
throw new InvalidOperationException("Default configuration cannot find.");
}));
{
var config = await _cache.GetOrCreateAsync(DefaultConfigCacheId, _ => ReadFirstAsync().ThenAsync(
Success: config => config,
Fail: (mssg, ntc) =>
{
_logger.LogNotice(ntc);
throw new InvalidOperationException("Default configuration cannot find.");
}));
return config!;
}
public async Task<string> ReadDefaultSignatureHost() => (await ReadDefaultAsync()).SignatureHost;
return config!;
}
public async Task<string> ReadDefaultSignatureHost() => (await ReadDefaultAsync()).SignatureHost;
}

View File

@@ -1,17 +1,16 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, DocumentReceiverElementDto, DocumentReceiverElement, int>, IDocumentReceiverElementService
{
public class DocumentReceiverElementService : BasicCRUDService<IDocumentReceiverElementRepository, DocumentReceiverElementDto, DocumentReceiverElement, int>, IDocumentReceiverElementService
public DocumentReceiverElementService(IDocumentReceiverElementRepository repository, IMapper mapper)
: base(repository, mapper)
{
public DocumentReceiverElementService(IDocumentReceiverElementRepository repository, IMapper mapper)
: base(repository, mapper)
{
}
}
}

View File

@@ -1,17 +1,16 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class DocumentStatusService : BasicCRUDService<IDocumentStatusRepository, DocumentStatusDto, DocumentStatus, int>, IDocumentStatusService
{
public class DocumentStatusService : BasicCRUDService<IDocumentStatusRepository, DocumentStatusDto, DocumentStatus, int>, IDocumentStatusService
public DocumentStatusService(IDocumentStatusRepository repository, IMapper mapper)
: base(repository, mapper)
{
public DocumentStatusService(IDocumentStatusRepository repository, IMapper mapper)
: base(repository, mapper)
{
}
}
}

View File

@@ -1,30 +1,29 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
using static EnvelopeGenerator.Common.Constants;
using DigitalData.Core.DTO;
using Microsoft.Extensions.Logging;
using EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class EmailTemplateService : BasicCRUDService<IEmailTemplateRepository, EmailTemplateDto, EmailTemplate, int>, IEmailTemplateService
{
public class EmailTemplateService : BasicCRUDService<IEmailTemplateRepository, EmailTemplateDto, EmailTemplate, int>, IEmailTemplateService
public EmailTemplateService(IEmailTemplateRepository repository, IMapper mapper)
: base(repository, mapper)
{
public EmailTemplateService(IEmailTemplateRepository repository, IMapper mapper)
: base(repository, mapper)
{
}
}
public async Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type)
{
var temp = await _repository.ReadByNameAsync(type);
return temp is null
? Result.Fail<EmailTemplateDto>()
.Message(Key.InnerServiceError)
.Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"EmailTemplateType '{type}' is not found in DB. Please, define required e-mail template.")
: Result.Success(_mapper.Map<EmailTemplateDto>(temp));
}
public async Task<DataResult<EmailTemplateDto>> ReadByNameAsync(EmailTemplateType type)
{
var temp = await _repository.ReadByNameAsync(type);
return temp is null
? Result.Fail<EmailTemplateDto>()
.Message(Key.InnerServiceError)
.Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"EmailTemplateType '{type}' is not found in DB. Please, define required e-mail template.")
: Result.Success(_mapper.Map<EmailTemplateDto>(temp));
}
}

View File

@@ -1,19 +1,17 @@
using AutoMapper;
using DigitalData.Core.Application;
using Microsoft.Extensions.Localization;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Resources;
using EnvelopeGenerator.Application.Contracts.Repositories;
using EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class EnvelopeCertificateService : BasicCRUDService<IEnvelopeCertificateRepository, EnvelopeCertificateDto, EnvelopeCertificate, int>, IEnvelopeCertificateService
{
public class EnvelopeCertificateService : BasicCRUDService<IEnvelopeCertificateRepository, EnvelopeCertificateDto, EnvelopeCertificate, int>, IEnvelopeCertificateService
public EnvelopeCertificateService(IEnvelopeCertificateRepository repository, IMapper mapper)
: base(repository, mapper)
{
public EnvelopeCertificateService(IEnvelopeCertificateRepository repository, IMapper mapper)
: base(repository, mapper)
{
}
}
}

View File

@@ -1,16 +1,15 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class EnvelopeDocumentService : BasicCRUDService<IEnvelopeDocumentRepository, EnvelopeDocumentDto, EnvelopeDocument, int>, IEnvelopeDocumentService
{
public class EnvelopeDocumentService : BasicCRUDService<IEnvelopeDocumentRepository, EnvelopeDocumentDto, EnvelopeDocument, int>, IEnvelopeDocumentService
public EnvelopeDocumentService(IEnvelopeDocumentRepository repository, IMapper mapper) : base(repository, mapper)
{
public EnvelopeDocumentService(IEnvelopeDocumentRepository repository, IMapper mapper) : base(repository, mapper)
{
}
}
}

View File

@@ -1,85 +1,84 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
using static EnvelopeGenerator.Common.Constants;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.DTOs.EnvelopeHistory;
using EnvelopeGenerator.Application.DTOs.Receiver;
using EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistoryDto, EnvelopeHistory, long>, IEnvelopeHistoryService
{
public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryCreateDto, EnvelopeHistoryDto, EnvelopeHistoryDto, EnvelopeHistory, long>, IEnvelopeHistoryService
public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IMapper mapper)
: base(repository, mapper)
{
public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IMapper mapper)
: base(repository, mapper)
{
}
}
public async Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null) => await _repository.CountAsync(envelopeId: envelopeId, userReference: userReference, status: status);
public async Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null) => await _repository.CountAsync(envelopeId: envelopeId, userReference: userReference, status: status);
public async Task<bool> HasStatus(EnvelopeStatus status, int envelopeId, string userReference) => await _repository.CountAsync(
public async Task<bool> HasStatus(EnvelopeStatus status, int envelopeId, string userReference) => await _repository.CountAsync(
envelopeId: envelopeId,
userReference: userReference,
status: (int) status) > 0;
public async Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference) => await _repository.CountAsync(
envelopeId: envelopeId,
userReference:userReference,
status: (int) EnvelopeStatus.AccessCodeRequested) > 0;
public async Task<bool> IsSigned(int envelopeId, string userReference) => await _repository.CountAsync(
envelopeId: envelopeId,
userReference: userReference,
status: (int) EnvelopeStatus.DocumentSigned) > 0;
/// <summary>
/// Checks if the specified envelope has been rejected.
/// <para><b>Note:</b> <i>If any document within the envelope is rejected, the entire envelope will be considered rejected.</i></para>
/// </summary>
/// <param name="envelopeId">The ID of the envelope to check.</param>
/// <param name="userReference">Optional user reference associated with the envelope.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a boolean value indicating whether the envelope is rejected.</returns>
public async Task<bool> IsRejected(int envelopeId, string? userReference = null)
{
return await _repository.CountAsync(
envelopeId: envelopeId,
userReference: userReference,
status: (int) status) > 0;
status: (int)EnvelopeStatus.DocumentRejected) > 0;
}
public async Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference) => await _repository.CountAsync(
envelopeId: envelopeId,
userReference:userReference,
status: (int) EnvelopeStatus.AccessCodeRequested) > 0;
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false)
{
var histDTOs = _mapper.Map<IEnumerable<EnvelopeHistoryDto>>(
await _repository.ReadAsync(
envelopeId: envelopeId,
userReference: userReference,
status: status,
withSender: withSender,
withReceiver: withReceiver));
return referenceType is null ? histDTOs : histDTOs.Where(h => h.ReferenceType == referenceType);
}
public async Task<bool> IsSigned(int envelopeId, string userReference) => await _repository.CountAsync(
envelopeId: envelopeId,
userReference: userReference,
status: (int) EnvelopeStatus.DocumentSigned) > 0;
/// <summary>
/// Checks if the specified envelope has been rejected.
/// <para><b>Note:</b> <i>If any document within the envelope is rejected, the entire envelope will be considered rejected.</i></para>
/// </summary>
/// <param name="envelopeId">The ID of the envelope to check.</param>
/// <param name="userReference">Optional user reference associated with the envelope.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a boolean value indicating whether the envelope is rejected.</returns>
public async Task<bool> IsRejected(int envelopeId, string? userReference = null)
{
return await _repository.CountAsync(
envelopeId: envelopeId,
userReference: userReference,
status: (int)EnvelopeStatus.DocumentRejected) > 0;
}
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadAsync(int? envelopeId = null, string? userReference = null, ReferenceType? referenceType = null, int? status = null, bool withSender = false, bool withReceiver = false)
{
var histDTOs = _mapper.Map<IEnumerable<EnvelopeHistoryDto>>(
await _repository.ReadAsync(
envelopeId: envelopeId,
userReference: userReference,
status: status,
withSender: withSender,
withReceiver: withReceiver));
return referenceType is null ? histDTOs : histDTOs.Where(h => h.ReferenceType == referenceType);
}
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null) =>
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: (int)EnvelopeStatus.DocumentRejected, withReceiver:true);
public async Task<IEnumerable<EnvelopeHistoryDto>> ReadRejectedAsync(int envelopeId, string? userReference = null) =>
await ReadAsync(envelopeId: envelopeId, userReference: userReference, status: (int)EnvelopeStatus.DocumentRejected, withReceiver:true);
//TODO: use IQueryable in repository to incerease the performance
public async Task<IEnumerable<ReceiverReadDto>> ReadRejectingReceivers(int envelopeId)
{
var envelopes = await ReadRejectedAsync(envelopeId);
return envelopes is null
? Enumerable.Empty<ReceiverReadDto>()
: envelopes
.Where(eh => eh?.Receiver != null)
.Select(eh => eh.Receiver!);
return envelopes is null
? Enumerable.Empty<ReceiverReadDto>()
: envelopes
.Where(eh => eh?.Receiver != null)
.Select(eh => eh.Receiver!);
}
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
await CreateAsync(new (EnvelopeId: envelopeId, UserReference: userReference, Status: (int)status, ActionDate: DateTime.Now, Comment: comment))
.ThenAsync(
Success: id => Result.Success(id),
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)
);
}
await CreateAsync(new (EnvelopeId: envelopeId, UserReference: userReference, Status: (int)status, ActionDate: DateTime.Now, Comment: comment))
.ThenAsync(
Success: id => Result.Success(id),
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)
);
}

View File

@@ -3,7 +3,6 @@ using DigitalData.Core.DTO;
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Common;
using Microsoft.Extensions.Logging;
@@ -12,6 +11,9 @@ using static EnvelopeGenerator.Common.Constants;
using EnvelopeGenerator.Extensions;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Extensions;
using Newtonsoft.Json;
using EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Services
{
@@ -19,20 +21,22 @@ namespace EnvelopeGenerator.Application.Services
{
private readonly IEmailTemplateService _tempService;
private readonly IEnvelopeReceiverService _envRcvService;
private readonly DispatcherConfig _dConfig;
private readonly DispatcherParams _dConfig;
private readonly IConfigService _configService;
private readonly Dictionary<string, string> _placeholders;
private readonly IAuthenticator _authenticator;
public EnvelopeMailService(IEmailOutRepository repository, IMapper mapper, IEmailTemplateService tempService, IEnvelopeReceiverService envelopeReceiverService, IOptions<DispatcherConfig> dispatcherConfigOptions, IConfigService configService, IOptions<MailConfig> mailConfig) : base(repository, mapper)
public EnvelopeMailService(IEmailOutRepository repository, IMapper mapper, IEmailTemplateService tempService, IEnvelopeReceiverService envelopeReceiverService, IOptions<DispatcherParams> dispatcherConfigOptions, IConfigService configService, IOptions<MailParams> mailConfig, IAuthenticator authenticator) : base(repository, mapper)
{
_tempService = tempService;
_envRcvService = envelopeReceiverService;
_dConfig = dispatcherConfigOptions.Value;
_configService = configService;
_placeholders = mailConfig.Value.Placeholders;
_authenticator = authenticator;
}
private async Task<Dictionary<string, string>> CreatePlaceholders(string? accessCode = null, EnvelopeReceiverDto? envelopeReceiverDto = null, EnvelopeReceiverReadOnlyDto? readOnlyDto = null)
private async Task<Dictionary<string, string>> CreatePlaceholders(string? accessCode = null, EnvelopeReceiverDto? envelopeReceiverDto = null)
{
if (accessCode is not null)
_placeholders["[DOCUMENT_ACCESS_CODE]"] = accessCode;
@@ -63,10 +67,8 @@ namespace EnvelopeGenerator.Application.Services
return _placeholders;
}
public async Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto dto) => await SendAsync(dto: dto, tempType: Constants.EmailTemplateType.DocumentAccessCodeReceived);
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverDto dto, Constants.EmailTemplateType tempType)
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverDto dto, EmailTemplateType tempType, Dictionary<string, object>? optionalPlaceholders = null)
{
var tempSerResult = await _tempService.ReadByNameAsync(tempType);
if (tempSerResult.IsFailed)
@@ -104,14 +106,19 @@ namespace EnvelopeGenerator.Application.Services
var placeholders = await CreatePlaceholders(accessCode: accessCode, envelopeReceiverDto: dto);
// Add optional place holders.
if (optionalPlaceholders is not null)
foreach (var oph in optionalPlaceholders)
placeholders[oph.Key] = oph.Value.ToString() ?? "NULL";
//TODO: remove the requirement to add the models using reflections
return await CreateWithTemplateAsync(createDto: mail,placeholders: placeholders,
dto, dto.Envelope.User!, dto.Envelope);
}
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto)
public async Task<DataResult<int>> SendAsync(EnvelopeReceiverReadOnlyDto dto, Dictionary<string, object>? optionalPlaceholders = null)
{
var tempSerResult = await _tempService.ReadByNameAsync(Constants.EmailTemplateType.DocumentShared);
var tempSerResult = await _tempService.ReadByNameAsync(EmailTemplateType.DocumentShared);
if (tempSerResult.IsFailed)
return tempSerResult.ToFail<int>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"The email cannot send because '{Constants.EmailTemplateType.DocumentShared}' template cannot found.");
var temp = tempSerResult.Data;
@@ -140,7 +147,29 @@ namespace EnvelopeGenerator.Application.Services
var placeholders = await CreatePlaceholders(readOnlyDto: dto);
// Add optional place holders.
if (optionalPlaceholders is not null)
foreach (var oph in optionalPlaceholders)
placeholders[oph.Key] = oph.Value.ToString() ?? "NULL";
return await CreateWithTemplateAsync(createDto: mail, placeholders: placeholders, dto.Envelope);
}
public async Task<DataResult<int>> SendAccessCodeAsync(EnvelopeReceiverDto dto) => await SendAsync(dto: dto, tempType: EmailTemplateType.DocumentAccessCodeReceived);
public Task<DataResult<int>> SendTFAQrCodeAsync(EnvelopeReceiverDto dto)
{
// Check if receiver or secret key is null
if (dto.Receiver is null)
throw new ArgumentNullException(nameof(dto), $"TFA Qr Code cannot sent. Receiver information is missing. Envelope receiver dto is {JsonConvert.SerializeObject(dto)}");
if (dto.Receiver.TotpSecretkey is null)
throw new ArgumentNullException(nameof(dto), $"TFA Qr Code cannot sent. Receiver.TotpSecretKey is null. Envelope receiver dto is {JsonConvert.SerializeObject(dto)}");
var totp_qr_64 = _authenticator.GenerateTotpQrCode(userEmail: dto.Receiver.EmailAddress, secretKey: dto.Receiver.TotpSecretkey).ToBase64String();
return SendAsync(dto, EmailTemplateType.TotpSecret, new()
{
{"[TFA_QR_CODE]", totp_qr_64 },
});
}
}
}

View File

@@ -1,16 +1,15 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class EnvelopeReceiverReadOnlyService : CRUDService<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly, long>, IEnvelopeReceiverReadOnlyService
{
public class EnvelopeReceiverReadOnlyService : CRUDService<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyCreateDto, EnvelopeReceiverReadOnlyDto, EnvelopeReceiverReadOnlyUpdateDto, EnvelopeReceiverReadOnly, long>, IEnvelopeReceiverReadOnlyService
public EnvelopeReceiverReadOnlyService(IEnvelopeReceiverReadOnlyRepository repository, IMapper mapper) : base(repository, mapper)
{
public EnvelopeReceiverReadOnlyService(IEnvelopeReceiverReadOnlyRepository repository, IMapper mapper) : base(repository, mapper)
{
}
}
}

View File

@@ -1,139 +1,183 @@
using AutoMapper;
using DigitalData.Core.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.Resources;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using EnvelopeGenerator.Extensions;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverRepository, EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>, IEnvelopeReceiverService
{
public class EnvelopeReceiverService : BasicCRUDService<IEnvelopeReceiverRepository, EnvelopeReceiverDto, EnvelopeReceiver, (int Envelope, int Receiver)>, IEnvelopeReceiverService
private readonly IStringLocalizer<Resource> _localizer;
private readonly ISmsSender _smsSender;
public EnvelopeReceiverService(IEnvelopeReceiverRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper, ISmsSender smsSender)
: base(repository, mapper)
{
private readonly IStringLocalizer<Resource> _localizer;
_localizer = localizer;
_smsSender = smsSender;
}
public EnvelopeReceiverService(IEnvelopeReceiverRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper)
: base(repository, mapper)
{
_localizer = localizer;
}
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true, bool readOnly = true)
{
var env_rcvs = await _repository.ReadBySignatureAsync(signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
}
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadBySignatureAsync(string signature, bool withEnvelope = false, bool withReceiver = true)
{
var env_rcvs = await _repository.ReadBySignatureAsync(signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver);
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
}
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false, bool readOnly = true)
{
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
}
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUuidAsync(string uuid, bool withEnvelope = true, bool withReceiver = false)
{
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver);
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverDto>>(env_rcvs));
}
public async Task<DataResult<IEnumerable<string?>>> ReadAccessCodeByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true)
{
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver);
return Result.Success(env_rcvs.Select(er => er.AccessCode));
}
public async Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadSecretByUuidAsync(string uuid, bool withEnvelope = false, bool withReceiver = true)
{
var env_rcvs = await _repository.ReadByUuidAsync(uuid: uuid, withEnvelope: withEnvelope, withReceiver: withReceiver);
return Result.Success(_mapper.Map<IEnumerable<EnvelopeReceiverSecretDto>>(env_rcvs));
}
public async Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true)
{
var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
if (env_rcv is null)
return Result.Fail<EnvelopeReceiverDto>()
.Message(Key.EnvelopeReceiverNotFound);
public async Task<DataResult<EnvelopeReceiverDto>> ReadByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true)
{
var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver);
if (env_rcv is null)
return Result.Fail<EnvelopeReceiverDto>()
.Message(Key.EnvelopeReceiverNotFound);
return Result.Success(_mapper.Map<EnvelopeReceiverDto>(env_rcv));
}
return Result.Success(_mapper.Map<EnvelopeReceiverDto>(env_rcv));
}
public async Task<DataResult<EnvelopeReceiverSecretDto>> ReadWithSecretByUuidSignatureAsync(string uuid, string signature, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true)
{
var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
if (env_rcv is null)
return Result.Fail<EnvelopeReceiverSecretDto>()
.Message(Key.EnvelopeReceiverNotFound);
public async Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true)
{
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
return Result.Success(_mapper.Map<EnvelopeReceiverSecretDto>(env_rcv));
}
if (uuid is null || signature is null)
return Result.Fail<EnvelopeReceiverDto>()
.Message(_localizer[Key.WrongEnvelopeReceiverId])
.Notice(LogLevel.Warning, (uuid, signature).ToTitle())
.Notice(LogLevel.Warning, EnvelopeFlag.WrongEnvelopeReceiverId)
.Notice(LogLevel.Warning, Flag.PossibleSecurityBreach);
public async Task<DataResult<EnvelopeReceiverDto>> ReadByEnvelopeReceiverIdAsync(string envelopeReceiverId, bool withEnvelope = true, bool withReceiver = true, bool readOnly = true)
{
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
return await ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver);
}
if (uuid is null || signature is null)
return Result.Fail<EnvelopeReceiverDto>()
.Message(_localizer[Key.WrongEnvelopeReceiverId])
.Notice(LogLevel.Warning, (uuid, signature).ToTitle())
.Notice(LogLevel.Warning, EnvelopeFlag.WrongEnvelopeReceiverId)
.Notice(LogLevel.Warning, Flag.PossibleSecurityBreach);
public async Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode)
{
var er = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature);
return await ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: withEnvelope, withReceiver: withReceiver, readOnly: readOnly);
}
if (er is null)
return Result.Fail<bool>()
.Message(_localizer[Key.EnvelopeOrReceiverNonexists])
.Notice(LogLevel.Warning, (uuid, signature).ToTitle())
.Notice(LogLevel.Warning, EnvelopeFlag.EnvelopeOrReceiverNonexists)
.Notice(LogLevel.Warning, Flag.PossibleDataIntegrityIssue);
public async Task<DataResult<bool>> VerifyAccessCodeAsync(string uuid, string signature, string accessCode)
{
var er = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature);
var actualAccessCode = er.AccessCode;
if (er is null)
return Result.Fail<bool>()
.Message(_localizer[Key.EnvelopeOrReceiverNonexists])
.Notice(LogLevel.Warning, (uuid, signature).ToTitle())
.Notice(LogLevel.Warning, EnvelopeFlag.EnvelopeOrReceiverNonexists)
.Notice(LogLevel.Warning, Flag.PossibleDataIntegrityIssue);
if (actualAccessCode is null)
return Result.Fail<bool>()
.Message(_localizer[Key.AccessCodeNull])
.Notice(LogLevel.Critical, (uuid, signature).ToTitle())
.Notice(LogLevel.Critical, EnvelopeFlag.AccessCodeNull)
.Notice(LogLevel.Critical, Flag.DataIntegrityIssue);
var actualAccessCode = er.AccessCode;
else if (accessCode != actualAccessCode)
return Result.Success(false).Message(_localizer[Key.WrongAccessCode]);
else
return Result.Success(true);
}
if (actualAccessCode is null)
return Result.Fail<bool>()
.Message(_localizer[Key.AccessCodeNull])
.Notice(LogLevel.Critical, (uuid, signature).ToTitle())
.Notice(LogLevel.Critical, EnvelopeFlag.AccessCodeNull)
.Notice(LogLevel.Critical, Flag.DataIntegrityIssue);
public async Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode)
{
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
else if (accessCode != actualAccessCode)
return Result.Success(false).Message(_localizer[Key.WrongAccessCode]);
else
return Result.Success(true);
}
if (uuid is null || signature is null)
return Result.Fail<bool>()
.Message(Key.WrongEnvelopeReceiverId)
.Notice(LogLevel.Critical, EnvelopeFlag.WrongEnvelopeReceiverId)
.Notice(LogLevel.Critical, Flag.SecurityBreach)
.Notice(LogLevel.Critical, "Attempt to verify access code detected. Such actions are generally not initiated by well-intentioned users. Potential security breach suspected. Immediate investigation required.");
public async Task<DataResult<bool>> VerifyAccessCodeAsync(string envelopeReceiverId, string accessCode)
{
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
return await VerifyAccessCodeAsync(uuid: uuid, signature: signature, accessCode: accessCode);
}
if (uuid is null || signature is null)
return Result.Fail<bool>()
.Message(Key.WrongEnvelopeReceiverId)
.Notice(LogLevel.Critical, EnvelopeFlag.WrongEnvelopeReceiverId)
.Notice(LogLevel.Critical, Flag.SecurityBreach)
.Notice(LogLevel.Critical, "Attempt to verify access code detected. Such actions are generally not initiated by well-intentioned users. Potential security breach suspected. Immediate investigation required.");
public async Task<DataResult<bool>> IsExisting(string envelopeReceiverId)
{
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
return await VerifyAccessCodeAsync(uuid: uuid, signature: signature, accessCode: accessCode);
}
if (uuid is null || signature is null)
return Result.Fail<bool>().Notice(LogLevel.Warning, EnvelopeFlag.NonDecodableEnvelopeReceiverId, "In IsExisting(string envelopeReceiverId)");
public async Task<DataResult<bool>> IsExisting(string envelopeReceiverId)
{
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
int count = await _repository.CountAsync(uuid:uuid, signature:signature);
return Result.Success(count > 0);
}
if (uuid is null || signature is null)
return Result.Fail<bool>().Notice(LogLevel.Warning, EnvelopeFlag.NonDecodableEnvelopeReceiverId, "In IsExisting(string envelopeReceiverId)");
int count = await _repository.CountAsync(uuid:uuid, signature:signature);
return Result.Success(count > 0);
}
public async Task<DataResult<string>> ReadAccessCodeByIdAsync(int envelopeId, int receiverId)
{
var code = await _repository.ReadAccessCodeByIdAsync(envelopeId: envelopeId, receiverId: receiverId);
return code is null ?
Result.Fail<string>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"Access code is null. Envelope ID is {envelopeId} and receiver ID {receiverId}")
: Result.Success(code);
var code = await _repository.ReadAccessCodeByIdAsync(envelopeId: envelopeId, receiverId: receiverId);
return code is null ?
Result.Fail<string>().Notice(LogLevel.Error, Flag.DataIntegrityIssue, $"Access code is null. Envelope ID is {envelopeId} and receiver ID {receiverId}")
: Result.Success(code);
}
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
{
var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
var dto_list = _mapper.Map<IEnumerable<EnvelopeReceiverDto>>(er_list);
return Result.Success(dto_list);
}
public async Task<DataResult<IEnumerable<EnvelopeReceiverDto>>> ReadByUsernameAsync(string username, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
{
var er_list = await _repository.ReadByUsernameAsync(username: username, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
var dto_list = _mapper.Map<IEnumerable<EnvelopeReceiverDto>>(er_list);
return Result.Success(dto_list);
}
public async Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail)
{
var er = await _repository.ReadLastByReceiver(mail);
return er is null ? Result.Fail<string?>().Notice(LogLevel.None, Flag.NotFound) : Result.Success(er.Name);
}
public async Task<DataResult<string?>> ReadLastUsedReceiverNameByMail(string mail)
{
var er = await _repository.ReadLastByReceiver(mail);
return er is null ? Result.Fail<string?>().Notice(LogLevel.None, Flag.NotFound) : Result.Success(er.Name);
}
public async Task<DataResult<SmsResponse>> SendSmsAsync(string envelopeReceiverId, string message)
{
(string? uuid, string? signature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
if (uuid is null || signature is null)
return Result.Fail<SmsResponse>()
.Message(_localizer[Key.WrongEnvelopeReceiverId])
.Notice(LogLevel.Warning, (uuid, signature).ToTitle())
.Notice(LogLevel.Warning, EnvelopeFlag.WrongEnvelopeReceiverId)
.Notice(LogLevel.Warning, Flag.PossibleSecurityBreach);
var env_rcv = await _repository.ReadByUuidSignatureAsync(uuid: uuid, signature: signature, withEnvelope: false, withReceiver: false);
if (env_rcv is null)
return Result.Fail<SmsResponse>()
.Message(Key.EnvelopeReceiverNotFound);
if (env_rcv.PhoneNumber is null)
return Result.Fail<SmsResponse>()
.Message(Key.PhoneNumberNonexists)
.Notice(LogLevel.Error, Flag.NotFound, $"An attempt was made to send sms to the user whose phone number is null. Envelope recipient ID is {envelopeReceiverId}, UUID is {uuid} and signature is {signature}.");
var res = await _smsSender.SendSmsAsync(recipient: env_rcv.PhoneNumber, message: message);
return Result.Success(res);
}
public Task<DataResult<IEnumerable<EnvelopeReceiverSecretDto>>> ReadWithSecretByUuidAsync(string uuid)
{
throw new NotImplementedException();
}
}

View File

@@ -1,43 +1,42 @@
using AutoMapper;
using DigitalData.Core.Application;
using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>, IEnvelopeService
{
public class EnvelopeService : BasicCRUDService<IEnvelopeRepository, EnvelopeDto, Envelope, int>, IEnvelopeService
public EnvelopeService(IEnvelopeRepository repository, IMapper mapper)
: base(repository, mapper)
{
public EnvelopeService(IEnvelopeRepository repository, IMapper mapper)
: base(repository, mapper)
{
}
}
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false)
{
var envelopes = await _repository.ReadAllWithAsync(documents: documents, history: history, documentReceiverElement: documentReceiverElement);
var readDto = _mapper.Map<IEnumerable<EnvelopeDto>>(envelopes);
return Result.Success(readDto);
}
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadAllWithAsync(bool documents = false, bool history = false, bool documentReceiverElement = false)
{
var envelopes = await _repository.ReadAllWithAsync(documents: documents, history: history, documentReceiverElement: documentReceiverElement);
var readDto = _mapper.Map<IEnumerable<EnvelopeDto>>(envelopes);
return Result.Success(readDto);
}
public async Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false)
{
var envelope = await _repository.ReadByUuidAsync(uuid: uuid, withDocuments: withDocuments, withHistory: withHistory, withDocumentReceiverElement: withDocumentReceiverElement, withUser:withUser, withAll:withAll);
public async Task<DataResult<EnvelopeDto>> ReadByUuidAsync(string uuid, bool withDocuments = false, bool withHistory = false, bool withDocumentReceiverElement = false, bool withUser = false, bool withAll = false)
{
var envelope = await _repository.ReadByUuidAsync(uuid: uuid, withDocuments: withDocuments, withHistory: withHistory, withDocumentReceiverElement: withDocumentReceiverElement, withUser:withUser, withAll:withAll);
if (envelope is null)
return Result.Fail<EnvelopeDto>();
if (envelope is null)
return Result.Fail<EnvelopeDto>();
var readDto = _mapper.Map<EnvelopeDto>(envelope);
return Result.Success(readDto);
}
var readDto = _mapper.Map<EnvelopeDto>(envelope);
return Result.Success(readDto);
}
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
{
var users = await _repository.ReadByUserAsync(userId: userId, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
var readDto = _mapper.Map<IEnumerable<EnvelopeDto>>(users);
return Result.Success(readDto);
}
public async Task<DataResult<IEnumerable<EnvelopeDto>>> ReadByUserAsync(int userId, int? min_status = null, int? max_status = null, params int[] ignore_statuses)
{
var users = await _repository.ReadByUserAsync(userId: userId, min_status: min_status, max_status: max_status, ignore_statuses: ignore_statuses);
var readDto = _mapper.Map<IEnumerable<EnvelopeDto>>(users);
return Result.Success(readDto);
}
}

View File

@@ -0,0 +1,54 @@
using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using EnvelopeGenerator.Application.DTOs.Messaging;
using EnvelopeGenerator.Application.Extensions;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Options;
namespace EnvelopeGenerator.Application.Services;
public class EnvelopeSmsHandler : IEnvelopeSmsHandler
{
private readonly ISmsSender _sender;
private readonly TotpSmsParams _totpSmsParams;
private readonly IDistributedCache _dCache;
private readonly IAuthenticator _authenticator;
public EnvelopeSmsHandler(ISmsSender sender, IOptions<TotpSmsParams> totpSmsParamsOptions, IDistributedCache distributedCache, IAuthenticator authenticator)
{
_sender = sender;
_totpSmsParams = totpSmsParamsOptions.Value;
_dCache = distributedCache;
_authenticator = authenticator;
}
/// <summary>
/// If expiration is passed then, sends sms and returns smsResponse and up-to-date expiration; otherwise send expiration.
/// </summary>
/// <param name="er_secret"></param>
/// <param name="cToken"></param>
/// <returns></returns>
public async Task<(SmsResponse? SmsResponse, DateTime Expiration)> SendTotpAsync(EnvelopeReceiverSecretDto er_secret, CancellationToken cToken = default)
{
var key = string.Format(_totpSmsParams.Expiration.CacheKeyFormat, er_secret.EnvelopeId, er_secret.ReceiverId);
var expiration = await _dCache.GetDateTimeAsync(key, cToken);
if(expiration is DateTime expirationDateTime && expirationDateTime >= DateTime.Now)
return (null, expirationDateTime);
else
{
var new_expiration = DateTime.Now.AddSeconds(_totpSmsParams.TotpStep);
var totp = _authenticator.GenerateTotp(er_secret.Receiver!.TotpSecretkey!, _totpSmsParams.TotpStep);
var msg = string.Format(_totpSmsParams.Format, totp, new_expiration.ToString(_totpSmsParams.Expiration.Format, _totpSmsParams.Expiration.CultureInfo));
await _dCache.SetDateTimeAsync(key, new_expiration, cToken: cToken);
return (await _sender.SendSmsAsync(er_secret.PhoneNumber!, msg), new_expiration);
}
}
public bool VerifyTotp(string totpCode, string secretKey) => _authenticator
.VerifyTotp(totpCode, secretKey, _totpSmsParams.TotpStep, _totpSmsParams.TotpVerificationWindow);
}

View File

@@ -1,30 +1,29 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
using Microsoft.Extensions.Caching.Memory;
using DigitalData.Core.DTO;
using Microsoft.Extensions.Logging;
using EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDto, EnvelopeType, int>, IEnvelopeTypeService
{
public class EnvelopeTypeService : BasicCRUDService<IEnvelopeTypeRepository, EnvelopeTypeDto, EnvelopeType, int>, IEnvelopeTypeService
private static readonly Guid CacheKey = Guid.NewGuid();
private readonly IMemoryCache _cache;
public EnvelopeTypeService(IEnvelopeTypeRepository repository, IMapper mapper, IMemoryCache cache)
: base(repository, mapper)
{
private static readonly Guid CacheKey = Guid.NewGuid();
private readonly IMemoryCache _cache;
public EnvelopeTypeService(IEnvelopeTypeRepository repository, IMapper mapper, IMemoryCache cache)
: base(repository, mapper)
{
_cache = cache;
}
public override async Task<DataResult<IEnumerable<EnvelopeTypeDto>>> ReadAllAsync()
=> await _cache.GetOrCreateAsync(CacheKey, async entry => await base.ReadAllAsync())
?? Result.Fail<IEnumerable<EnvelopeTypeDto>>().Notice(LogLevel.Error, Flag.NotFound, "No cached envelope types are available in the database. If you have added any envelope types after the server started, please restart the server.");
_cache = cache;
}
public override async Task<DataResult<IEnumerable<EnvelopeTypeDto>>> ReadAllAsync()
=> await _cache.GetOrCreateAsync(CacheKey, async entry => await base.ReadAllAsync())
?? Result.Fail<IEnumerable<EnvelopeTypeDto>>().Notice(LogLevel.Error, Flag.NotFound, "No cached envelope types are available in the database. If you have added any envelope types after the server started, please restart the server.");
}

View File

@@ -0,0 +1,40 @@
using AutoMapper;
using DigitalData.Core.Abstractions.Client;
using DigitalData.Core.Client;
using EnvelopeGenerator.Application.Configurations;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.DTOs.Messaging;
using Microsoft.Extensions.Options;
namespace EnvelopeGenerator.Application.Services;
//TODO: move to DigitalData.Core
public class GTXSmsSender : ISmsSender
{
private readonly IHttpClientService<GtxMessagingParams> _smsClient;
private readonly GtxMessagingParams _smsParams;
private readonly IMapper _mapper;
public string ServiceProvider { get; }
public GTXSmsSender(IHttpClientService<GtxMessagingParams> smsClient, IOptions<GtxMessagingParams> smsParamsOptions, IMapper mapper)
{
_smsClient = smsClient;
_smsParams = smsParamsOptions.Value;
_mapper = mapper;
ServiceProvider = GetType().Name.Replace("Service", string.Empty);
}
public async Task<SmsResponse> SendSmsAsync(string recipient, string message)
{
return await _smsClient.FetchAsync(queryParams: new Dictionary<string, object?>()
{
{ _smsParams.RecipientQueryParamName, recipient },
{ _smsParams.MessageQueryParamName, message }
})
.ThenAsync(res => res.Json<GtxMessagingResponse>())
.ThenAsync(_mapper.Map<SmsResponse>);
}
}

View File

@@ -1,38 +1,51 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
using EnvelopeGenerator.Application.DTOs.Receiver;
using DigitalData.Core.DTO;
using DigitalData.Core.Abstractions;
using Microsoft.Extensions.Logging;
using EnvelopeGenerator.Application.Contracts.Services;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class ReceiverService : CRUDService<IReceiverRepository, ReceiverCreateDto, ReceiverReadDto, ReceiverUpdateDto, Receiver, int>, IReceiverService
{
public class ReceiverService : CRUDService<IReceiverRepository, ReceiverCreateDto, ReceiverReadDto, ReceiverUpdateDto, Receiver, int>, IReceiverService
public ReceiverService(IReceiverRepository repository, IMapper mapper)
: base(repository, mapper)
{
public ReceiverService(IReceiverRepository repository, IMapper mapper)
: base(repository, mapper)
}
public async Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null)
{
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
if (rcv is null)
return Result.Fail<ReceiverReadDto>();
return Result.Success(_mapper.Map<ReceiverReadDto>(rcv));
}
public async Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null)
{
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
if (rcv is null)
return Result.Fail();
return await _repository.DeleteAsync(rcv) ? Result.Success() : Result.Fail();
}
public virtual async Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto) where TUpdateDto : IUnique<int>
{
var val = await _repository.ReadByIdAsync(updateDto.Id);
if (val == null)
{
return Result.Fail().Notice(LogLevel.Warning, Flag.NotFound, $"{updateDto.Id} is not found in update process of {GetType()} entity.");
}
public async Task<DataResult<ReceiverReadDto>> ReadByAsync(string? emailAddress = null, string? signature = null)
{
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
if (rcv is null)
return Result.Fail<ReceiverReadDto>();
return Result.Success(_mapper.Map<ReceiverReadDto>(rcv));
}
public async Task<Result> DeleteByAsync(string? emailAddress = null, string? signature = null)
{
var rcv = await _repository.ReadByAsync(emailAddress: emailAddress, signature: signature);
if (rcv is null)
return Result.Fail();
return await _repository.DeleteAsync(rcv) ? Result.Success() : Result.Fail();
}
var entity = _mapper.Map(updateDto, val);
return (await _repository.UpdateAsync(entity)) ? Result.Success() : Result.Fail();
}
}

View File

@@ -1,17 +1,16 @@
using AutoMapper;
using DigitalData.Core.Application;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using EnvelopeGenerator.Application.Contracts.Repositories;
namespace EnvelopeGenerator.Application.Services
namespace EnvelopeGenerator.Application.Services;
public class UserReceiverService : BasicCRUDService<IUserReceiverRepository, UserReceiverDto, UserReceiver, int>, IUserReceiverService
{
public class UserReceiverService : BasicCRUDService<IUserReceiverRepository, UserReceiverDto, UserReceiver, int>, IUserReceiverService
public UserReceiverService(IUserReceiverRepository repository, IMapper mapper)
: base(repository, mapper)
{
public UserReceiverService(IUserReceiverRepository repository, IMapper mapper)
: base(repository, mapper)
{
}
}
}

View File

@@ -0,0 +1,396 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.props" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{089D5634-FB6B-42D0-B912-7AA7457044E7}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>EnvelopeGenerator</RootNamespace>
<AssemblyName>EnvelopeGenerator</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<StartupObject>EnvelopeGenerator.Program</StartupObject>
<FileAlignment>512</FileAlignment>
<OptionExplicit>On</OptionExplicit>
<OptionCompare>Binary</OptionCompare>
<OptionStrict>Off</OptionStrict>
<OptionInfer>On</OptionInfer>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup>
<MyType>WindowsForms</MyType>
</PropertyGroup>
<PropertyGroup>
<StartupObject>EnvelopeGenerator.My.MyApplication</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
<HintPath>..\packages\BouncyCastle.Cryptography.2.5.0\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
</Reference>
<Reference Include="DevExpress.BonusSkins.v21.2" />
<Reference Include="DevExpress.Data.v21.2" />
<Reference Include="DevExpress.Data.Desktop.v21.2" />
<Reference Include="DevExpress.Dialogs.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Pdf.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Pdf.v21.2.Drawing, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Printing.v21.2.Core" />
<Reference Include="DevExpress.Utils.v21.2" />
<Reference Include="DevExpress.XtraBars.v21.2" />
<Reference Include="DevExpress.Sparkline.v21.2.Core" />
<Reference Include="DevExpress.XtraDialogs.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraEditors.v21.2" />
<Reference Include="DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraLayout.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraPdfViewer.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraTreeList.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DigitalData.Controls.DocumentViewer, Version=1.9.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DigitalData.Controls.DocumentViewer.1.9.8\lib\net462\DigitalData.Controls.DocumentViewer.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Base, Version=1.3.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DigitalData.Modules.Base.1.3.8\lib\net462\DigitalData.Modules.Base.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Config, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DigitalData.Modules.Config.1.3.0\lib\net462\DigitalData.Modules.Config.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Database, Version=2.3.5.4, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DigitalData.Modules.Database.2.3.5.4\lib\net462\DigitalData.Modules.Database.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Encryption, Version=1.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DigitalData.Modules.Encryption.1.3.1\lib\net462\DigitalData.Modules.Encryption.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Logging, Version=2.6.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DigitalData.Modules.Logging.2.6.5\lib\net462\DigitalData.Modules.Logging.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Messaging, Version=1.9.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DigitalData.Modules.Messaging.1.9.8\lib\net462\DigitalData.Modules.Messaging.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml, Version=3.2.0.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.3.2.0\lib\net46\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml.Framework, Version=3.2.0.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.Framework.3.2.0\lib\net46\DocumentFormat.OpenXml.Framework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.Firebird, Version=6.4.0.0, Culture=neutral, PublicKeyToken=42d22d092898e5f8, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.Firebird.6.4.0\lib\net452\EntityFramework.Firebird.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="EnvelopeGenerator.Common">
<HintPath>..\EnvelopeGenerator.Common\bin\Debug\EnvelopeGenerator.Common.dll</HintPath>
</Reference>
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=7.5.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
<HintPath>..\packages\FirebirdSql.Data.FirebirdClient.7.5.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.barcode.1d.writer, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.barcode.1d.writer.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.barcode.2d.writer, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.barcode.2d.writer.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.CAD, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.CAD.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.CAD.DWG, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.CAD.DWG.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.Common, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Common.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.Document, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Document.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.Email, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Email.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.HTML, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.HTML.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.Imaging, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.Imaging.Formats, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.Formats.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.Imaging.Formats.Conversion, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.Formats.Conversion.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.Imaging.Rendering, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.Imaging.Rendering.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.MSOfficeBinary, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.MSOfficeBinary.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.OpenDocument, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.OpenDocument.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.OpenXML, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.OpenXML.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.OpenXML.Templating, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.OpenXML.Templating.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.PDF, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.PDF.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.RTF, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.RTF.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.SVG, Version=14.3.3.0, Culture=neutral, PublicKeyToken=f52a2e60ad468dbb, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.SVG.dll</HintPath>
</Reference>
<Reference Include="GdPicture.NET.14.wia.gateway, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6973b5c22dcf45f7, processorArchitecture=MSIL">
<HintPath>..\packages\GdPicture.14.3.3\lib\net462\GdPicture.NET.14.wia.gateway.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.Cryptography, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Cryptography.9.0.0\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Identity.Client, Version=4.55.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Identity.Client.4.55.0\lib\net461\Microsoft.Identity.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Abstractions, Version=6.22.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Abstractions.6.22.0\lib\net461\Microsoft.IdentityModel.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json.Bson, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.Bson.1.0.2\lib\net45\Newtonsoft.Json.Bson.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="OpenMcdf, Version=2.4.1.0, Culture=neutral, PublicKeyToken=fdbb1629d7c00800, processorArchitecture=MSIL">
<HintPath>..\packages\OpenMcdf.2.4.1\lib\net40\OpenMcdf.dll</HintPath>
</Reference>
<Reference Include="protobuf-net, Version=3.0.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
<HintPath>..\packages\protobuf-net.3.2.46\lib\net462\protobuf-net.dll</HintPath>
</Reference>
<Reference Include="protobuf-net.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
<HintPath>..\packages\protobuf-net.Core.3.2.46\lib\net462\protobuf-net.Core.dll</HintPath>
</Reference>
<Reference Include="RtfPipe, Version=2.0.7677.4303, Culture=neutral, PublicKeyToken=5f6ab4ce530296d2, processorArchitecture=MSIL">
<HintPath>..\packages\RtfPipe.2.0.7677.4303\lib\net45\RtfPipe.dll</HintPath>
</Reference>
<Reference Include="S22.Imap, Version=3.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\S22.Imap.3.6.0.0\lib\net40\S22.Imap.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.CodeDom, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.CodeDom.9.0.0\lib\net462\System.CodeDom.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.9.0.0\lib\net462\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Odbc, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.Odbc.6.0.1\lib\net461\System.Data.Odbc.dll</HintPath>
</Reference>
<Reference Include="System.Formats.Asn1, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Formats.Asn1.9.0.0\lib\net462\System.Formats.Asn1.dll</HintPath>
</Reference>
<Reference Include="System.IdentityModel" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Packaging, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Packaging.9.0.0\lib\net462\System.IO.Packaging.dll</HintPath>
</Reference>
<Reference Include="System.IO.Pipelines, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.6.0.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.Security.Cryptography.Pkcs, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Pkcs.9.0.0\lib\net462\System.Security.Cryptography.Pkcs.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.9.0.0\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Windows.Forms" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="frmFieldEditor.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmFieldEditor.Designer.vb">
<DependentUpon>frmFieldEditor.vb</DependentUpon>
</Compile>
<Compile Include="frmFinalizePDF.Designer.vb">
<DependentUpon>frmFinalizePDF.vb</DependentUpon>
</Compile>
<Compile Include="frmFinalizePDF.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmReportViewer.Designer.vb">
<DependentUpon>frmReportViewer.vb</DependentUpon>
</Compile>
<Compile Include="frmReportViewer.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
<EmbeddedResource Include="frmFieldEditor.resx">
<DependentUpon>frmFieldEditor.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmFinalizePDF.resx">
<DependentUpon>frmFinalizePDF.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmReportViewer.resx">
<DependentUpon>frmReportViewer.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="My Project\licenses.licx" />
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="app.config" />
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Common\EnvelopeGenerator.Common.vbproj">
<Project>{6EA0C51F-C2B1-4462-8198-3DE0B32B74F8}</Project>
<Name>EnvelopeGenerator.Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="GdPicture.NET.14.barcode.1d.reader.64.dll" />
<Content Include="GdPicture.NET.14.barcode.1d.reader.dll" />
<Content Include="GdPicture.NET.14.barcode.2d.reader.64.dll" />
<Content Include="GdPicture.NET.14.barcode.2d.reader.dll" />
<Content Include="GdPicture.NET.14.filters.64.dll" />
<Content Include="GdPicture.NET.14.filters.dll" />
<Content Include="GdPicture.NET.14.image.gdimgplug.64.dll" />
<Content Include="GdPicture.NET.14.image.gdimgplug.dll" />
<Content Include="GdPicture.NET.14.Imaging.ML.64.dll" />
<Content Include="GdPicture.NET.14.Imaging.ML.dll" />
<Content Include="GdPicture.NET.14.Imaging.Rendering.Skia.64.dll" />
<Content Include="GdPicture.NET.14.Imaging.Rendering.Skia.dll" />
<Content Include="GdPicture.NET.14.machine.vision.64.dll" />
<Content Include="GdPicture.NET.14.machine.vision.dll" />
<Content Include="GdPicture.NET.14.twain.client.64.dll" />
<Content Include="GdPicture.NET.14.twain.client.dll" />
<Content Include="MailLicense.xml" />
<Content Include="README.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<Import Project="..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets" Condition="Exists('..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GdPicture.runtimes.windows.14.3.3\build\net462\GdPicture.runtimes.windows.targets'))" />
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
</Target>
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Some files were not shown because too many files have changed in this diff Show More