This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,7 @@
namespace Kreta.Job.Tasks.Core
{
public interface IConnectionStringCacheJob
{
void ResetAllConnectionString();
}
}

View file

@ -0,0 +1,10 @@
using Hangfire;
namespace Kreta.Job.Tasks.Core
{
public interface IDeleteInvalidLinksJob
{
[AutomaticRetry(Attempts = 1)]
void DeleteInvalidLinks();
}
}

View file

@ -0,0 +1,10 @@
using Hangfire;
namespace Kreta.Job.Tasks.Core
{
public interface IEESZTInterfaceJob
{
[AutomaticRetry(Attempts = 1)]
void GetEESZTAllomany();
}
}

View file

@ -0,0 +1,14 @@
namespace Kreta.Job.Tasks.Core
{
using System.Collections.Generic;
using System.Threading.Tasks;
using Hangfire;
using Kreta.Job.Tasks.Core.Models;
public interface IEmailJob
{
[AutomaticRetry(Attempts = 5)]
Task SendMailAsync(EmailModel emailModel);
void SendMailMessages(List<EmailModel> emailJobList);
}
}

View file

@ -0,0 +1,18 @@
namespace Kreta.Job.Tasks.Core
{
using Hangfire;
using Hangfire.Server;
using static Kreta.Core.Constants;
public interface IEugyintezesJob
{
[AutomaticRetry(Attempts = General.BaiAdatszinkronRetryAttempts)]
void BaiSzinkronizacio(PerformContext context, string baseUrl, string apiKey, string intezmenyAzonosio, int kretaId, string jsonData);
[AutomaticRetry(Attempts = General.EugySzinkronRetryAttempts)]
void TeremBerbeadhatoStatuszValtozas(PerformContext context, string baseUrl, string apiKey, string intezmenyAzonosio, string jsonData);
[AutomaticRetry(Attempts = General.EugySzinkronRetryAttempts)]
void TanuloOsztalyBesorolasStatuszValtozas(PerformContext context, string baseUrl, string apiKey, string intezmenyAzonosio, string jsonData);
}
}

View file

@ -0,0 +1,7 @@
namespace Kreta.Job.Tasks.Core
{
public interface IFeltoltesJob
{
void FeltoltesUjVerzioDal(int iktatottDokumentumId, string intezmenyAzonosito, int intezmenyId, int tanevId);
}
}

View file

@ -0,0 +1,11 @@
namespace Kreta.Job.Tasks.Core
{
public interface IIktatasJob
{
void FoszamosIktatasDal(int iktatottDokumentumId, int iktatoId, int partnerId, string intezmenyAzonosito, int intezmenyId, int tanevId, Hangfire.Server.PerformContext context);
void AlszamosIktatasDal(int iktatottDokumentumId, int parentDokumentumId, int iktatoId, int partnerId, string intezmenyAzonosito, int intezmenyId, int tanevId, Hangfire.Server.PerformContext context);
}
public delegate void OnAttemptsReached(string jobId);
}

View file

@ -0,0 +1,10 @@
using Hangfire;
namespace Kreta.Job.Tasks.Core
{
public interface IMkbBankszamlaIgenylesJob
{
[AutomaticRetry(Attempts = 1)]
void MkbBankszamlaIgenyles();
}
}

View file

@ -0,0 +1,47 @@
using Hangfire;
using Hangfire.Server;
namespace Kreta.Job.Tasks.Core
{
public interface INotificationJob
{
#region Mobil Push notification
[DisableConcurrentExecution(0)]
[AutomaticRetry(Attempts = 0, OnAttemptsExceeded = AttemptsExceededAction.Fail)]
void SendErtekelesNotification();
[DisableConcurrentExecution(0)]
[AutomaticRetry(Attempts = 0, OnAttemptsExceeded = AttemptsExceededAction.Fail)]
void SendHazifeladatNotification();
[DisableConcurrentExecution(0)]
[AutomaticRetry(Attempts = 0, OnAttemptsExceeded = AttemptsExceededAction.Fail)]
void SendRendszerUzenetNotification();
[DisableConcurrentExecution(0)]
[AutomaticRetry(Attempts = 0, OnAttemptsExceeded = AttemptsExceededAction.Fail)]
void SendBejelentettSzamonkeresNotification();
[DisableConcurrentExecution(0)]
[AutomaticRetry(Attempts = 0, OnAttemptsExceeded = AttemptsExceededAction.Fail)]
void SendFeljegyzesNotification();
[DisableConcurrentExecution(0)]
[AutomaticRetry(Attempts = 0, OnAttemptsExceeded = AttemptsExceededAction.Fail)]
void SendMulasztasNotification();
[DisableConcurrentExecution(0)]
[AutomaticRetry(Attempts = 2, OnAttemptsExceeded = AttemptsExceededAction.Fail)]
void SendOrarendValtozasNotification(PerformContext context);
#endregion
[AutomaticRetry(Attempts = 1)]
void SendKozelgoFogadooraMail();
[AutomaticRetry(Attempts = 1)]
void SendNemNaplozottTanorakMail();
}
}

View file

@ -0,0 +1,10 @@
using Hangfire;
namespace Kreta.Job.Tasks.Core
{
public interface IOtpBankszamlaIgenylesJob
{
[AutomaticRetry(Attempts = 1)]
void OtpBankszamlaIgenyles();
}
}

View file

@ -0,0 +1,10 @@
using Hangfire;
namespace Kreta.Job.Tasks.Core
{
public interface ISapJob
{
[AutomaticRetry(Attempts = 0)]
void SyncJobKeretEsTavollet();
}
}

View file

@ -0,0 +1,7 @@
namespace Kreta.Job.Tasks.Core
{
public interface ISzakkepzesiJuttatasUpdateJob
{
void UpdateSzakkepzesiJuttatasok();
}
}

View file

@ -0,0 +1,7 @@
namespace Kreta.Job.Tasks.Core
{
public interface ITavolletIktatasJob
{
void AddCsatolmanyokDokumentumhoz(int iktatottDokumentumId, int csatolmanyId, string intezmenyAzonosito, int tanevId, Hangfire.Server.PerformContext context);
}
}

View file

@ -0,0 +1,13 @@
using Hangfire;
namespace Kreta.Job.Tasks.Core
{
public interface ITavolletJob
{
[AutomaticRetry(Attempts = 0)]
void SyncTavolletIktatott();
[AutomaticRetry(Attempts = 0)]
void SendOutTavolletReminderEmails();
}
}

View file

@ -0,0 +1,10 @@
using Hangfire;
namespace Kreta.Job.Tasks.Core
{
public interface IUpdateCOVIDFlagJob
{
[AutomaticRetry(Attempts = 1)]
void UpdateCOVIDFlag();
}
}

View file

@ -0,0 +1,10 @@
using Hangfire;
namespace Kreta.Job.Tasks.Core
{
public interface IUpdateTanuloDualisSzerzodeseiJob
{
[AutomaticRetry(Attempts = 1)]
void UpdateTanuloDualisSzerzodesei();
}
}

View file

@ -0,0 +1,47 @@
using System;
using System.Linq;
using Hangfire.States;
namespace Kreta.Job.Tasks.Core
{
public class JobStateWatcherAttribute : Hangfire.Common.JobFilterAttribute, Hangfire.States.IElectStateFilter
{
public OnAttemptsReached AttemptsReached { get; set; }
public JobStateWatcherAttribute(Type delegateInstance, string delegateName)
{
try
{
AttemptsReached = (OnAttemptsReached)Delegate.CreateDelegate(typeof(OnAttemptsReached), delegateInstance, delegateName);
}
catch (Exception ex)
{
throw new ApplicationException("OnAttemptsReached típusúnak kell lennie a delegáltnak.", ex);
}
}
public void OnStateElection(ElectStateContext context)
{
var state = context.CandidateState as FailedState;
if (state == null)
{
return;
}
var actualRetryCount = context.GetJobParameter<int>("RetryCount");
var automaticRetryAttribute = context.BackgroundJob.Job.Method.CustomAttributes.FirstOrDefault(x => x.AttributeType == typeof(Hangfire.AutomaticRetryAttribute));
if (automaticRetryAttribute != null)
{
var attempts = automaticRetryAttribute.NamedArguments.FirstOrDefault(x => x.MemberName == "Attempts");
if (attempts.MemberInfo != null)
{
int maxRetryCounts = (int)attempts.TypedValue.Value;
if (maxRetryCounts == actualRetryCount)
{
AttemptsReached?.Invoke(context.BackgroundJob.Id);
}
}
}
}
}
}

View file

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5DC12A8B-4730-400F-BBE3-0A9072D6B2EE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Kreta.Job.Tasks.Core</RootNamespace>
<AssemblyName>Kreta.Job.Tasks.Core</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Hangfire.Core, Version=1.7.27.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Hangfire.Core.1.7.27\lib\net46\Hangfire.Core.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Tools\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="IEESZTInterfaceJob.cs" />
<Compile Include="IConnectionStringCacheJob.cs" />
<Compile Include="IOtpBankszamlaIgenylesJob.cs" />
<Compile Include="IUpdateTanuloDualisSzerzodeseiJob.cs" />
<Compile Include="ITavolletIktatasJob.cs" />
<Compile Include="IUpdateCOVIDFlagJob.cs" />
<Compile Include="IMkbBankszamlaIgenylesJob.cs" />
<Compile Include="IEmailJob.cs" />
<Compile Include="IDeleteInvalidLinksJob.cs" />
<Compile Include="IEugyintezesJob.cs" />
<Compile Include="IFeltoltesJob.cs" />
<Compile Include="IIktatasJob.cs" />
<Compile Include="INotificationJob.cs" />
<Compile Include="ISapJob.cs" />
<Compile Include="ISzakkepzesiJuttatasUpdateJob.cs" />
<Compile Include="ITavolletJob.cs" />
<Compile Include="JobStateWatcherAttribute.cs" />
<Compile Include="Models\EmailModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Kreta.Core\Kreta.Core.csproj">
<Project>{57418d3e-caf1-482c-9b18-85d147abd495}</Project>
<Name>Kreta.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Kreta.DataAccessManual\Kreta.DataAccessManual.csproj">
<Project>{3212f2bf-6883-48b4-9f7d-0dff4c826221}</Project>
<Name>Kreta.DataAccessManual</Name>
</ProjectReference>
<ProjectReference Include="..\Kreta.Resources\Kreta.Resources.csproj">
<Project>{DFCB4D33-B599-42B2-98C6-B60FD220DB0C}</Project>
<Name>Kreta.Resources</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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>

View file

@ -0,0 +1,54 @@
using System;
using Kreta.Core.Logic;
using Kreta.Resources;
namespace Kreta.Job.Tasks.Core.Models
{
public class EmailModel
{
public EmailModel(string intezmenyAzonosito = null, Guid? guid = null)
{
string url = UrlLogic.GetEmailKezelesUrl(intezmenyAzonosito, guid);
Footer = FooterBuilder(url);
}
public string Message { get; set; }
public string Footer { get; set; }
public string Subject { get; set; }
public string TargetEmail { get; set; }
public string FromEmail { get; set; }
public byte[] Buffer { get; set; }
public string FileName { get; set; }
public string Bcc { get; set; }
private string FooterBuilder(string url)
{
string footerString = $@"
<br/>
{EmailResource.EmailNoReplyFooter}
<br/>
<span style='font-size:10px;'>
<i>
{EmailResource.EmailTitoktartasFooter}
<br/>
<br/>
{EmailResource.EmailAngolTitoktartasFooter}
</i>
</span>";
if (!string.IsNullOrWhiteSpace(url))
{
footerString += $@"
<br/>
<br/>
<div style='text-align:center;'>
<a href='{url}'>
<span style='font-size:10px;'>{EmailResource.EmailHibasnakJelolesFooter}</span>
</a>
</div>";
}
return footerString;
}
}
}

View file

@ -0,0 +1 @@


View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Hangfire.Core" version="1.7.27" targetFramework="net48" />
<package id="Meziantou.Analyzer" version="1.0.688" targetFramework="net48" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
<package id="Owin" version="1.0" targetFramework="net48" />
</packages>