Skip to content

Commit

Permalink
Merge pull request #11 from IliyanIlievPH/10
Browse files Browse the repository at this point in the history
Closes #10
  • Loading branch information
PaterSantyago committed Jul 20, 2020
2 parents 45e8416 + 2390b54 commit 3802f30
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.207
dotnet-version: 3.1.302
- name: Install dependencies
run: dotnet restore
- name: Build solution
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.207
dotnet-version: 3.1.302
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<None Remove="$(AssemblyName).xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lykke.HttpClientGenerator" Version="2.5.0" />
<PackageReference Include="Lykke.SettingsReader" Version="5.2.0" />
<PackageReference Include="Lykke.HttpClientGenerator" Version="3.1.0" />
<PackageReference Include="Lykke.SettingsReader" Version="5.3.0" />
<PackageReference Include="MAVN.Numerics" Version="1.0.0" />
<PackageReference Include="Refit" Version="4.6.107" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\contract\MAVN.Service.Tiers.Contract\MAVN.Service.Tiers.Contract.csproj" />
<ProjectReference Include="..\MAVN.Service.Tiers.Domain\MAVN.Service.Tiers.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lykke.RabbitMqBroker" Version="7.13.1" />
<PackageReference Include="MAVN.Service.CustomerProfile.Client" Version="1.3.0" />
<PackageReference Include="Lykke.RabbitMqBroker" Version="7.13.3" />
<PackageReference Include="MAVN.Service.CustomerProfile.Client" Version="2.2.0" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions src/MAVN.Service.Tiers.MsSqlRepositories/AutofacModule.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Autofac;
using MAVN.Common.MsSql;
using Autofac;
using MAVN.Persistence.PostgreSQL.Legacy;
using MAVN.Service.Tiers.Domain.Repositories;
using MAVN.Service.Tiers.MsSqlRepositories.Repositories;

Expand All @@ -16,7 +16,7 @@ public AutofacModule(string connectionString)

protected override void Load(ContainerBuilder builder)
{
builder.RegisterMsSql(
builder.RegisterPostgreSQL(
_connectionString,
connString => new DataContext(connString, false),
dbConn => new DataContext(dbConn));
Expand Down
6 changes: 3 additions & 3 deletions src/MAVN.Service.Tiers.MsSqlRepositories/DataContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
using System.Numerics;
using MAVN.Numerics;
using JetBrains.Annotations;
using MAVN.Common.MsSql;
using MAVN.Persistence.PostgreSQL.Legacy;
using MAVN.Service.Tiers.MsSqlRepositories.Entities;
using Microsoft.EntityFrameworkCore;

namespace MAVN.Service.Tiers.MsSqlRepositories
{
public class DataContext : MsSqlContext
public class DataContext : PostgreSQLContext
{
internal const string Schema = "tiers";

Expand All @@ -35,7 +35,7 @@ public DataContext(DbConnection dbConnection)
{
}

protected override void OnLykkeModelCreating(ModelBuilder modelBuilder)
protected override void OnMAVNModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<TierEntity>()
.HasMany<CustomerTierEntity>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public TierEntity(Guid id, string name, Money18 threshold)
public Guid Id { get; set; }

[Required]
[Column("name", TypeName = "nvarchar(50)")]
[Column("name")]
public string Name { get; set; }

[Column("threshold")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="9.0.0" />
<PackageReference Include="MAVN.Common.MsSql" Version="3.0.0" />
<PackageReference Include="Lykke.Logs" Version="7.4.0" />
<PackageReference Include="MAVN.Persistence.PostgreSQL.Legacy" Version="1.1.0" />
</ItemGroup>
<PropertyGroup>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
columns: table => new
{
id = table.Column<Guid>(nullable: false),
name = table.Column<string>(type: "nvarchar(50)", nullable: false),
name = table.Column<string>(nullable: false),
threshold = table.Column<int>(nullable: false)
},
constraints: table =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System;
using System.Threading.Tasks;
using AutoMapper;
using MAVN.Common.MsSql;
using MAVN.Persistence.PostgreSQL.Legacy;
using MAVN.Service.Tiers.Domain.Entities;
using MAVN.Service.Tiers.Domain.Repositories;
using MAVN.Service.Tiers.MsSqlRepositories.Entities;
Expand All @@ -12,10 +12,10 @@ namespace MAVN.Service.Tiers.MsSqlRepositories.Repositories
public class CustomerBonusesRepository : ICustomerBonusesRepository
{
private readonly IMapper _mapper;
private readonly MsSqlContextFactory<DataContext> _contextFactory;
private readonly PostgreSQLContextFactory<DataContext> _contextFactory;

public CustomerBonusesRepository(
MsSqlContextFactory<DataContext> contextFactory,
PostgreSQLContextFactory<DataContext> contextFactory,
IMapper mapper)
{
_contextFactory = contextFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System;
using System.Linq;
using System.Threading.Tasks;
using MAVN.Common.MsSql;
using MAVN.Persistence.PostgreSQL.Legacy;
using MAVN.Service.Tiers.Domain.Repositories;
using MAVN.Service.Tiers.MsSqlRepositories.Entities;
using Microsoft.EntityFrameworkCore;
Expand All @@ -10,9 +10,9 @@ namespace MAVN.Service.Tiers.MsSqlRepositories.Repositories
{
public class CustomerTiersRepository : ICustomerTiersRepository
{
private readonly MsSqlContextFactory<DataContext> _contextFactory;
private readonly PostgreSQLContextFactory<DataContext> _contextFactory;

public CustomerTiersRepository(MsSqlContextFactory<DataContext> contextFactory)
public CustomerTiersRepository(PostgreSQLContextFactory<DataContext> contextFactory)
{
_contextFactory = contextFactory;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using AutoMapper;
using MAVN.Common.MsSql;
using MAVN.Persistence.PostgreSQL.Legacy;
using MAVN.Service.Tiers.Domain.Entities;
using MAVN.Service.Tiers.Domain.Repositories;
using Microsoft.EntityFrameworkCore;
Expand All @@ -11,10 +11,10 @@ namespace MAVN.Service.Tiers.MsSqlRepositories.Repositories
{
public class TiersRepository : ITiersRepository
{
private readonly MsSqlContextFactory<DataContext> _contextFactory;
private readonly PostgreSQLContextFactory<DataContext> _contextFactory;
private readonly IMapper _mapper;

public TiersRepository(MsSqlContextFactory<DataContext> contextFactory, IMapper mapper)
public TiersRepository(PostgreSQLContextFactory<DataContext> contextFactory, IMapper mapper)
{
_contextFactory = contextFactory;
_mapper = mapper;
Expand Down
2 changes: 1 addition & 1 deletion src/MAVN.Service.Tiers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM microsoft/dotnet:2.2-aspnetcore-runtime
FROM microsoft/dotnet:3.1-aspnetcore-runtime
WORKDIR /app
COPY . .
ENTRYPOINT ["dotnet", "MAVN.Service.Tiers.dll"]
8 changes: 6 additions & 2 deletions src/MAVN.Service.Tiers/MAVN.Service.Tiers.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Exe</OutputType>
<Version>1.0.0</Version>
</PropertyGroup>
Expand All @@ -13,12 +13,16 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Dockerfile">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lykke.Sdk" Version="5.17.0" />
<PackageReference Include="Lykke.Logs" Version="7.4.0" />
<PackageReference Include="Lykke.Sdk" Version="5.18.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="7.0.0" />
<PackageReference Include="MAVN.Service.CustomerManagement.Contract" Version="1.1.0" />
<PackageReference Include="MAVN.Service.WalletManagement.Contract" Version="1.1.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Lykke.Logs" Version="7.3.3" />
<PackageReference Include="Lykke.Logs" Version="7.4.0" />
<PackageReference Include="MAVN.Numerics" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Moq" Version="4.14.5" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\MAVN.Service.Tiers.DomainServices\MAVN.Service.Tiers.DomainServices.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Moq" Version="4.14.5" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\MAVN.Service.Tiers.MsSqlRepositories\MAVN.Service.Tiers.MsSqlRepositories.csproj" />
Expand Down
13 changes: 8 additions & 5 deletions tests/MAVN.Service.Tiers.Tests/MAVN.Service.Tiers.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<Version>1.0.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.8.1">
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Moq" Version="4.14.5" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\MAVN.Service.Tiers\MAVN.Service.Tiers.csproj" />
Expand Down

0 comments on commit 3802f30

Please sign in to comment.