Skip to content

Commit aba7337

Browse files
committed
Fix (Fixes main.tsx): The main.tsx was incorrectly named.
Add or update the Azure App Service build and deployment workflow config Fix (API Publish): Makes changes to get API to publish. Updates api pipeline file. Fixes api pipeline Updates api pipeline. Updates api pipeline Updates pipeline for api Updates api pipeline Fixes authenication redirect issue. Adds padding to top of page for mobile. Adds more padding to top for mobile. Upgrades vulnerable dependencies. Upgrades ESbuild Fix (Bugs): Fixes bug that caused a budgets expenses not to be updated and a bug that didnt allow the income creation button to be clicked Fix (Initialization error): Fixes issue that is caused by the budget service not being properly initalized in the category controller. Fix (Login): Fixes login button so it doesnt redirect you before the login process is finished. Fix (login): Attempts to fix login to redirect properly. Fix (Login): Removes redirect after login since MSAL doesn't seem to work great. Fix (Auth) Update appsettings.json Remove appsettings.json from repository Fix (Merge issues): Fixes issues after merging. Minor auth changes Fix Feat (Auth): Changes auth depending on device type Update README.md Auth: Creates new auth provider setup. Creates new auth provider setup to hopefully make auth work better on mobile. Branch cleanup Removes Entra ID
1 parent 61e7bf2 commit aba7337

36 files changed

Lines changed: 697 additions & 1125 deletions

.DS_Store

0 Bytes
Binary file not shown.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: Build and deploy ASP.Net Core app to Azure Web App - breeze-api
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read #This is required for actions/checkout
17+
id-token: write
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up .NET Core
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: '9.x'
26+
27+
- name: Build with dotnet
28+
run: dotnet build --configuration Release
29+
30+
- name: dotnet publish
31+
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/Breeze.Api
32+
33+
- name: Upload artifact for deployment job
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: .net-app
37+
path: ${{env.DOTNET_ROOT}}/Breeze.Api
38+
39+
deploy:
40+
runs-on: ubuntu-latest
41+
needs: build
42+
environment:
43+
name: 'Production'
44+
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
45+
permissions:
46+
id-token: write #This is required for requesting the JWT
47+
contents: read #This is required for actions/checkout
48+
49+
steps:
50+
- name: Download artifact from build job
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: .net-app
54+
55+
- name: Login to Azure
56+
uses: azure/login@v2
57+
with:
58+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_D2C44B7234164FC5B56F9FFDB1CD3E6E }}
59+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_71006F9196DA495986F4A424FB8FED38 }}
60+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_0EB6021EB97A4E5A83F60242A79EA2F0 }}
61+
62+
- name: Deploy to Azure Web App
63+
id: deploy-to-webapp
64+
uses: azure/webapps-deploy@v3
65+
with:
66+
app-name: 'breeze-api'
67+
slot-name: 'Production'
68+
package: .

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ FakesAssemblies/
284284
# Node.js Tools for Visual Studio
285285
.ntvs_analysis.dat
286286
node_modules/
287+
dist/
288+
build/
287289

288290
# Visual Studio 6 build log
289291
*.plg

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"appService.zipIgnorePattern": [".vscode{,/**}"],
33
"appService.defaultWebAppToDeploy": "None",
4-
"appService.deploySubpath": "Breeze.Api/bin/Release/net8.0",
4+
"appService.deploySubpath": "Breeze.Api/bin/Release/net9.0/publish",
55
"appService.showBuildDuringDeployPrompt": false,
66
"sqltools.connections": [
77
{

Breeze.Api/Categories/CategoryServices.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Breeze.Api.Categories.RequestResponseObjects;
1+
using Breeze.Api.Budgets;
2+
using Breeze.Api.Categories.RequestResponseObjects;
23
using Breeze.Api.Expenses.RequestResponseObjects;
34
using Breeze.Data;
45
using Breeze.Domain;
@@ -10,6 +11,7 @@ namespace Breeze.Api.Categories
1011
/// </summary>
1112
public class CategoryService
1213
{
14+
private readonly BudgetService budgets;
1315
private IConfiguration _config;
1416
private readonly ILogger _logger;
1517
private readonly BreezeContext db;
@@ -22,6 +24,7 @@ public class CategoryService
2224
/// <param name="logger">Logger for logging errors and information.</param>
2325
public CategoryService(IConfiguration config, BreezeContext dbContext, ILogger logger)
2426
{
27+
budgets = new BudgetService(config, dbContext, logger);
2528
_config = config;
2629
_logger = logger;
2730
db = dbContext;
@@ -255,6 +258,12 @@ public int CalculateCategoryExpenses(string userId, int categoryId, List<Expense
255258
var amountSpent = expenses.Sum(expense => expense.Amount);
256259

257260
existingCategory.CurrentSpend = amountSpent;
261+
var categories = GetCategoriesByBudgetId(userId, existingCategory.BudgetId);
262+
if (categories == null)
263+
{
264+
return -2;
265+
}
266+
budgets.CalculateBudgetCategories(userId, existingCategory.BudgetId, categories);
258267
db.SaveChanges();
259268
return existingCategory.Id;
260269
}

Breeze.Api/Expenses/ExpenseController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Breeze.Api.Categories;
1+
using Breeze.Api.Budgets;
2+
using Breeze.Api.Categories;
23
using Breeze.Api.Expenses.RequestResponseObjects;
34
using Breeze.Data;
45
using Microsoft.AspNetCore.Authorization;
@@ -81,6 +82,7 @@ public IActionResult PostExpsense(ExpenseRequest expenseRequest)
8182
return BadRequest("Expenses not found");
8283
}
8384
categories.CalculateCategoryExpenses(userId, expenseRequest.CategoryId, expenseList);
85+
8486
return Ok(response);
8587
}
8688
catch (Exception ex)

Breeze.Api/Program.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
});
8383
});
8484

85+
builder.Services.AddControllers();
86+
87+
8588
var app = builder.Build();
8689

8790
app.UseSwagger();
@@ -96,6 +99,13 @@
9699
app.UseCors("production");
97100
}
98101

102+
builder.Services.AddLogging(options =>
103+
{
104+
options.AddConsole();
105+
options.AddDebug();
106+
});
107+
108+
99109
app.UseHttpsRedirection();
100110

101111
app.UseRouting();

Breeze.Api/appsettings.Development.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

Breeze.Api/appsettings.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

Breeze.Sql/Breeze.Sql.sqlproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
5454
</PropertyGroup>
5555
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
56-
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
5756
<ItemGroup>
5857
<Folder Include="Properties" />
5958
</ItemGroup>

0 commit comments

Comments
 (0)