Skip to content

Commit

Permalink
PT-14740: Update to net8 (#56)
Browse files Browse the repository at this point in the history
feat: Update to .NET 8
  • Loading branch information
OlegoO authored Jan 11, 2024
1 parent 22f24ac commit 18aca58
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 47 deletions.
9 changes: 5 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!-- These properties will be shared for all projects -->
<PropertyGroup>
<VersionPrefix>3.403.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionPrefix>3.800.0</VersionPrefix>
<VersionSuffix>
</VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<noWarn>1591</noWarn>
<IsPackable>True</IsPackable>
Expand All @@ -11,14 +11,14 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<PropertyGroup>
<!-- Project is not a test project -->
<SonarQubeTestProject>false</SonarQubeTestProject>
<!-- Project is not a test project -->
<SonarQubeTestProject>false</SonarQubeTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.OrdersModule.Core" Version="3.400.0" />
<PackageReference Include="VirtoCommerce.Platform.Core" Version="3.400.0" />
<PackageReference Include="VirtoCommerce.SearchModule.Core" Version="3.401.0" />
<PackageReference Include="VirtoCommerce.TaxModule.Core" Version="3.400.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.OrdersModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.Platform.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.SearchModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.TaxModule.Core" Version="3.800.0" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions src/AvaTax.TaxModule.Data/Model/AvaTaxSettings.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using AvaTax.TaxModule.Core;
using AvaTax.TaxModule.Core.Services;
using System.Collections.Generic;
using VirtoCommerce.CoreModule.Core.Common;
using VirtoCommerce.Platform.Core.Settings;

Expand All @@ -14,9 +14,9 @@ public static AvaTaxSettings FromSettings(IEnumerable<ObjectSettingEntry> settin
{
AccountNumber = options.AccountNumber,
LicenseKey = options.LicenseKey,
CompanyCode = settings.GetSettingValue(ModuleConstants.Settings.Credentials.CompanyCode.Name, string.Empty),
ServiceUrl = settings.GetSettingValue(ModuleConstants.Settings.Credentials.ServiceUrl.Name, string.Empty),
AdminAreaUrl = settings.GetSettingValue(ModuleConstants.Settings.Credentials.AdminAreaUrl.Name, string.Empty),
CompanyCode = settings.GetValue<string>(ModuleConstants.Settings.Credentials.CompanyCode),
ServiceUrl = settings.GetValue<string>(ModuleConstants.Settings.Credentials.ServiceUrl),
AdminAreaUrl = settings.GetValue<string>(ModuleConstants.Settings.Credentials.AdminAreaUrl),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public async Task<AvaTaxOrderSynchronizationStatus> GetOrderSynchronizationStatu

public async Task SynchronizeOrdersAsync(IIndexDocumentChangeFeed ordersFeed, Action<AvaTaxOrdersSynchronizationProgress> progressCallback, ICancellationToken cancellationToken)
{
// TODO: how to find order count when ordersFeed.TotalsCount is null?
var totalCount = (long)ordersFeed.TotalCount;

var progressInfo = new AvaTaxOrdersSynchronizationProgress
Expand Down Expand Up @@ -194,18 +193,20 @@ protected virtual async Task<AvaTaxSettings> GetAvataxSettingsForOrder(CustomerO
return result;
}

protected virtual async Task SendOrderToAvaTax(CustomerOrder order, string companyCode, Address sourceAddress, AvaTaxClient avaTaxClient)
protected virtual async Task<TransactionModel> SendOrderToAvaTax(CustomerOrder order, string companyCode, Address sourceAddress, AvaTaxClient avaTaxClient)
{
if (!order.IsCancelled)
{
var createOrAdjustTransactionModel = AbstractTypeFactory<AvaCreateOrAdjustTransactionModel>.TryCreateInstance();
createOrAdjustTransactionModel.FromOrder(order, companyCode, sourceAddress);
var transactionModel = await avaTaxClient.CreateOrAdjustTransactionAsync(string.Empty, createOrAdjustTransactionModel);
return transactionModel;
}
else
{
var voidTransactionModel = new VoidTransactionModel { code = VoidReasonCode.DocVoided };
var transactionModel = await avaTaxClient.VoidTransactionAsync(companyCode, order.Number, DocumentType.Any, voidTransactionModel);
var transactionModel = await avaTaxClient.VoidTransactionAsync(companyCode, order.Number, DocumentType.Any, string.Empty, voidTransactionModel);
return transactionModel;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<noWarn>1591</noWarn>
<IsPackable>True</IsPackable>
Expand All @@ -15,12 +15,12 @@
<SonarQubeTestProject>false</SonarQubeTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalara.AvaTax" Version="18.9.0.234" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.InventoryModule.Core" Version="3.402.0" />
<PackageReference Include="VirtoCommerce.ShippingModule.Core" Version="3.400.0" />
<PackageReference Include="VirtoCommerce.StoreModule.Core" Version="3.400.0" />
<PackageReference Include="VirtoCommerce.TaxModule.Data" Version="3.400.0" />
<PackageReference Include="Avalara.AvaTax" Version="23.11.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.InventoryModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.ShippingModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.StoreModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.TaxModule.Data" Version="3.800.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AvaTax.TaxModule.Core\VirtoCommerce.AvalaraTaxModule.Core.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<noWarn>1591</noWarn>
<IsPackable>True</IsPackable>
Expand All @@ -11,8 +11,8 @@
<SonarQubeTestProject>false</SonarQubeTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="VirtoCommerce.Platform.Hangfire" Version="3.400.0" />
<PackageReference Include="VirtoCommerce.SearchModule.Data" Version="3.401.0" />
<PackageReference Include="VirtoCommerce.Platform.Hangfire" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.SearchModule.Data" Version="3.800.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AvaTax.TaxModule.Core\VirtoCommerce.AvalaraTaxModule.Core.csproj" />
Expand Down
20 changes: 10 additions & 10 deletions src/AvaTax.TaxModule.Web/module.manifest
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<id>VirtoCommerce.AvalaraTax</id>
<version>3.403.0</version>
<version>3.800.0</version>
<version-tag />
<platformVersion>3.400.0</platformVersion>
<platformVersion>3.800.0</platformVersion>
<dependencies>
<dependency id="VirtoCommerce.Inventory" version="3.402.0" />
<dependency id="VirtoCommerce.Orders" version="3.400.0" />
<dependency id="VirtoCommerce.Search" version="3.401.0" />
<dependency id="VirtoCommerce.Shipping" version="3.400.0" />
<dependency id="VirtoCommerce.Store" version="3.400.0" />
<dependency id="VirtoCommerce.Tax" version="3.400.0" />
<dependency id="VirtoCommerce.Inventory" version="3.800.0" />
<dependency id="VirtoCommerce.Orders" version="3.800.0" />
<dependency id="VirtoCommerce.Search" version="3.800.0" />
<dependency id="VirtoCommerce.Shipping" version="3.800.0" />
<dependency id="VirtoCommerce.Store" version="3.800.0" />
<dependency id="VirtoCommerce.Tax" version="3.800.0" />
</dependencies>
<title>Avalara Tax Provider</title>
<description>Provides real time integration with Avalara Tax https://www.avalara.com/</description>
Expand All @@ -24,9 +24,9 @@
<iconUrl>Modules/$(VirtoCommerce.AvalaraTax)/Content/400.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes>First version.</releaseNotes>
<copyright>Copyright © 2011–2023 Virto Commerce. All rights reserved</copyright>
<copyright>Copyright © 2011-2024 Virto Commerce. All rights reserved</copyright>
<tags>avalara tax</tags>
<assemblyFile>VirtoCommerce.AvalaraTaxModule.Web.dll</assemblyFile>
<moduleType>AvaTax.TaxModule.Web.Module, VirtoCommerce.AvalaraTaxModule.Web</moduleType>
<useFullTypeNameInSwagger>false</useFullTypeNameInSwagger>
</module>
</module>
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.console" Version="2.4.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.console" Version="2.6.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit 18aca58

Please sign in to comment.