Skip to content

Commit

Permalink
Merge pull request #709 from GeorgeWalker/support-develop
Browse files Browse the repository at this point in the history
ajdust solution
  • Loading branch information
GeorgeWalker authored Dec 19, 2024
2 parents c819ebd + b776399 commit 1aa4389
Show file tree
Hide file tree
Showing 62 changed files with 42 additions and 63 deletions.
12 changes: 6 additions & 6 deletions dfa-public/src/API/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
ENV ASPNETCORE_URLS=http://*:8080
Expand All @@ -7,15 +7,15 @@ ENV DOTNET_gcServer=1
ARG VERSION
ENV VERSION=$VERSION

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

# install diagnostics tools
RUN dotnet tool install --tool-path /tools dotnet-trace
RUN dotnet tool install --tool-path /tools dotnet-counters
RUN dotnet tool install --tool-path /tools dotnet-dump

WORKDIR /src
COPY ["EMBC.DFA.API/EMBC.DFA.API.csproj", "EMBC.DFA.API/"]
COPY ["EMBC.DFA.PUBLIC.API/EMBC.DFA.PUBLIC.API.csproj", "EMBC.DFA.PUBLIC.API/"]
COPY ["EMBC.ESS.Shared.Contracts/EMBC.ESS.Shared.Contracts.csproj", "EMBC.ESS.Shared.Contracts/"]
COPY ["EMBC.Utilities/EMBC.Utilities.csproj", "EMBC.Utilities/"]
COPY ["EMBC.Utilities.Hosting/EMBC.Utilities.Hosting.csproj", "EMBC.Utilities.Hosting/"]
Expand All @@ -24,7 +24,7 @@ COPY ["EMBC.Utilities.Telemetry/EMBC.Utilities.Telemetry.csproj", "EMBC.Utilitie
COPY ["EMBC.Utilities.Messaging/EMBC.Utilities.Messaging.csproj", "EMBC.Utilities.Messaging/"]
COPY ["EMBC.Tests.Unit.DFA.API/EMBC.Tests.Unit.DFA.API.csproj", "EMBC.Tests.Unit.DFA.API/"]
COPY ["EMBC.BCeID/EMBC.Gov.BCeID.csproj", "EMBC.BCeID/"]
COPY ["EMBC.DFA.sln", ".editorconfig", "./"]
COPY ["EMBC.DFA.PUBLIC.sln", ".editorconfig", "./"]
RUN dotnet restore .
COPY . .

Expand All @@ -33,7 +33,7 @@ COPY . .

# build
FROM build AS publish
RUN dotnet publish "EMBC.DFA.API/EMBC.DFA.API.csproj" -c Release -o /app/publish --runtime linux-musl-x64 --no-self-contained
RUN dotnet publish "EMBC.DFA.PUBLIC.API/EMBC.DFA.PUBLIC.API.csproj" -c Release -o /app/publish --runtime linux-musl-x64 --no-self-contained

FROM base AS final
# copy diagnostics tools
Expand All @@ -42,4 +42,4 @@ COPY --from=build /tools .
# copy app
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "EMBC.DFA.API.dll"]
ENTRYPOINT ["dotnet", "EMBC.DFA.PUBLIC.API.dll"]
2 changes: 1 addition & 1 deletion dfa-public/src/API/EMBC.BCeID/EMBC.Gov.BCeID.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public async Task<dfa_appapplicationmain_retrieve> GetApplicationMainById(Guid a
application.dfa_contactemail = buildingOwnerlist.List.Last().dfa_contactemail;
}

var annotationList = await api.GetList<annotation>("annotations", new CRMGetListOptions
var annotationList = await api.GetList<Annotation>("annotations", new CRMGetListOptions
{
Select = new[]
{
Expand All @@ -281,7 +281,7 @@ public async Task<dfa_appapplicationmain_retrieve> GetApplicationMainById(Guid a
Filter = $"_objectid_value eq {application.dfa_appapplicationid}"
});

foreach (annotation annotation in annotationList.List)
foreach (Annotation annotation in annotationList.List)
{
if (annotation.subject == "primaryApplicantSignature")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class dfa_signature
public string dfa_appapplicationid { get; set; }
}

public class annotation
public class Annotation
{
public Guid annotationid { get; set; }
public string documentbody { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using bceid = EMBC.Gov.BCeID;
using BCeID = EMBC.Gov.BCeID;

namespace EMBC.DFA.API.Controllers
{
Expand Down Expand Up @@ -48,7 +48,7 @@ public BCeIDLookupController(
[HttpGet("self")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<ActionResult<bceid.BCeIDBusiness>> GetBCeIDSelfInfo()
public async Task<ActionResult<BCeID.BCeIDBusiness>> GetBCeIDSelfInfo()
{
try
{
Expand Down Expand Up @@ -88,7 +88,7 @@ public BCeIDLookupController(
[HttpGet("other")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<ActionResult<bceid.BCeIDBusiness>> GetBCeIDOtherInfo(
public async Task<ActionResult<BCeID.BCeIDBusiness>> GetBCeIDOtherInfo(
[FromQuery]
[Required]
string userId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

using bceid = EMBC.Gov.BCeID;
using BCeID = EMBC.Gov.BCeID;

namespace EMBC.DFA.API.Controllers
{
Expand Down Expand Up @@ -44,15 +44,15 @@ public ContactController(
[AllowAnonymous]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult<bceid.BCeIDBusiness> GetDashboardContactInfo()
public ActionResult<BCeID.BCeIDBusiness> GetDashboardContactInfo()
{
if (User.Identity.IsAuthenticated)
{
var userData = userService.GetJWTokenData();

if (userData == null) return NotFound("Authentication missing");

var bceidData = mapper.Map<bceid.BCeIDBusiness>(userData);
var bceidData = mapper.Map<BCeID.BCeIDBusiness>(userData);
return Ok(bceidData);
}
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>annotations</Nullable>
<Company>Province of British Columbia</Company>
<Authors>Quartech Systems Limited</Authors>
<Copyright>Copyright 2020 Province of British Columbia</Copyright>
<Copyright>Copyright Province of British Columbia</Copyright>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RepositoryUrl>https://github.com/bcgov/embc-ess-mod</RepositoryUrl>
<RepositoryUrl>https://github.com/bcgov/emcr-dfa-portal</RepositoryUrl>
<RepositoryType>GIT</RepositoryType>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<UserSecretsId>78326412-d09d-4d67-964c-b4b680228566</UserSecretsId>
<UserSecretsId>78326412-d09d-4d67-964c-b4b680228567</UserSecretsId>
<AnalysisMode>Default</AnalysisMode>
<EnableDotNetAnalyzers>True</EnableDotNetAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
Expand All @@ -38,16 +38,10 @@

<ItemGroup>
<PackageReference Include="IdentityModel.AspNetCore.OAuth2Introspection" Version="6.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.*" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.9.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />

<PackageReference Include="NSwag.AspNetCore" Version="14.0.7" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="System.ServiceModel.Http" Version="6.0.0" />
<PackageReference Include="System.ServiceModel.Security" Version="4.6.0" />
<PackageReference Include="Xrm.Tools.CRMWebAPI" Version="1.0.25" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using EMBC.DFA.API.ConfigurationModule.Models;
using EMBC.DFA.API.ConfigurationModule.Models.AuthModels;
using EMBC.DFA.API.ConfigurationModule.Models.Dynamics;
using EMBC.DFA.API.ConfigurationModule.Models.PDF;
using EMBC.DFA.API.Controllers;
using Microsoft.IdentityModel.Tokens;
using bceid = EMBC.Gov.BCeID;
using BCeID = EMBC.Gov.BCeID;

namespace EMBC.DFA.API.Mappers
{
Expand Down Expand Up @@ -772,7 +768,7 @@ public Mappings()

// 2024-07-16 EMCRI-440 waynezen

CreateMap<BceidUserData, bceid.BCeIDBusiness>()
CreateMap<BceidUserData, BCeID.BCeIDBusiness>()
.ForMember(d => d.userId, opts => opts.MapFrom(s => s.bceid_username))
.ForMember(d => d.legalName, opts => opts.MapFrom(s => s.bceid_business_name))
.ForMember(d => d.contactEmail, opts => opts.MapFrom(s => s.emailaddress))
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"distributionName": ""
},
"EMBC.DFA.API": {
"EMBC.DFA.PUBLIC.API": {
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 15.0.26124.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EMBC.DFA.API", "EMBC.DFA.API\EMBC.DFA.API.csproj", "{EE7D4980-9AEE-4495-8B4E-28CA41B32024}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EMBC.DFA.PUBLIC.API", "EMBC.DFA.PUBLIC.API\EMBC.DFA.PUBLIC.API.csproj", "{EE7D4980-9AEE-4495-8B4E-28CA41B32024}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EMBC.Tests.Unit.DFA.API", "EMBC.Tests.Unit.DFA.API\EMBC.Tests.Unit.DFA.API.csproj", "{A8EEF3EC-A1AE-4C4E-8AB3-4D3BF46DE853}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.9.2">
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>warnings</Nullable>
Expand All @@ -28,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\EMBC.DFA.API\EMBC.DFA.API.csproj" />
<ProjectReference Include="..\EMBC.DFA.PUBLIC.API\EMBC.DFA.PUBLIC.API.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.*" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.9.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Company>Province of British Columbia</Company>
Expand Down Expand Up @@ -29,10 +29,6 @@
<PackageReference Include="Hellang.Middleware.ProblemDetails" Version="6.5.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.*" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.*" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.9.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="OpenTelemetry.Contrib.Instrumentation.GrpcCore" Version="1.0.0-beta3" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.1" />
Expand Down
2 changes: 2 additions & 0 deletions dfa-public/src/API/EMBC.Utilities.Hosting/Host.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ protected virtual IHostBuilder CreateHost(params Assembly[] assemblies) =>
.ConfigureHostConfiguration(opts =>
{
// add secrets json file if exists in the hosting assembly
#pragma warning disable CS8604 // Possible null reference argument.
opts.AddUserSecrets(Assembly.GetEntryAssembly(), true, true);
#pragma warning restore CS8604 // Possible null reference argument.
})
.UseSerilog((ctx, services, config) => Logging.ConfigureSerilog(ctx, services, config, appName))
.ConfigureWebHostDefaults(webBuilder =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.*" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.9.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="OpenTelemetry.Api" Version="1.3.1" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="5.0.1" />
Expand Down
9 changes: 1 addition & 8 deletions dfa-public/src/API/EMBC.Utilities/EMBC.Utilities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,9 @@
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.*" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.*" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.*" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.9.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions dfa-public/src/API/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.425",
"rollForward": "latestMinor"
"version": "8.0.0",
"rollForward": "latestMinor"
}
}

0 comments on commit 1aa4389

Please sign in to comment.