Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MC-155 spending report #26

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading