Compare commits

...

6 Commits

33 changed files with 127 additions and 547 deletions

1
.gitignore vendored
View File

@@ -398,3 +398,4 @@ FodyWeavers.xsd
# JetBrains Rider
*.sln.iml
/DigitalData.EmailProfilerDispatcher.API/

View File

@@ -1,60 +0,0 @@
using DigitalData.Core.API;
using DigitalData.EmailProfilerDispatcher.API.Resources;
using DigitalData.EmailProfilerDispatcher.Application;
using DigitalData.EmailProfilerDispatcher.Application.Contracts;
using DigitalData.EmailProfilerDispatcher.Application.DTOs.EmailOut;
using DigitalData.EmailProfilerDispatcher.Application.Services;
using DigitalData.EmailProfilerDispatcher.Domain.Attributes;
using DigitalData.EmailProfilerDispatcher.Domain.Entities;
using DigitalData.EmailProfilerDispatcher.Infrastructure.Contracts;
using Microsoft.AspNetCore.Mvc;
namespace DigitalData.EmailProfilerGateway.API.Controllers
{
public class MailController : CRUDControllerBase<IEmailOutService, EmailOutCreateDto, EmailOutDto, EmailOutDto, EmailOut, int>
{
public MailController(ILogger<MailController> logger, IEmailOutService service) : base(logger, service)
{
}
[HttpGet("fill-out")]
public IActionResult FillOut(string? template = null)
{
template ??= @"Guten Tag [NAME_RECEIVER],<br />
<br />
hiermit bestätigen wir Ihnen die erfolgreiche Signatur für den Vorgang <B><I>'[DOCUMENT_TITLE]'</I></B>.<br />
Wenn alle Vertragspartner unterzeichnet haben, erhalten Sie ebenfalls per email ein unterschriebenes Exemplar mit dem Signierungszertifikat!
<br />
Mit freundlichen Grüßen<br />
<br />
[NAME_PORTAL]";
var mailData = new MailData();
var expectedOutput = @"Guten Tag Tom,<br />
<br />
hiermit bestätigen wir Ihnen die erfolgreiche Signatur für den Vorgang <B><I>'Vertragsdokument'</I></B>.<br />
Wenn alle Vertragspartner unterzeichnet haben, erhalten Sie ebenfalls per email ein unterschriebenes Exemplar mit dem Signierungszertifikat!
<br />
Mit freundlichen Grüßen<br />
<br />
DokumentenPortal";
var result = template.FillTemplate(mailData);
return Ok(result);
}
public class MailData
{
[TemplatePlaceholder("[NAME_RECEIVER]")]
public string NameReceiver { get; set; } = "Tom";
[TemplatePlaceholder("[DOCUMENT_TITLE]")]
public string DocumentTitle { get; set; } = "Vertragsdokument";
[TemplatePlaceholder("[NAME_PORTAL]")]
public string NamePortal { get; set; } = "DokumentenPortal";
}
}
}

View File

@@ -1,34 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Core.Abstractions" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.API" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.Application" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.DTO" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.Infrastructure" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.15" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.19" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.19" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="WebCore.Abstractions" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.Application\DigitalData.EmailProfilerDispatcher.Application.csproj" />
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.Domain\DigitalData.EmailProfilerDispatcher.Domain.csproj" />
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.Infrastructure\DigitalData.EmailProfilerDispatcher.Infrastructure.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,40 +0,0 @@
using DigitalData.Core.API;
using DigitalData.EmailProfilerDispatcher.API.Resources;
using DigitalData.EmailProfilerDispatcher.Application;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Localization;
var builder = WebApplication.CreateBuilder(args);
var config = builder.Configuration;
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddCookieBasedLocalizer();
builder.Services.AddDispatcher<Resource>(options => options.UseSqlServer(config.GetConnectionString("Default")));
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSingleton<IStringLocalizer, StringLocalizer<Resource>>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.UseCookieBasedLocalizer("de-DE", "en-US");
app.MapControllers();
app.Run();

View File

@@ -1,41 +0,0 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:6499",
"sslPort": 44381
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5231",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7115;http://localhost:5231",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -1,6 +0,0 @@
namespace DigitalData.EmailProfilerDispatcher.API.Resources
{
public class Resource
{
}
}

View File

@@ -1,101 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,101 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,8 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@@ -1,12 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -1,4 +1,4 @@
namespace DigitalData.EmailProfilerDispatcher.Domain.Attributes
namespace DigitalData.EmailProfilerDispatcher.Abstraction.Attributes
{
[AttributeUsage(AttributeTargets.Property)]
public class TemplatePlaceholderAttribute : Attribute

View File

@@ -1,7 +1,7 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.EmailProfilerDispatcher.Domain.Entities;
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
namespace DigitalData.EmailProfilerDispatcher.Infrastructure.Contracts
namespace DigitalData.EmailProfilerDispatcher.Abstraction.Contracts
{
public interface IEmailOutRepository : ICRUDRepository<EmailOut, int>
{

View File

@@ -1,9 +1,9 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using DigitalData.EmailProfilerDispatcher.Application.DTOs.EmailOut;
using DigitalData.EmailProfilerDispatcher.Domain.Entities;
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
namespace DigitalData.EmailProfilerDispatcher.Application.Contracts
namespace DigitalData.EmailProfilerDispatcher.Abstraction.Contracts
{
public interface IEmailOutService : ICRUDService<EmailOutCreateDto, EmailOutDto, EmailOutDto, EmailOut, int>
{

View File

@@ -1,4 +1,4 @@
namespace DigitalData.EmailProfilerDispatcher.Application.DTOs.EmailOut
namespace DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut
{
public record EmailOutCreateDto
{
@@ -6,9 +6,9 @@
public int SendingProfile { get; set; }
public int ReferenceId { get; set; }
public int WfId { get; set; }
public string EmailAddress { get; set; }
public string EmailSubj { get; set; }
public string EmailBody { get; set; }
public required string EmailAddress { get; set; }
public required string EmailSubj { get; set; }
public required string EmailBody { get; set; }
public string? ReferenceString { get; set; } = null;
public int? EntityId { get; set; } = null;
public string? WfReference { get; set; } = null;

View File

@@ -1,4 +1,4 @@
namespace DigitalData.EmailProfilerDispatcher.Application.DTOs.EmailOut
namespace DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut
{
public record EmailOutDto(
int Id,

View File

@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>DigitalData.EmailProfilerDispatcher.Abstraction</PackageId>
<Authors>Digital Data GmbH</Authors>
<Company>Digital Data GmbH</Company>
<Description>This package provides the necessary abstractions and interfaces for the DigitalData.EmailProfilerDispatcher library, facilitating a clean and decoupled architecture.</Description>
<Copyright>Copyright 2024</Copyright>
<PackageIcon>icon.png</PackageIcon>
<RepositoryUrl>http://git.dd:3000/AppStd/EmailProfilerDispatcher.git</RepositoryUrl>
<PackageTags>digital data email dispatcher abstraction</PackageTags>
</PropertyGroup>
<ItemGroup>
<None Include="..\DigitalData.EmailProfilerDispatcher\Assets\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Core.Abstractions" Version="1.0.1.1" />
</ItemGroup>
<ItemGroup>
<None Update="Assets\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>

View File

@@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DigitalData.EmailProfilerDispatcher.Domain.Entities
namespace DigitalData.EmailProfilerDispatcher.Abstraction.Entities
{
[Table("TBEMLP_EMAIL_OUT")]
public class EmailOut
@@ -43,16 +43,16 @@ namespace DigitalData.EmailProfilerDispatcher.Domain.Entities
[Required]
[Column("EMAIL_ADRESS", TypeName = "varchar(1000)")]
[StringLength(1000)]
public string EmailAddress { get; set; }
public required string EmailAddress { get; set; }
[Required]
[Column("EMAIL_SUBJ", TypeName = "varchar(500)")]
[StringLength(500)]
public string EmailSubj { get; set; }
public required string EmailSubj { get; set; }
[Required]
[Column("EMAIL_BODY", TypeName = "varchar(max)")]
public string EmailBody { get; set; }
public required string EmailBody { get; set; }
[Column("EMAIL_ATTMT1", TypeName = "varchar(512)")]
[StringLength(512)]
@@ -69,7 +69,7 @@ namespace DigitalData.EmailProfilerDispatcher.Domain.Entities
[Column("ADDED_WHO", TypeName = "varchar(50)")]
[StringLength(50)]
[DefaultValue("DEFAULT")]
public string AddedWho { get; set; }
public required string AddedWho { get; set; }
[Column("ADDED_WHEN")]
[DefaultValue("getdate()")]

View File

@@ -1,22 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="DigitalData.Core.Abstractions" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.Application" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.19" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.19" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.Domain\DigitalData.EmailProfilerDispatcher.Domain.csproj" />
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.Infrastructure\DigitalData.EmailProfilerDispatcher.Infrastructure.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,13 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Core.Abstractions" Version="1.0.0" />
</ItemGroup>
</Project>

View File

@@ -1,17 +0,0 @@
using DigitalData.EmailProfilerDispatcher.Infrastructure.Contracts;
using DigitalData.EmailProfilerDispatcher.Infrastructure.Repositories;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace DigitalData.EmailProfilerDispatcher.Infrastructure
{
public static class DIExtensions
{
public static IServiceCollection AddDispatcherRepository<TDbContext>(this IServiceCollection services) where TDbContext : DbContext => services
.AddScoped<IEmailOutRepository, EmailOutRepository<TDbContext>>();
public static IServiceCollection AddDispatcherRepository(this IServiceCollection services, Action<DbContextOptionsBuilder> optionsAction) => services
.AddDbContext<DefaultMailDbContext>(optionsAction)
.AddDispatcherRepository<DefaultMailDbContext>();
}
}

View File

@@ -1,25 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Core.Abstractions" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.Infrastructure" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.15" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.Domain\DigitalData.EmailProfilerDispatcher.Domain.csproj" />
</ItemGroup>
</Project>

View File

@@ -5,13 +5,11 @@ VisualStudioVersion = 17.9.34622.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalData.EmailProfilerDispatcher.API", "DigitalData.EmailProfilerDispatcher.API\DigitalData.EmailProfilerDispatcher.API.csproj", "{352BEA44-4D3E-4D22-B1B3-B3E06A928396}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalData.EmailProfilerDispatcher.Domain", "DigitalData.EmailProfilerDispatcher.Domain\DigitalData.EmailProfilerDispatcher.Domain.csproj", "{2F650B4D-65F4-4F91-89C0-803790612C4E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EmailProfilerDispatcher.Tests", "EmailProfilerDispatcher.Tests\EmailProfilerDispatcher.Tests.csproj", "{C55114DF-F7C9-47A6-AF36-99F6C8079DE2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalData.EmailProfilerDispatcher.Application", "DigitalData.EmailProfilerDispatcher.Application\DigitalData.EmailProfilerDispatcher.Application.csproj", "{4C42937A-944D-4AAB-A835-F7EEC2C8872F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalData.EmailProfilerDispatcher.Abstraction", "DigitalData.EmailProfilerDispatcher.Abstraction\DigitalData.EmailProfilerDispatcher.Abstraction.csproj", "{0647F6B7-BF49-4B1F-83E4-7C843A7F9775}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalData.EmailProfilerDispatcher.Infrastructure", "DigitalData.EmailProfilerDispatcher.Infrastructure\DigitalData.EmailProfilerDispatcher.Infrastructure.csproj", "{F02B6F5B-FB2F-4E20-996D-BE99E9768039}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmailProfilerDispatcher.Tests", "EmailProfilerDispatcher.Tests\EmailProfilerDispatcher.Tests.csproj", "{C55114DF-F7C9-47A6-AF36-99F6C8079DE2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalData.EmailProfilerDispatcher", "DigitalData.EmailProfilerDispatcher\DigitalData.EmailProfilerDispatcher.csproj", "{DF202B1D-6C6F-4354-9B73-20F03486D020}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -23,22 +21,18 @@ Global
{352BEA44-4D3E-4D22-B1B3-B3E06A928396}.Debug|Any CPU.Build.0 = Debug|Any CPU
{352BEA44-4D3E-4D22-B1B3-B3E06A928396}.Release|Any CPU.ActiveCfg = Release|Any CPU
{352BEA44-4D3E-4D22-B1B3-B3E06A928396}.Release|Any CPU.Build.0 = Release|Any CPU
{2F650B4D-65F4-4F91-89C0-803790612C4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F650B4D-65F4-4F91-89C0-803790612C4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F650B4D-65F4-4F91-89C0-803790612C4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F650B4D-65F4-4F91-89C0-803790612C4E}.Release|Any CPU.Build.0 = Release|Any CPU
{4C42937A-944D-4AAB-A835-F7EEC2C8872F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C42937A-944D-4AAB-A835-F7EEC2C8872F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C42937A-944D-4AAB-A835-F7EEC2C8872F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C42937A-944D-4AAB-A835-F7EEC2C8872F}.Release|Any CPU.Build.0 = Release|Any CPU
{F02B6F5B-FB2F-4E20-996D-BE99E9768039}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F02B6F5B-FB2F-4E20-996D-BE99E9768039}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F02B6F5B-FB2F-4E20-996D-BE99E9768039}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F02B6F5B-FB2F-4E20-996D-BE99E9768039}.Release|Any CPU.Build.0 = Release|Any CPU
{C55114DF-F7C9-47A6-AF36-99F6C8079DE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C55114DF-F7C9-47A6-AF36-99F6C8079DE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C55114DF-F7C9-47A6-AF36-99F6C8079DE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C55114DF-F7C9-47A6-AF36-99F6C8079DE2}.Release|Any CPU.Build.0 = Release|Any CPU
{0647F6B7-BF49-4B1F-83E4-7C843A7F9775}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{0647F6B7-BF49-4B1F-83E4-7C843A7F9775}.Debug|Any CPU.Build.0 = Release|Any CPU
{0647F6B7-BF49-4B1F-83E4-7C843A7F9775}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0647F6B7-BF49-4B1F-83E4-7C843A7F9775}.Release|Any CPU.Build.0 = Release|Any CPU
{DF202B1D-6C6F-4354-9B73-20F03486D020}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{DF202B1D-6C6F-4354-9B73-20F03486D020}.Debug|Any CPU.Build.0 = Release|Any CPU
{DF202B1D-6C6F-4354-9B73-20F03486D020}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF202B1D-6C6F-4354-9B73-20F03486D020}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -1,15 +1,15 @@
using DigitalData.EmailProfilerDispatcher.Application.Contracts;
using DigitalData.EmailProfilerDispatcher.Application.Services;
using DigitalData.EmailProfilerDispatcher.Infrastructure;
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using DigitalData.EmailProfilerDispatcher.Repositories;
using DigitalData.EmailProfilerDispatcher.Abstraction.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace DigitalData.EmailProfilerDispatcher.Application
namespace DigitalData.EmailProfilerDispatcher
{
public static class DIExtensions
{
public static IServiceCollection AddDispatcher<TDbContext>(this IServiceCollection services) where TDbContext : DbContext => services
.AddDispatcherRepository<TDbContext>()
.AddScoped<IEmailOutRepository, EmailOutRepository<TDbContext>>()
.AddAutoMapper(typeof(MappingProfile).Assembly)
.AddScoped<IEmailOutService, EmailOutService>();
@@ -17,4 +17,4 @@ namespace DigitalData.EmailProfilerDispatcher.Application
.AddDbContext<DefaultMailDbContext>(options)
.AddDispatcher<DefaultMailDbContext>();
}
}
}

View File

@@ -1,7 +1,7 @@
using DigitalData.EmailProfilerDispatcher.Domain.Entities;
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
using Microsoft.EntityFrameworkCore;
namespace DigitalData.EmailProfilerDispatcher.Infrastructure
namespace DigitalData.EmailProfilerDispatcher
{
public class DefaultMailDbContext : DbContext
{

View File

@@ -0,0 +1,42 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>DigitalData.EmailProfilerDispatcher</PackageId>
<Version>1.0.0</Version>
<Company>Digital Data GmbH</Company>
<Copyright>Copyright 2024</Copyright>
<PackageIcon>Assets\icon.png</PackageIcon>
<PackageTags>digital data email dispatcher</PackageTags>
<Description>DigitalData.EmailProfilerDispatcher enables adding data to the Email Profiler's SQL tables for systematic and batch email dispatching. It also supports dynamic and automatic template filling using attributes, allowing object property values to populate email templates.</Description>
<Authors>Digital Data GmbH</Authors>
<RepositoryUrl>http://git.dd:3000/AppStd/EmailProfilerDispatcher.git</RepositoryUrl>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="DigitalData.Core.Abstractions" Version="1.0.1.1" />
<PackageReference Include="DigitalData.Core.Application" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.Infrastructure" Version="1.0.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.16" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.19" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.19" />
<PackageReference Include="WebCore.Abstractions" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.Abstraction\DigitalData.EmailProfilerDispatcher.Abstraction.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Assets\icon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>

View File

@@ -1,8 +1,8 @@
using AutoMapper;
using DigitalData.EmailProfilerDispatcher.Application.DTOs.EmailOut;
using DigitalData.EmailProfilerDispatcher.Domain.Entities;
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
namespace DigitalData.EmailProfilerDispatcher.Application
namespace DigitalData.EmailProfilerDispatcher
{
public class MappingProfile : Profile
{

View File

@@ -1,10 +1,9 @@
using DigitalData.Core.Abstractions;
using DigitalData.Core.Infrastructure;
using DigitalData.EmailProfilerDispatcher.Domain.Entities;
using DigitalData.EmailProfilerDispatcher.Infrastructure.Contracts;
using DigitalData.Core.Infrastructure;
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
using Microsoft.EntityFrameworkCore;
namespace DigitalData.EmailProfilerDispatcher.Infrastructure.Repositories
namespace DigitalData.EmailProfilerDispatcher.Repositories
{
public class EmailOutRepository<TDbContext> : CRUDRepository<EmailOut, int, TDbContext>, IEmailOutRepository
where TDbContext : DbContext

View File

@@ -1,12 +1,11 @@
using AutoMapper;
using DigitalData.Core.Application;
using DigitalData.Core.DTO;
using DigitalData.EmailProfilerDispatcher.Application.Contracts;
using DigitalData.EmailProfilerDispatcher.Application.DTOs.EmailOut;
using DigitalData.EmailProfilerDispatcher.Domain.Entities;
using DigitalData.EmailProfilerDispatcher.Infrastructure.Contracts;
using DigitalData.EmailProfilerDispatcher.Abstraction.Contracts;
using DigitalData.EmailProfilerDispatcher.Abstraction.DTOs.EmailOut;
using DigitalData.EmailProfilerDispatcher.Abstraction.Entities;
namespace DigitalData.EmailProfilerDispatcher.Application.Services
namespace DigitalData.EmailProfilerDispatcher.Abstraction.Services
{
public class EmailOutService : CRUDService<IEmailOutRepository, EmailOutCreateDto, EmailOutDto, EmailOutDto, EmailOut, int>, IEmailOutService
{

View File

@@ -1,12 +1,7 @@
using DigitalData.EmailProfilerDispatcher.Domain.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace DigitalData.EmailProfilerDispatcher.Application
namespace DigitalData.EmailProfilerDispatcher
{
public static class TemplateExtensions
{

View File

@@ -11,7 +11,6 @@
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.2.0" />
<PackageReference Include="DigitalData.Core.Abstractions" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.Application" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
@@ -22,8 +21,6 @@
<ItemGroup>
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.API\DigitalData.EmailProfilerDispatcher.API.csproj" />
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.Application\DigitalData.EmailProfilerDispatcher.Application.csproj" />
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.Domain\DigitalData.EmailProfilerDispatcher.Domain.csproj" />
<ProjectReference Include="..\DigitalData.EmailProfilerDispatcher.Infrastructure\DigitalData.EmailProfilerDispatcher.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,7 +1,5 @@
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using DigitalData.EmailProfilerDispatcher.Application;
using DigitalData.EmailProfilerDispatcher.Application.Services;
using DigitalData.EmailProfilerDispatcher.Domain.Attributes;
using DigitalData.EmailProfilerDispatcher.Domain.Entities;
using System.Diagnostics.Tracing;
namespace EmailProfilerDispatcher.Tests