From 86bdb233c22db91f6cd6bf10a11a61be82a4f663 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Wed, 22 May 2024 09:54:49 +0200 Subject: [PATCH] =?UTF-8?q?EmailProfilerDispatcher=20hinzugef=C3=BCgt=20un?= =?UTF-8?q?d=20EnvelopeMailService=20erstellt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Contracts/IEmailOutService.cs | 11 --- .../Contracts/IEnvelopeMailService.cs | 8 ++ .../DTOs/EmailOutDto.cs | 25 ------ .../EnvelopeGenerator.Application.csproj | 9 ++ .../MappingProfiles/BasicDtoMappingProfile.cs | 2 - .../Services/EmailOutService.cs | 18 ---- .../Services/EnvelopeMailService.cs | 15 ++++ EnvelopeGenerator.Domain/Entities/EmailOut.cs | 89 ------------------- .../Contracts/IEmailOutRepository.cs | 9 -- .../Repositories/EmailOutRepository.cs | 14 --- .../EnvelopeGenerator.Web.csproj | 9 ++ EnvelopeGenerator.Web/Program.cs | 8 +- 12 files changed, 47 insertions(+), 170 deletions(-) delete mode 100644 EnvelopeGenerator.Application/Contracts/IEmailOutService.cs create mode 100644 EnvelopeGenerator.Application/Contracts/IEnvelopeMailService.cs delete mode 100644 EnvelopeGenerator.Application/DTOs/EmailOutDto.cs delete mode 100644 EnvelopeGenerator.Application/Services/EmailOutService.cs create mode 100644 EnvelopeGenerator.Application/Services/EnvelopeMailService.cs delete mode 100644 EnvelopeGenerator.Domain/Entities/EmailOut.cs delete mode 100644 EnvelopeGenerator.Infrastructure/Contracts/IEmailOutRepository.cs delete mode 100644 EnvelopeGenerator.Infrastructure/Repositories/EmailOutRepository.cs diff --git a/EnvelopeGenerator.Application/Contracts/IEmailOutService.cs b/EnvelopeGenerator.Application/Contracts/IEmailOutService.cs deleted file mode 100644 index e1f934b5..00000000 --- a/EnvelopeGenerator.Application/Contracts/IEmailOutService.cs +++ /dev/null @@ -1,11 +0,0 @@ -using DigitalData.Core.Contracts.Application; -using EnvelopeGenerator.Application.DTOs; -using EnvelopeGenerator.Domain.Entities; -using EnvelopeGenerator.Infrastructure.Contracts; - -namespace EnvelopeGenerator.Application.Contracts -{ - public interface IEmailOutService : IBasicCRUDService - { - } -} diff --git a/EnvelopeGenerator.Application/Contracts/IEnvelopeMailService.cs b/EnvelopeGenerator.Application/Contracts/IEnvelopeMailService.cs new file mode 100644 index 00000000..56d65cb6 --- /dev/null +++ b/EnvelopeGenerator.Application/Contracts/IEnvelopeMailService.cs @@ -0,0 +1,8 @@ +using DigitalData.EmailProfilerDispatcher.Application.Contracts; + +namespace EnvelopeGenerator.Application.Contracts +{ + public interface IEnvelopeMailService : IEmailOutService + { + } +} diff --git a/EnvelopeGenerator.Application/DTOs/EmailOutDto.cs b/EnvelopeGenerator.Application/DTOs/EmailOutDto.cs deleted file mode 100644 index 6455acf7..00000000 --- a/EnvelopeGenerator.Application/DTOs/EmailOutDto.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace EnvelopeGenerator.Application.DTOs -{ - public record EmailOutDto( - int Guid, - int ReminderTypeId, - int SendingProfile, - int ReferenceId, - string? ReferenceString, - int? EntityId, - int WfId, - string? WfReference, - string EmailAdress, - string EmailSubj, - string EmailBody, - string? EmailAttmt1, - DateTime? EmailSent, - string? Comment, - string AddedWho, - DateTime? AddedWhen, - string? ChangedWho, - DateTime? ChangedWhen, - DateTime? ErrorTimestamp, - string? ErrorMsg - ); -} diff --git a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj index 06b59406..e15e049b 100644 --- a/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj +++ b/EnvelopeGenerator.Application/EnvelopeGenerator.Application.csproj @@ -28,6 +28,15 @@ ..\..\WebUserManager\DigitalData.UserManager.Application\bin\Debug\net7.0\DigitalData.Core.Infrastructure.dll + + ..\..\EmailProfilerDispatcher\DigitalData.EmailProfilerDispatcher.Application\bin\Debug\net7.0\DigitalData.EmailProfilerDispatcher.Application.dll + + + ..\..\EmailProfilerDispatcher\DigitalData.EmailProfilerDispatcher.Application\bin\Debug\net7.0\DigitalData.EmailProfilerDispatcher.Domain.dll + + + ..\..\EmailProfilerDispatcher\DigitalData.EmailProfilerDispatcher.Application\bin\Debug\net7.0\DigitalData.EmailProfilerDispatcher.Infrastructure.dll + ..\..\WebUserManager\DigitalData.UserManager.Application\bin\Debug\net7.0\DigitalData.UserManager.Application.dll diff --git a/EnvelopeGenerator.Application/MappingProfiles/BasicDtoMappingProfile.cs b/EnvelopeGenerator.Application/MappingProfiles/BasicDtoMappingProfile.cs index b271c472..3102576d 100644 --- a/EnvelopeGenerator.Application/MappingProfiles/BasicDtoMappingProfile.cs +++ b/EnvelopeGenerator.Application/MappingProfiles/BasicDtoMappingProfile.cs @@ -23,7 +23,6 @@ namespace EnvelopeGenerator.Application.MappingProfiles CreateMap(); CreateMap(); CreateMap(); - CreateMap(); // DTO to Entity mappings CreateMap(); @@ -39,7 +38,6 @@ namespace EnvelopeGenerator.Application.MappingProfiles CreateMap(); CreateMap(); CreateMap(); - CreateMap(); } } } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/Services/EmailOutService.cs b/EnvelopeGenerator.Application/Services/EmailOutService.cs deleted file mode 100644 index 895f2f95..00000000 --- a/EnvelopeGenerator.Application/Services/EmailOutService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using AutoMapper; -using DigitalData.Core.Application; -using EnvelopeGenerator.Application.Contracts; -using EnvelopeGenerator.Application.DTOs; -using EnvelopeGenerator.Application.Resources; -using EnvelopeGenerator.Domain.Entities; -using EnvelopeGenerator.Infrastructure.Contracts; -using Microsoft.Extensions.Localization; - -namespace EnvelopeGenerator.Application.Services -{ - public class EmailOutService : BasicCRUDService, IEmailOutService - { - public EmailOutService(IEmailOutRepository repository, IStringLocalizer localizer, IMapper mapper) : base(repository, localizer, mapper) - { - } - } -} diff --git a/EnvelopeGenerator.Application/Services/EnvelopeMailService.cs b/EnvelopeGenerator.Application/Services/EnvelopeMailService.cs new file mode 100644 index 00000000..14841ffa --- /dev/null +++ b/EnvelopeGenerator.Application/Services/EnvelopeMailService.cs @@ -0,0 +1,15 @@ +using AutoMapper; +using DigitalData.EmailProfilerDispatcher.Application.Services; +using DigitalData.EmailProfilerDispatcher.Infrastructure.Contracts; +using DigitalData.UserManager.Application; +using EnvelopeGenerator.Application.Contracts; +using Microsoft.Extensions.Localization; +namespace EnvelopeGenerator.Application.Services +{ + public class EnvelopeMailService : EmailOutService, IEnvelopeMailService + { + public EnvelopeMailService(IEmailOutRepository repository, IStringLocalizer localizer, IMapper mapper, IEmailTemplateService tempService) : base(repository, localizer, mapper) + { + } + } +} \ No newline at end of file diff --git a/EnvelopeGenerator.Domain/Entities/EmailOut.cs b/EnvelopeGenerator.Domain/Entities/EmailOut.cs deleted file mode 100644 index 68ac00b1..00000000 --- a/EnvelopeGenerator.Domain/Entities/EmailOut.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EnvelopeGenerator.Domain.Entities -{ - [Table("TBEMLP_EMAIL_OUT", Schema = "dbo")] - public class EmailOut - { - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Column("GUID")] - public int Id { get; set; } - - [Required] - [Column("REMINDER_TYPE_ID")] - public int ReminderTypeId { get; set; } = 1; // Default value - - [Required] - [Column("SENDING_PROFILE")] - public int SendingProfile { get; set; } - - [Required] - [Column("REFERENCE_ID")] - public int ReferenceId { get; set; } - - [StringLength(200)] - [Column("REFERENCE_STRING")] - public string ReferenceString { get; set; } - - [Column("ENTITY_ID")] - public int? EntityId { get; set; } - - [Required] - [Column("WF_ID")] - public int WfId { get; set; } - - [StringLength(200)] - [Column("WF_REFERENCE")] - public string WfReference { get; set; } - - [Required] - [StringLength(1000)] - [Column("EMAIL_ADRESS")] - public string EmailAdress { get; set; } - - [Required] - [StringLength(500)] - [Column("EMAIL_SUBJ")] - public string EmailSubj { get; set; } - - [Required] - [Column("EMAIL_BODY")] - public string EmailBody { get; set; } - - [StringLength(512)] - [Column("EMAIL_ATTMT1")] - public string EmailAttmt1 { get; set; } - - [Column("EMAIL_SENT")] - public DateTime? EmailSent { get; set; } - - [StringLength(500)] - [Column("COMMENT")] - public string Comment { get; set; } - - [Required] - [StringLength(50)] - [Column("ADDED_WHO")] - public string AddedWho { get; set; } = "DEFAULT"; // Default value - - [Column("ADDED_WHEN")] - public DateTime? AddedWhen { get; set; } = DateTime.Now; // Default value - - [StringLength(50)] - [Column("CHANGED_WHO")] - public string ChangedWho { get; set; } - - [Column("CHANGED_WHEN")] - public DateTime? ChangedWhen { get; set; } - - [Column("ERROR_TIMESTAMP")] - public DateTime? ErrorTimestamp { get; set; } - - [StringLength(900)] - [Column("ERROR_MSG")] - public string ErrorMsg { get; set; } - } -} \ No newline at end of file diff --git a/EnvelopeGenerator.Infrastructure/Contracts/IEmailOutRepository.cs b/EnvelopeGenerator.Infrastructure/Contracts/IEmailOutRepository.cs deleted file mode 100644 index 1b7425f5..00000000 --- a/EnvelopeGenerator.Infrastructure/Contracts/IEmailOutRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using DigitalData.Core.Contracts.Infrastructure; -using EnvelopeGenerator.Domain.Entities; - -namespace EnvelopeGenerator.Infrastructure.Contracts -{ - public interface IEmailOutRepository : ICRUDRepository - { - } -} diff --git a/EnvelopeGenerator.Infrastructure/Repositories/EmailOutRepository.cs b/EnvelopeGenerator.Infrastructure/Repositories/EmailOutRepository.cs deleted file mode 100644 index 397e8b14..00000000 --- a/EnvelopeGenerator.Infrastructure/Repositories/EmailOutRepository.cs +++ /dev/null @@ -1,14 +0,0 @@ -using DigitalData.Core.Infrastructure; -using DigitalData.UserManager.Infrastructure.Repositories; -using EnvelopeGenerator.Domain.Entities; -using EnvelopeGenerator.Infrastructure.Contracts; - -namespace EnvelopeGenerator.Infrastructure.Repositories -{ - public class EmailOutRepository : CRUDRepository, IEmailOutRepository - { - public EmailOutRepository(EGDbContext dbContext) : base(dbContext) - { - } - } -} diff --git a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj index 6f4e9152..322ad5eb 100644 --- a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj +++ b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj @@ -62,6 +62,15 @@ ..\..\WebCoreModules\DigitalData.Core.Infrastructure\bin\Debug\net7.0\DigitalData.Core.Infrastructure.dll + + ..\..\EmailProfilerDispatcher\DigitalData.EmailProfilerDispatcher.Application\bin\Debug\net7.0\DigitalData.EmailProfilerDispatcher.Application.dll + + + ..\..\EmailProfilerDispatcher\DigitalData.EmailProfilerDispatcher.Application\bin\Debug\net7.0\DigitalData.EmailProfilerDispatcher.Domain.dll + + + ..\..\EmailProfilerDispatcher\DigitalData.EmailProfilerDispatcher.Application\bin\Debug\net7.0\DigitalData.EmailProfilerDispatcher.Infrastructure.dll + ..\..\DDModules\Base\bin\Debug\DigitalData.Modules.Base.dll diff --git a/EnvelopeGenerator.Web/Program.cs b/EnvelopeGenerator.Web/Program.cs index 856189a8..e67d56a1 100644 --- a/EnvelopeGenerator.Web/Program.cs +++ b/EnvelopeGenerator.Web/Program.cs @@ -17,6 +17,8 @@ using DigitalData.Core.DTO; using System.Text.Encodings.Web; using Ganss.Xss; using Microsoft.Extensions.Options; +using DigitalData.EmailProfilerDispatcher.Application; +using DigitalData.UserManager.Application; var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger(); logger.Info("Logging initialized!"); @@ -89,7 +91,6 @@ try builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); - builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); @@ -103,7 +104,6 @@ try builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); - builder.Services.AddScoped(); //Auto mapping profiles builder.Services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly); @@ -170,6 +170,10 @@ try builder.Services.Configure(builder.Configuration.GetSection("Cultures")); builder.Services.AddSingleton(sp => sp.GetRequiredService>().Value); + // Register mail services + builder.Services.AddScoped(); + builder.Services.AddDispatcher(); + var app = builder.Build(); // Configure the HTTP request pipeline.