Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/nuget/FastEndpoints.Swagger-5.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ardalis authored Jul 29, 2024
2 parents 3363afe + 27f0783 commit 7863afe
Show file tree
Hide file tree
Showing 71 changed files with 1,997 additions and 1,539 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
runs-on: ${{ matrix.os }}
outputs:
is_push_to_default_branch: ${{ steps.conditionals_handler.outputs.is_push_to_default_branch }}
os: ${{ matrix.os }}
run_number: ${{ github.run_number }}
steps:
- name: Data gatherer
id: data_gatherer
Expand Down Expand Up @@ -54,14 +56,14 @@ jobs:
- name: Setup .NET Core
id: setup_dotnet_core
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'
include-prerelease: true

- name: Checkout repository
id: checkout_repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
Expand All @@ -86,16 +88,16 @@ jobs:
- name: Upload build artifacts
id: upload_build_artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Build artifacts
name: Build artifacts-${{ matrix.os }}-${{ github.run_number }}
path: Artifacts/

- name: Upload publish artifacts
id: upload_publish_artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Publish artifacts
name: Publish artifacts-${{ matrix.os }}-${{ github.run_number }}
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/WebApp/

cd:
Expand All @@ -106,9 +108,9 @@ jobs:
steps:
- name: Download publish artifacts
id: dl_publish_artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Publish artifacts
name: Publish artifacts-${{ needs.ci.outputs.os }}-${{ needs.ci.outputs.run_number }}
path: WebApp/

- name: Azure webapp deploy with Publish Profile
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:
steps:
- name: Checkout repository
id: checkout_repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
id: init_codeql
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
queries: security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
id: analyze_codeql
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
6 changes: 3 additions & 3 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
VIMEO_TOKEN: ${{ secrets.VIMEO_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'
include-prerelease: true
- name: Build and Test with dotnet
run: dotnet test --filter FullyQualifiedName!~Vimeo.Tests --configuration Release
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'
include-prerelease: true

- name: Build and test
Expand Down
52 changes: 25 additions & 27 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="altcover" Version="8.6.68" />
<PackageVersion Include="altcover" Version="8.8.173" />
<PackageVersion Include="Ardalis.ApiClient" Version="0.2.3" />
<PackageVersion Include="Ardalis.ApiEndpoints" Version="4.1.0" />
<PackageVersion Include="Ardalis.EFCore.Extensions" Version="6.0.0" />
<PackageVersion Include="Ardalis.GuardClauses" Version="4.2.0" />
<PackageVersion Include="Ardalis.HttpClientTestExtensions" Version="4.2.0" />
<PackageVersion Include="Ardalis.ListStartupServices" Version="1.1.4" />
<PackageVersion Include="Ardalis.Result" Version="7.1.0" />
<PackageVersion Include="Ardalis.Result.AspNetCore" Version="7.1.0" />
<PackageVersion Include="Ardalis.Result.AspNetCore" Version="7.2.0" />
<PackageVersion Include="Ardalis.SmartEnum" Version="7.0.0" />
<PackageVersion Include="Ardalis.Specification" Version="7.0.0" />
<PackageVersion Include="Ardalis.Specification.EntityFrameworkCore" Version="7.0.0" />
Expand All @@ -22,46 +22,44 @@
<PackageVersion Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageVersion Include="BuildBundlerMinifier" Version="3.2.449" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.0">
<PackageVersion Include="coverlet.msbuild" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
<PackageVersion Include="CSharpFunctionalExtensions" Version="2.40.3" />
<PackageVersion Include="Dapper" Version="2.1.15" />
<PackageVersion Include="FastEndpoints" Version="5.18.0" />
<PackageVersion Include="Dapper" Version="2.1.35" />
<PackageVersion Include="FastEndpoints" Version="5.19.2" />
<PackageVersion Include="FastEndpoints.ApiExplorer" Version="2.2.0" />
<PackageVersion Include="FastEndpoints.Swagger" Version="5.19.2" />
<PackageVersion Include="FastEndpoints.Swagger.Swashbuckle" Version="2.2.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Flurl" Version="3.0.7" />
<PackageVersion Include="Flurl.Http" Version="3.2.4" />
<PackageVersion Include="GoogleReCaptcha.V3" Version="1.3.1" />
<PackageVersion Include="ILogger.Moq" Version="1.1.10" />
<PackageVersion Include="Markdig" Version="0.33.0" />
<PackageVersion Include="MediaInfo.Wrapper.Core" Version="21.9.3" />
<PackageVersion Include="MediatR" Version="12.1.1" />
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageVersion Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" Version="7.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.AzureAppServices.HostingStartup" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.13" />
<PackageVersion Include="Microsoft.CodeCoverage" Version="17.7.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" PrivateAssets="all" Version="7.0.13" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="7.0.13" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="7.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.4" />
<PackageVersion Include="Microsoft.CodeCoverage" Version="17.8.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" PrivateAssets="all" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.AzureAppServices" Version="7.0.13" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="Microsoft.Extensions.Logging.AzureAppServices" Version="8.0.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
<PackageVersion Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.13" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="NETStandard.Library" Version="2.0.3" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NimblePros.Vimeo" Version="1.0.6" />
Expand All @@ -73,7 +71,7 @@
<PackageVersion Include="Serilog.Sinks.ApplicationInsights" Version="4.0.1-dev-00043" />
<PackageVersion Include="Serilog.Sinks.MSSqlServer" Version="6.3.0" />
<PackageVersion Include="Shouldly" Version="4.2.1" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.0.2" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageVersion Include="SQLite" Version="3.13.0" />
<PackageVersion Include="Stripe.net" Version="40.16.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
Expand All @@ -83,13 +81,13 @@
<PackageVersion Include="TagHelperSamples.Authorization" Version="3.0.56" />
<PackageVersion Include="Westwind.AspNetCore.Markdown" Version="3.12.0" />
<PackageVersion Include="WindowsAzure.Storage" Version="9.3.3" />
<PackageVersion Include="xunit" Version="2.6.1" />
<PackageVersion Include="xunit" Version="2.6.6" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageVersion Include="xunit.runner.console" Version="2.5.0">
<PackageVersion Include="xunit.runner.console" Version="2.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="xunit.runner.reporters" Version="2.5.0" />
<PackageVersion Include="xunit.runner.reporters" Version="2.6.4" />
<PackageVersion Include="XunitXml.TestLogger" Version="3.1.17" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.0",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion src/DevBetterWeb.Core/DevBetterWeb.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>DevBetterWeb.Core</AssemblyName>
<PackageId>DevBetterWeb.Core</PackageId>
<LangVersion>latest</LangVersion>
Expand Down
31 changes: 27 additions & 4 deletions src/DevBetterWeb.Core/Entities/Member.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,14 @@ public void UpdateName(string? firstName, string? lastName, bool isEvent = true)

public void UpdateAddress(string? address, bool isEvent = true)
{
if (Address == address) return;

Address = address;
var isUpdate = false;
if (Address != address)
{
Address = address;
isUpdate = true;
}

if (isEvent)
if (isEvent && isUpdate)
{
CreateOrUpdateAddressUpdateEvent(nameof(Address));
}
Expand Down Expand Up @@ -181,6 +184,26 @@ public void RemoveFavoriteArchiveVideo(ArchiveVideo archiveVideo)
}
}

public void UpdateShippingAddress(string street, string city, string state, string postalCode, string country, bool isEvent = true)
{
bool isUpdated;
if (ShippingAddress == null)
{
ShippingAddress = new Address(street, city, state, postalCode, country);
isUpdated = true;
}
else
{
isUpdated = ShippingAddress.Update(street, city, state, postalCode, country);
}

if (isEvent && isUpdated)
{
var addressUpdatedEvent = new MemberAddressUpdatedEvent(this, ShippingAddress);
Events.Add(addressUpdatedEvent);
}
}

public void UpdateShippingAddress(Address newAddress, bool isEvent = true)
{
if (ShippingAddress == newAddress) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ public InvalidBillingPeriodException(string? message) : base(message)
public InvalidBillingPeriodException(string? message, Exception? innerException) : base(message, innerException)
{
}

protected InvalidBillingPeriodException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
4 changes: 0 additions & 4 deletions src/DevBetterWeb.Core/Exceptions/InvalidEmailException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ public InvalidEmailException(string? message) : base(message)
public InvalidEmailException(string? message, Exception? innerException) : base(message, innerException)
{
}

protected InvalidEmailException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ public InvitationNotActiveException(string? message) : base(message)
public InvitationNotActiveException(string? message, Exception? innerException) : base(message, innerException)
{
}

protected InvitationNotActiveException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ public NoCurrentMemberSubscriptionFoundException(string? message) : base(message
public NoCurrentMemberSubscriptionFoundException(string? message, Exception? innerException) : base(message, innerException)
{
}

protected NoCurrentMemberSubscriptionFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
2 changes: 1 addition & 1 deletion src/DevBetterWeb.Core/Interfaces/INewMemberService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public interface INewMemberService
Task<Invitation> CreateInvitationAsync(string email, string stripeEventId);
Task SendRegistrationEmailAsync(Invitation invitation);
Task<Result<string>> VerifyValidEmailAndInviteCodeAsync(string email, string inviteCode);
Task<Member> MemberSetupAsync(string userId, string firstName, string lastName, string inviteCode, string email);
Task<Member> MemberSetupAsync(string userId, string firstName, string lastName, string inviteCode, string email, string streetAddress, string city, string state, string postalCode, string country);
Task DeactivateInviteAsync(Invitation invite);
}
2 changes: 1 addition & 1 deletion src/DevBetterWeb.Core/Services/CreateVideoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task<string> StartAsync(string videoName, long videoSize, string do
{
Name = videoName,
Upload = { Size = videoSize },
Embed = new Embed { Title = new Title { Owner = EmbedOwnerTitle.Hide } },
Embed = new Embed { Title = new Title { Owner = EmbedOwnerTitle.Hide }, Speed = true, Volume = true, Playbar = true, Buttons = new Buttons { Embed = true, Hd = true, Fullscreen = true } },
Privacy = new Privacy { Embed = EmbedPrivacy.Whitelist, View = PrivacyView.Disable, Download = false },
EmbedDomains = new List<string> { domain },
HideFromVimeo = true
Expand Down
9 changes: 5 additions & 4 deletions src/DevBetterWeb.Core/Services/NewMemberService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public async Task<Result<string>> VerifyValidEmailAndInviteCodeAsync(string emai
}

public async Task<Member> MemberSetupAsync(string userId,
string firstName, string lastName, string inviteCode, string email)
string firstName, string lastName, string inviteCode, string email, string streetAddress, string city, string state, string postalCode, string country)
{
Guard.Against.NullOrEmpty(inviteCode, nameof(inviteCode));
Member member = await CreateNewMemberAsync(userId, firstName, lastName, email);
Member member = await CreateNewMemberAsync(userId, firstName, lastName, email, streetAddress, city, state, postalCode, country);
await AddUserToMemberRoleAsync(userId);

var spec = new InvitationByInviteCodeSpec(inviteCode);
Expand Down Expand Up @@ -152,13 +152,14 @@ private async Task DeactivateInviteAndDuplicates(Invitation invite)
await _invitationRepository.SaveChangesAsync();
}

private async Task<Member> CreateNewMemberAsync(string userId, string firstName, string lastName, string email)
private async Task<Member> CreateNewMemberAsync(string userId, string firstName, string lastName, string email, string street, string city, string state, string postalCode, string country)
{
Member member = await _memberRegistrationService.RegisterMemberAsync(userId);
member.UpdateName(firstName, lastName);
member.UpdateEmail(email);
member.UpdateShippingAddress(street, city, state, postalCode, country);

return member;
return member;
}

private Task AddUserToMemberRoleAsync(string userId)
Expand Down
Loading

0 comments on commit 7863afe

Please sign in to comment.