Skip to content

Commit

Permalink
Merge pull request #26 from davewalker5/MC-155-Spending-Report
Browse files Browse the repository at this point in the history
MC-155 spending report
  • Loading branch information
davewalker5 authored Nov 15, 2023
2 parents 8096ac4 + 9f09e23 commit 78788f2
Show file tree
Hide file tree
Showing 25 changed files with 564 additions and 22 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ MusicCatalogue.LookupTool --lookup "John Coltrane" "Blue Train" catalogue
- Click on the "Search" button to view the results
- Records are included from 00:00 on the start date up to and including 23:59 on the end date

#### Monthly Spend Report

- To view a report on spending by year and month, click on the "Reports > Monthly Spend" menu bar item:

<img src="diagrams/reports-monthly-spend.png" alt="Monthly Spend Report" width="600">

[^ top](#musiccatalogue)

## Web Service
Expand Down
Binary file added diagrams/reports-monthly-spend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docker/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:latest
COPY musiccatalogue.api-1.15.0.0 /opt/musiccatalogue.api-1.15.0.0
WORKDIR /opt/musiccatalogue.api-1.15.0.0/bin
COPY musiccatalogue.api-1.16.0.0 /opt/musiccatalogue.api-1.16.0.0
WORKDIR /opt/musiccatalogue.api-1.16.0.0/bin
ENTRYPOINT [ "./MusicCatalogue.Api" ]
4 changes: 2 additions & 2 deletions docker/ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:20-alpine
COPY musiccatalogue.ui-1.15.0.0 /opt/musiccatalogue.ui-1.15.0.0
WORKDIR /opt/musiccatalogue.ui-1.15.0.0
COPY musiccatalogue.ui-1.16.0.0 /opt/musiccatalogue.ui-1.16.0.0
WORKDIR /opt/musiccatalogue.ui-1.16.0.0
RUN npm install
RUN npm run build
ENTRYPOINT [ "npm", "start" ]
22 changes: 22 additions & 0 deletions src/MusicCatalogue.Api/Controllers/ReportsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,27 @@ public async Task<ActionResult<List<ArtistStatistics>>> GetArtistStatisticsRepor
// Convert to a list and return the results
return results.ToList();
}

/// <summary>
/// Generate the monthly spending report
/// </summary>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
[HttpGet]
[Route("spend/{wishlist}")]
public async Task<ActionResult<List<MonthlySpend>>> GetMonthlySpendingReportAsync(bool wishlist)
{
// Get the report content
var results = await _factory.MonthlySpend.GenerateReportAsync(wishlist, 1, int.MaxValue);

if (!results.Any())
{
return NoContent();
}

// Convert to a list and return the results
return results.ToList();
}
}
}
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.15.0.0</ReleaseVersion>
<FileVersion>1.15.0.0</FileVersion>
<ProductVersion>1.15.0</ProductVersion>
<ReleaseVersion>1.16.0.0</ReleaseVersion>
<FileVersion>1.16.0.0</FileVersion>
<ProductVersion>1.16.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.

Loading

0 comments on commit 78788f2

Please sign in to comment.