Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#361 - Add Middleware version to QueueItem entity #368

Merged
merged 24 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f87d4fb
Added the updated package to the Middleware and update the Storage im…
pawelvds Nov 27, 2024
4a43a6a
Merge remote-tracking branch 'origin/main' into #361-Add-Middleware-v…
forsthug Nov 27, 2024
92b4b48
Updated the fiskaltrust.storage package to version 1.3.66 in multiple…
pawelvds Nov 27, 2024
ed2c4ea
Merge remote-tracking branch 'origin/#361-Add-Middleware-version-to-Q…
pawelvds Nov 27, 2024
4735243
Added ES-related tasks for configuration repositories
pawelvds Nov 27, 2024
755fd9f
Remove duplicate method and alias imports
pawelvds Nov 27, 2024
f1b831c
Update namespace for ftJournalFRCopyPayload references
pawelvds Nov 27, 2024
f3bbe82
Fix ProcessingVersion column and index constraints in ftQueueItem table
pawelvds Nov 27, 2024
567e6de
Add stub methods for Spanish queues and signature units
pawelvds Nov 27, 2024
1ee8f26
Update rest fiskaltrust.storage package to version 1.3.66
pawelvds Nov 27, 2024
8c7e4c8
Add ftJournalFRCopyPayload aliases to various files
pawelvds Nov 27, 2024
d439b37
increase delay
forsthug Nov 28, 2024
5d9158b
try delay 10
forsthug Nov 28, 2024
26b7eaf
Remove ProcessingVersion from queue item Azure Table Storage
pawelvds Nov 28, 2024
acd9e95
Removed individual fiskaltrust.storage package references from multip…
pawelvds Nov 28, 2024
52997d7
Replaced the existing pre-release version 1.3.46-rc1 with stable vers…
pawelvds Nov 28, 2024
07d7535
Adjust package references
pawelvds Nov 28, 2024
dd0d632
Initialize ProcessingVersion in test setup
pawelvds Nov 28, 2024
566c9a1
Added a default "0.0.0" ProcessingVersion to entries if not set in Az…
pawelvds Nov 28, 2024
c79dec6
Updated the `EntityUpdated` method to assign a default processing ver…
pawelvds Nov 28, 2024
0777dea
Add ProcessingVersion to AzureTableStorageQueueItem mapping
pawelvds Nov 29, 2024
3cd19c4
Remove ProcessingVersion index and default value logic
pawelvds Nov 29, 2024
53f46ff
Updated SignProcessor to include processing version in queue items b…
pawelvds Dec 2, 2024
4a6855e
Make VersionHelper class static and optimize version retrieval
pawelvds Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public ICaseConverter CreateInstance(long ftReceiptCase)
0x4652000000000000 => new CaseConverterFR(),
_ => throw new Exception("The recieved code is not valid")
};
;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions"
Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.Linq.Async" Version="4.1.1" />
Expand All @@ -35,21 +34,14 @@
</ItemGroup>

<ItemGroup>
<ProjectReference
Include="..\fiskaltrust.Middleware.Contracts\fiskaltrust.Middleware.Contracts.csproj"
PrivateAssets="all" />
<ProjectReference
Include="..\fiskaltrust.Middleware.Queue\fiskaltrust.Middleware.Queue.csproj"
PrivateAssets="all" />
<ProjectReference
Include="..\fiskaltrust.Middleware.Storage.AzureTableStorage\fiskaltrust.Middleware.Storage.AzureTableStorage.csproj"
PrivateAssets="all" />
<ProjectReference Include="..\fiskaltrust.Middleware.Contracts\fiskaltrust.Middleware.Contracts.csproj" PrivateAssets="all" />
<ProjectReference Include="..\fiskaltrust.Middleware.Queue\fiskaltrust.Middleware.Queue.csproj" PrivateAssets="all" />
<ProjectReference Include="..\fiskaltrust.Middleware.Storage.AzureTableStorage\fiskaltrust.Middleware.Storage.AzureTableStorage.csproj" PrivateAssets="all" />
</ItemGroup>

<Target DependsOnTargets="ResolveReferences" Name="CopyProjectReferencesToPackage">
<ItemGroup>
<BuildOutputInPackage
Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
</ItemGroup>
</Target>

Expand All @@ -58,4 +50,8 @@
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Update="fiskaltrust.storage" Version="1.3.66" />
pawelvds marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Update="fiskaltrust.storage" Version="1.3.66" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<ProjectReference Include="..\fiskaltrust.Middleware.Storage.InMemory\fiskaltrust.Middleware.Storage.InMemory.csproj" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="fiskaltrust.storage" Version="1.3.66" />
pawelvds marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<Target DependsOnTargets="ResolveReferences" Name="CopyProjectReferencesToPackage">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
<ProjectReference Include="..\fiskaltrust.Middleware.Storage.MySQL\fiskaltrust.Middleware.Storage.MySQL.csproj" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="fiskaltrust.storage" Version="1.3.66" />
pawelvds marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<Target DependsOnTargets="ResolveReferences" Name="CopyProjectReferencesToPackage">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Update="fiskaltrust.storage" Version="1.3.66" />
pawelvds marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Update="fiskaltrust.storage" Version="1.3.66" />
pawelvds marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<Target DependsOnTargets="ResolveReferences" Name="CopyProjectReferencesToPackage">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ public AzureTableStorageConfigurationRepository(QueueConfiguration queueConfig,
public async Task InsertOrUpdateQueueATAsync(ftQueueAT queueAT) => await _queueATRepository.InsertOrUpdateAsync(queueAT).ConfigureAwait(false);

public async Task<ftQueueDE> GetQueueDEAsync(Guid id) => await _queueDERepository.GetAsync(id).ConfigureAwait(false);
public Task<IEnumerable<ftQueueES>> GetQueueESListAsync() => throw new NotImplementedException();

public Task<ftQueueES> GetQueueESAsync(Guid queueESId) => throw new NotImplementedException();

public async Task<IEnumerable<ftQueueDE>> GetQueueDEListAsync() => await _queueDERepository.GetAsync().ConfigureAwait(false);
public async Task InsertOrUpdateQueueDEAsync(ftQueueDE queueDE) => await _queueDERepository.InsertOrUpdateAsync(queueDE).ConfigureAwait(false);
public Task InsertOrUpdateQueueESAsync(ftQueueES queue) => throw new NotImplementedException();

public async Task<ftQueueFR> GetQueueFRAsync(Guid id) => await _queueFRRepository.GetAsync(id).ConfigureAwait(false);
public async Task<IEnumerable<ftQueueFR>> GetQueueFRListAsync() => await _queueFRRepository.GetAsync().ConfigureAwait(false);
Expand All @@ -74,8 +79,13 @@ public AzureTableStorageConfigurationRepository(QueueConfiguration queueConfig,
public async Task InsertOrUpdateSignaturCreationUnitATAsync(ftSignaturCreationUnitAT scu) => await _signaturCreationUnitATRepository.InsertOrUpdateAsync(scu).ConfigureAwait(false);

public async Task<ftSignaturCreationUnitDE> GetSignaturCreationUnitDEAsync(Guid id) => await _signaturCreationUnitDERepository.GetAsync(id).ConfigureAwait(false);
public Task<IEnumerable<ftSignaturCreationUnitES>> GetSignaturCreationUnitESListAsync() => throw new NotImplementedException();

public Task<ftSignaturCreationUnitES> GetSignaturCreationUnitESAsync(Guid signaturCreationUnitESId) => throw new NotImplementedException();

public async Task<IEnumerable<ftSignaturCreationUnitDE>> GetSignaturCreationUnitDEListAsync() => await _signaturCreationUnitDERepository.GetAsync().ConfigureAwait(false);
public async Task InsertOrUpdateSignaturCreationUnitDEAsync(ftSignaturCreationUnitDE scu) => await _signaturCreationUnitDERepository.InsertOrUpdateAsync(scu).ConfigureAwait(false);
public Task InsertOrUpdateSignaturCreationUnitESAsync(ftSignaturCreationUnitES scu) => throw new NotImplementedException();

public async Task<ftSignaturCreationUnitFR> GetSignaturCreationUnitFRAsync(Guid id) => await _signaturCreationUnitFRRepository.GetAsync(id).ConfigureAwait(false);
public async Task<IEnumerable<ftSignaturCreationUnitFR>> GetSignaturCreationUnitFRListAsync() => await _signaturCreationUnitFRRepository.GetAsync().ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
Expand All @@ -19,6 +18,7 @@ namespace fiskaltrust.Middleware.Storage.AzureTableStorage.Repositories
public class AzureTableStorageQueueItemRepository : BaseAzureTableStorageRepository<Guid, TableEntity, ftQueueItem>, IMiddlewareQueueItemRepository, IMiddlewareRepository<ftQueueItem>
{
private readonly AzureTableStorageReceiptReferenceIndexRepository _receiptReferenceIndexRepository;

public AzureTableStorageQueueItemRepository(QueueConfiguration queueConfig, TableServiceClient tableServiceClient, AzureTableStorageReceiptReferenceIndexRepository receiptReferenceIndexRepository)
: base(queueConfig, tableServiceClient, TABLE_NAME)
{
Expand Down Expand Up @@ -54,7 +54,8 @@ protected override TableEntity MapToAzureEntity(ftQueueItem src)
{ nameof(ftQueueItem.ftQueueMoment), src.ftQueueMoment.ToUniversalTime() },
{ nameof(ftQueueItem.ftQueueRow), src.ftQueueRow },
{ nameof(ftQueueItem.ftQueueId), src.ftQueueId },
{ nameof(ftQueueItem.TimeStamp), src.TimeStamp }
{ nameof(ftQueueItem.TimeStamp), src.TimeStamp },
{ nameof(ftQueueItem.ProcessingVersion), src.ProcessingVersion }
};

entity.SetOversized(nameof(ftQueueItem.request), src.request);
Expand Down Expand Up @@ -88,7 +89,8 @@ protected override ftQueueItem MapToStorageEntity(TableEntity src)
ftQueueId = src.GetGuid(nameof(ftQueueItem.ftQueueId)).GetValueOrDefault(),
TimeStamp = src.GetInt64(nameof(ftQueueItem.TimeStamp)).GetValueOrDefault(),
request = src.GetOversized(nameof(ftQueueItem.request)),
response = src.GetOversized(nameof(ftQueueItem.response))
response = src.GetOversized(nameof(ftQueueItem.response)),
ProcessingVersion = src.GetString(nameof(ftQueueItem.ProcessingVersion))
};
}

Expand All @@ -103,6 +105,7 @@ public override async Task InsertAsync(ftQueueItem storageEntity)
public async Task InsertOrUpdateAsync(ftQueueItem storageEntity)
{
EntityUpdated(storageEntity);
storageEntity.ProcessingVersion = "1.0.0";
var entity = MapToAzureEntity(storageEntity);
await _tableClient.UpsertEntityAsync(entity, TableUpdateMode.Replace);
await _receiptReferenceIndexRepository.InsertOrUpdateAsync(new ReceiptReferenceIndex { cbReceiptReference = storageEntity.cbReceiptReference, ftQueueItemId = storageEntity.ftQueueItemId });
Expand Down Expand Up @@ -156,7 +159,7 @@ from queueItem in await GetAsync()
where
(fromIncl.HasValue ? queueItem.TimeStamp >= fromIncl.Value : true) &&
(toIncl.HasValue ? queueItem.TimeStamp <= toIncl.Value : true) &&
(!string.IsNullOrEmpty(queueItem.response)) && JsonConvert.DeserializeObject<ReceiptRequest>(queueItem.request).IncludeInReferences()
!string.IsNullOrEmpty(queueItem.response) && JsonConvert.DeserializeObject<ReceiptRequest>(queueItem.request).IncludeInReferences()
group queueItem by queueItem.cbReceiptReference into newGroup
orderby newGroup.Key
select newGroup.Key;
Expand All @@ -170,7 +173,7 @@ public async IAsyncEnumerable<ftQueueItem> GetQueueItemsForReceiptReferenceAsync
{
var queueItemsForReceiptReference =
from queueItem in GetByReceiptReferenceAsync(receiptReference).ToEnumerable()
where (!string.IsNullOrEmpty(queueItem.response)) && JsonConvert.DeserializeObject<ReceiptRequest>(queueItem.request).IncludeInReferences()
where !string.IsNullOrEmpty(queueItem.response) && JsonConvert.DeserializeObject<ReceiptRequest>(queueItem.request).IncludeInReferences()
orderby queueItem.TimeStamp
select queueItem;
await foreach (var entry in queueItemsForReceiptReference.ToAsyncEnumerable())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
<PackageReference Include="Azure.Identity" Version="1.8.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.14.1" />
<PackageReference Include="System.Interactive.Async" Version="4.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions"
Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.4" />
<PackageReference Include="System.Linq.Async" Version="4.1.1" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.1" />
<PackageReference Include="fiskaltrust.storage.encryption" Version="1.3.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference
Include="..\fiskaltrust.Middleware.Storage.Base\fiskaltrust.Middleware.Storage.Base.csproj" />
<ProjectReference Include="..\fiskaltrust.Middleware.Storage.Base\fiskaltrust.Middleware.Storage.Base.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="fiskaltrust.storage" Version="1.3.66" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using fiskaltrust.Middleware.Contracts.Models.Transactions;
using fiskaltrust.storage.V0;
using fiskaltrust.storage.V0.MasterData;
using ftJournalFRCopyPayload = fiskaltrust.Middleware.Contracts.Models.FR.ftJournalFRCopyPayload;

namespace fiskaltrust.Middleware.Storage.EF
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace fiskaltrust.Middleware.Storage.EF.Migrations
{
using System;
using System.Data.Entity.Migrations;

public partial class FixProcessingVersionIndex : DbMigration
{
public override void Up()
{
AddColumn("dbo.ftQueueItem", "ProcessingVersion", c => c.String(maxLength: 450));
CreateIndex("dbo.ftQueueItem", "ProcessingVersion");
pawelvds marked this conversation as resolved.
Show resolved Hide resolved
}

public override void Down()
{
DropIndex("dbo.ftQueueItem", new[] { "ProcessingVersion" });
DropColumn("dbo.ftQueueItem", "ProcessingVersion");
}
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ public EfConfigurationRepository(MiddlewareDbContext dbContext)
public async Task InsertOrUpdateQueueATAsync(ftQueueAT queueAT) => await _queueATRepository.InsertOrUpdateAsync(queueAT).ConfigureAwait(false);

public async Task<ftQueueDE> GetQueueDEAsync(Guid id) => await _queueDERepository.GetAsync(id).ConfigureAwait(false);
public Task<IEnumerable<ftQueueES>> GetQueueESListAsync() => throw new NotImplementedException();

public Task<ftQueueES> GetQueueESAsync(Guid queueESId) => throw new NotImplementedException();

public async Task<IEnumerable<ftQueueDE>> GetQueueDEListAsync() => await _queueDERepository.GetAsync().ConfigureAwait(false);
public async Task InsertOrUpdateQueueDEAsync(ftQueueDE queueDE) => await _queueDERepository.InsertOrUpdateAsync(queueDE).ConfigureAwait(false);
public Task InsertOrUpdateQueueESAsync(ftQueueES queue) => throw new NotImplementedException();

public async Task<ftQueueFR> GetQueueFRAsync(Guid id) => await _queueFRRepository.GetAsync(id).ConfigureAwait(false);
public async Task<IEnumerable<ftQueueFR>> GetQueueFRListAsync() => await _queueFRRepository.GetAsync().ConfigureAwait(false);
Expand All @@ -73,8 +78,13 @@ public EfConfigurationRepository(MiddlewareDbContext dbContext)
public async Task InsertOrUpdateSignaturCreationUnitATAsync(ftSignaturCreationUnitAT scu) => await _signaturCreationUnitATRepository.InsertOrUpdateAsync(scu).ConfigureAwait(false);

public async Task<ftSignaturCreationUnitDE> GetSignaturCreationUnitDEAsync(Guid id) => await _signaturCreationUnitDERepository.GetAsync(id).ConfigureAwait(false);
public Task<IEnumerable<ftSignaturCreationUnitES>> GetSignaturCreationUnitESListAsync() => throw new NotImplementedException();

public Task<ftSignaturCreationUnitES> GetSignaturCreationUnitESAsync(Guid signaturCreationUnitESId) => throw new NotImplementedException();

public async Task<IEnumerable<ftSignaturCreationUnitDE>> GetSignaturCreationUnitDEListAsync() => await _signaturCreationUnitDERepository.GetAsync().ConfigureAwait(false);
public async Task InsertOrUpdateSignaturCreationUnitDEAsync(ftSignaturCreationUnitDE scu) => await _signaturCreationUnitDERepository.InsertOrUpdateAsync(scu).ConfigureAwait(false);
public Task InsertOrUpdateSignaturCreationUnitESAsync(ftSignaturCreationUnitES scu) => throw new NotImplementedException();

public async Task<ftSignaturCreationUnitFR> GetSignaturCreationUnitFRAsync(Guid id) => await _signaturCreationUnitFRRepository.GetAsync(id).ConfigureAwait(false);
public async Task<IEnumerable<ftSignaturCreationUnitFR>> GetSignaturCreationUnitFRListAsync() => await _signaturCreationUnitFRRepository.GetAsync().ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<ProjectReference Include="..\fiskaltrust.Middleware.Storage.Base\fiskaltrust.Middleware.Storage.Base.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="fiskaltrust.storage" Version="1.3.66" />
</ItemGroup>

<PropertyGroup>
<EmbeddedResourceUseDependentUponConvention>true</EmbeddedResourceUseDependentUponConvention>
</PropertyGroup>
Expand Down
Loading
Loading