Skip to content

Commit

Permalink
Added the artist statistics report to the entities and logic
Browse files Browse the repository at this point in the history
  • Loading branch information
davewalker5 committed Nov 13, 2023
1 parent 38e3339 commit 05b648e
Show file tree
Hide file tree
Showing 13 changed files with 373 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/MusicCatalogue.Api/MusicCatalogue.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ReleaseVersion>1.11.0.0</ReleaseVersion>
<FileVersion>1.11.0.0</FileVersion>
<ProductVersion>1.11.0</ProductVersion>
<ReleaseVersion>1.12.0.0</ReleaseVersion>
<FileVersion>1.12.0.0</FileVersion>
<ProductVersion>1.12.0</ProductVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down

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

36 changes: 36 additions & 0 deletions src/MusicCatalogue.Data/Migrations/20231113155415_ArtistsReport.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System.Diagnostics.CodeAnalysis;

#nullable disable

namespace MusicCatalogue.Data.Migrations
{
[ExcludeFromCodeCoverage]
/// <inheritdoc />
public partial class ArtistsReport : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ArtistStatistics",
columns: table => new
{
Name = table.Column<string>(type: "TEXT", nullable: false),
Albums = table.Column<int>(type: "INTEGER", nullable: true),
Tracks = table.Column<int>(type: "INTEGER", nullable: true),
Spend = table.Column<decimal>(type: "TEXT", nullable: true)
},
constraints: table =>
{
});
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ArtistStatistics");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,24 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("USER", (string)null);
});

modelBuilder.Entity("MusicCatalogue.Entities.Reporting.ArtistStatistics", b =>
{
b.Property<int?>("Albums")
.HasColumnType("INTEGER");

b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");

b.Property<decimal?>("Spend")
.HasColumnType("TEXT");

b.Property<int?>("Tracks")
.HasColumnType("INTEGER");

b.ToTable("ArtistStatistics");
});

modelBuilder.Entity("MusicCatalogue.Entities.Reporting.GenreStatistics", b =>
{
b.Property<int?>("Albums")
Expand Down
4 changes: 2 additions & 2 deletions src/MusicCatalogue.Data/MusicCatalogue.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>MusicCatalogue.Data</PackageId>
<PackageVersion>1.11.0.0</PackageVersion>
<PackageVersion>1.12.0.0</PackageVersion>
<Authors>Dave Walker</Authors>
<Copyright>Copyright (c) Dave Walker 2023</Copyright>
<Owners>Dave Walker</Owners>
Expand All @@ -17,7 +17,7 @@
<PackageProjectUrl>https://github.com/davewalker5/MusicCatalogue</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<ReleaseVersion>1.11.0.0</ReleaseVersion>
<ReleaseVersion>1.12.0.0</ReleaseVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/MusicCatalogue.Data/MusicCatalogueDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class MusicCatalogueDbContext : DbContext
public virtual DbSet<User> Users { get; set; }
public virtual DbSet<JobStatus> JobStatuses { get; set; }
public virtual DbSet<GenreStatistics> GenreStatistics { get; set; }
public virtual DbSet<ArtistStatistics> ArtistStatistics { get; set; }

public MusicCatalogueDbContext(DbContextOptions<MusicCatalogueDbContext> options) : base(options)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ public interface IMusicCatalogueFactory
IStatisticsManager Statistics { get; }
IJobStatusManager JobStatuses { get; }
IWishListBasedReport<GenreStatistics> GenreStatistics { get; }
IWishListBasedReport<ArtistStatistics> ArtistStatistics { get; }
}
}
Loading

0 comments on commit 05b648e

Please sign in to comment.