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

Update branch #39

Merged
merged 130 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
b52fd0c
update for builder configuration mock
lrodolfol Sep 20, 2024
1fc3922
fix check month work
lrodolfol Sep 20, 2024
21e9c5e
remove invalid aseets test
lrodolfol Sep 20, 2024
193cace
update unit test
lrodolfol Sep 20, 2024
75d4335
appsettings into test project
lrodolfol Sep 22, 2024
9de23a4
update test for ci
lrodolfol Sep 28, 2024
5d517a1
update workflow for CI
lrodolfol Sep 28, 2024
e88f72f
set new branch for CI
lrodolfol Sep 28, 2024
0331e92
fix new branch name for CI
lrodolfol Sep 28, 2024
33a3be7
alter restore script
lrodolfol Sep 28, 2024
a52e02f
alter build script
lrodolfol Sep 28, 2024
c117996
update test script
lrodolfol Sep 28, 2024
36fac20
update test script
lrodolfol Sep 28, 2024
2d6e74f
remove no-restore from test script
lrodolfol Sep 28, 2024
762ae2f
update test script using just dotnet test
lrodolfol Sep 28, 2024
a247fdf
update script
lrodolfol Sep 28, 2024
a465054
update script workflow
lrodolfol Sep 28, 2024
0bb7d6d
fsdf
lrodolfol Sep 28, 2024
f551bac
update app with test without dependencies externals
lrodolfol Oct 3, 2024
dda32fb
Wait save image async
lrodolfol Oct 5, 2024
67e85e9
update handlers with inversion controll for save image
lrodolfol Oct 5, 2024
83e721f
Test with save S3 Image
lrodolfol Oct 5, 2024
22cdc2a
show data after test
lrodolfol Oct 5, 2024
561404a
remove cw on test
lrodolfol Oct 5, 2024
f33cdc8
update script test
lrodolfol Oct 5, 2024
0695ceb
update test script
lrodolfol Oct 5, 2024
c843d98
fix test
lrodolfol Oct 5, 2024
8eb8337
--verbosity normal
lrodolfol Oct 5, 2024
82bd495
-- no restore
lrodolfol Oct 5, 2024
f7a201c
invert order
lrodolfol Oct 5, 2024
6e36a5e
mock function for put
lrodolfol Oct 5, 2024
0273960
remove no restore
lrodolfol Oct 5, 2024
514be83
remove fail test
lrodolfol Oct 5, 2024
e8e6f5a
remove --verbosiry
lrodolfol Oct 5, 2024
d56bce5
remove test
lrodolfol Oct 5, 2024
2ba2d3f
add yml cin on solution
lrodolfol Oct 5, 2024
f45965f
permissions report
lrodolfol Oct 5, 2024
f1b40c5
order permissions
lrodolfol Oct 5, 2024
8ed3f44
more permissions
lrodolfol Oct 5, 2024
2bcba82
dony test
lrodolfol Oct 6, 2024
dedae37
remove report
lrodolfol Oct 6, 2024
8d7f196
push image to dockerhub
lrodolfol Oct 6, 2024
c3c1a35
fix secrets CI
lrodolfol Oct 7, 2024
4b32ab4
upda branch name
lrodolfol Oct 7, 2024
a6d9710
fix image_name env
lrodolfol Oct 7, 2024
451a43d
fix BUILD_TAG
lrodolfol Oct 7, 2024
6ae861a
remove GHRCR
lrodolfol Oct 7, 2024
e3eb6ae
fix tags build image
lrodolfol Oct 7, 2024
dc4a094
fix path Docker File
lrodolfol Oct 7, 2024
30dd711
fix path context build image
lrodolfol Oct 7, 2024
aa8abe9
remove blank line
lrodolfol Oct 8, 2024
92266b1
.
lrodolfol Oct 8, 2024
13edbc4
update tag image
lrodolfol Oct 8, 2024
0d676d7
.
lrodolfol Oct 8, 2024
3448b94
do not use httpsRedirection
lrodolfol Oct 8, 2024
b9bb1d8
show environment before application initialization
lrodolfol Oct 8, 2024
de1b43c
test show key aws
lrodolfol Oct 8, 2024
65bf44f
get aws config from environment
lrodolfol Oct 9, 2024
d225994
fix key env
lrodolfol Oct 9, 2024
d2d864d
add appsetting-uat gon git
lrodolfol Oct 9, 2024
9dc1a11
fix por mysql uat container
lrodolfol Oct 9, 2024
a0dbb64
fix user repository maper config
lrodolfol Oct 10, 2024
f6414cb
compose dev
lrodolfol Oct 10, 2024
7d63920
update yml for image version
lrodolfol Oct 10, 2024
0b5b3a3
Merge pull request #31 from lrodolfol/ci
lrodolfol Oct 10, 2024
08db9fd
first fruits with cache
lrodolfol Nov 6, 2024
225d649
Meeting kind with cache
lrodolfol Nov 6, 2024
05222dd
delete cache on delete first fruits get by id
lrodolfol Nov 6, 2024
b5fa595
set time expiration fo first fruits cache
lrodolfol Nov 6, 2024
38bae4d
carrection absoluteExpirition by now
lrodolfol Nov 6, 2024
f2fa7da
set cache for first fruits by period
lrodolfol Nov 6, 2024
65fad76
fix AbsoluteExpirationRelativeToNow
lrodolfol Nov 6, 2024
7a46d6b
set cache to member handlers
lrodolfol Nov 7, 2024
13a917d
set cache for offerings
lrodolfol Nov 7, 2024
753c0b3
comment alert
lrodolfol Nov 7, 2024
a47242e
set cache to outflows
lrodolfol Nov 7, 2024
ba8e1d5
set cache to outflow kind
lrodolfol Nov 7, 2024
72505aa
set cache to posts
lrodolfol Nov 7, 2024
15c4381
temporary ajust to tests
lrodolfol Nov 7, 2024
9bfe032
set cache to posts
lrodolfol Nov 7, 2024
c158823
fix cache for period with churchId
lrodolfol Nov 7, 2024
eb64944
set cache to offering kind
lrodolfol Nov 7, 2024
96ff1c1
set cache for Users
lrodolfol Nov 7, 2024
0d2046a
configs for local redis
lrodolfol Nov 8, 2024
4e9de51
Isntall and configurate local redis for development
lrodolfol Nov 8, 2024
9713a59
set distributed cache for monthWork operation
lrodolfol Nov 8, 2024
64c07d7
Temporary ajuste for unit teste
lrodolfol Nov 8, 2024
43d514d
set confir for uat and prod environment
lrodolfol Nov 8, 2024
b43a0d6
segregate responsability on monthly report
lrodolfol Nov 8, 2024
6baf0ff
crate method for cache abstraction
lrodolfol Nov 8, 2024
6a167bc
create handle with cache for get report after monthly closing
lrodolfol Nov 8, 2024
d15df78
Correction code for set cache
lrodolfol Nov 8, 2024
6a86d66
Authorization for get reports
lrodolfol Nov 9, 2024
cacb5e0
Controller for get monthly closing report
lrodolfol Nov 9, 2024
7e348a4
.
lrodolfol Nov 9, 2024
fe17491
Method to remove cache from redis
lrodolfol Nov 9, 2024
20d3e59
handler unset cache and get monthly report
lrodolfol Nov 9, 2024
c7118f3
temporary ajust for test
lrodolfol Nov 9, 2024
2b6d970
fix yml environment
lrodolfol Nov 9, 2024
3b080d2
update compose dev
lrodolfol Nov 9, 2024
2f1c3b0
ajust appsettings uat
lrodolfol Nov 9, 2024
14181d1
ajust connection config caching uat. Maybe its unecessary
lrodolfol Nov 9, 2024
3596478
skipt test [nedd update tests]
lrodolfol Nov 9, 2024
4bfc12a
Merge pull request #32 from lrodolfol/feat/cache
lrodolfol Nov 9, 2024
235d6d5
fix aws region
lrodolfol Nov 13, 2024
52e37e3
SQS Queue name
lrodolfol Nov 13, 2024
a118aa7
static propertie configuration to SQS Name
lrodolfol Nov 13, 2024
a3cbc77
new jsonFile propertie to MonthlyClosing events
lrodolfol Nov 13, 2024
d5a88a6
Install SQS library
lrodolfol Nov 13, 2024
31474f1
update AWSSDK version
lrodolfol Nov 13, 2024
4684937
update AWSSDK version
lrodolfol Nov 13, 2024
44833e7
Message events update and create monthClosed event
lrodolfol Nov 13, 2024
07b39bd
.
lrodolfol Nov 13, 2024
26ae16d
MonthlyClosing helper with method to call Monthly Closing event
lrodolfol Nov 13, 2024
462b0e0
Merge pull request #33 from lrodolfol/feature/monthly-closing-sqs
lrodolfol Nov 13, 2024
edd93c1
Update README.md
lrodolfol Nov 13, 2024
c60f0b0
Update README.md
lrodolfol Nov 13, 2024
bd4108a
update migrations
lrodolfol Nov 27, 2024
0d8fa37
create new fields
lrodolfol Nov 27, 2024
86a90db
update map monthwork values
lrodolfol Nov 27, 2024
ca40028
Methods for set initial and final values
lrodolfol Nov 27, 2024
de98f65
fix script query for monthwork
lrodolfol Nov 27, 2024
d9faaa4
Generate report before persist data
lrodolfol Nov 27, 2024
fe690cd
set churchName and change from IEnumerable to List jsonfile
lrodolfol Nov 28, 2024
0148e3c
Initial create lambda for process month-work
lrodolfol Nov 28, 2024
47346b4
update logo
lrodolfol Nov 28, 2024
f64b12c
Send pdf file to S3
lrodolfol Nov 28, 2024
e8c3450
show error message
lrodolfol Nov 30, 2024
336b8ee
refactor rename sqs client name
lrodolfol Nov 30, 2024
be82e93
Merge pull request #34 from lrodolfol/feat/lambda-month-work
lrodolfol Nov 30, 2024
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
169 changes: 117 additions & 52 deletions .github/workflows/main_churchmanager.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,122 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy ASP.Net Core app to Azure Web App - churchmanager
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: CI churchManager

on:
push:
branches:
- main
workflow_dispatch:
branches: [ "main", "master", "ci" ]
pull_request:
branches: [ "main", "master", "ci" ]

env:
IMAGE_NAME: rodolfojesus/church-manager

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'
include-prerelease: true

- name: Build with dotnet
run: dotnet build ./Registration/src/Application/Registration.API/Registration.API.csproj --configuration Release

- name: dotnet publish
run: dotnet publish ./Registration/src/Application/Registration.API/Registration.API.csproj -c Release -o ${{env.DOTNET_ROOT}}/myapp

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: .net-app
path: ${{env.DOTNET_ROOT}}/myapp

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: .net-app

- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'churchmanager'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_7F53C6FD785745CAADB6C1E603A085F5 }}
package: .
tests:
name: Tests
runs-on: ubuntu-latest

permissions:
id-token: write
contents: read
packages: write
actions: read
checks: read
pull-requests: read

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore API
run: dotnet restore ./Registration/src/Application/Registration.API/Registration.API.csproj
- name: Restore DI
run: dotnet restore ./Registration/src/Service/Registration.DependencyInjection/Registration.DependencyInjection.csproj
- name: Restore Package
run: dotnet restore ./Registration/src/Domain/Registration.CentralPackages/Registration.CentralPackages.csproj
- name: Restore DomainCore
run: dotnet restore ./Registration/src/Domain/Registration.DomainCore/Registration.DomainCore.csproj
- name: Restore DomainBase
run: dotnet restore ./Registration/src/Domain/Registration.DomainBase/Registration.DomainBase.csproj
- name: Restore Handlers
run: dotnet restore ./Registration/src/Service/Registration.Handlers/Registration.Handlers.csproj
- name: Restore Repository
run: dotnet restore ./Registration/src/Repository/Registration.Repository/Registration.Repository.csproj
- name: Restore Resources
run: dotnet restore ./Registration/src/Infrastructure/Registration.Resources/Registration.Resources.csproj
- name: Restore Mapper
run: dotnet restore ./Registration/src/Service/Registration.Mapper/Registration.Mapper.csproj
- name: Restore MessageBroker
run: dotnet restore ./Registration/src/Service/MessageBroker/MessageBroker.csproj
- name: Restore Infrastructure
run: dotnet restore ./Registration/src/Infrastructure/Registration.Infrastructure/Registration.Infrastructure.csproj
- name: Restore CloudServices
run: dotnet restore ./Registration/src/Service/CloudServices/CloudServices.csproj

- name: Build API
run: dotnet build ./Registration/src/Application/Registration.API/Registration.API.csproj --configuration Release
- name: Build DependencyInjection
run: dotnet build ./Registration/src/Service/Registration.DependencyInjection/Registration.DependencyInjection.csproj --configuration Release
- name: Build CentralPackages
run: dotnet build ./Registration/src/Domain/Registration.CentralPackages/Registration.CentralPackages.csproj --configuration Release
- name: Build DomainCore
run: dotnet build ./Registration/src/Domain/Registration.DomainCore/Registration.DomainCore.csproj --configuration Release
- name: Build DomainBase
run: dotnet build ./Registration/src/Domain/Registration.DomainBase/Registration.DomainBase.csproj --configuration Release
- name: Build Handlers
run: dotnet build ./Registration/src/Service/Registration.Handlers/Registration.Handlers.csproj --configuration Release
- name: Build Repository
run: dotnet build ./Registration/src/Repository/Registration.Repository/Registration.Repository.csproj --configuration Release
- name: Build Resources
run: dotnet build ./Registration/src/Infrastructure/Registration.Resources/Registration.Resources.csproj --configuration Release
- name: Build Mapper
run: dotnet build ./Registration/src/Service/Registration.Mapper/Registration.Mapper.csproj --configuration Release
- name: Build MessageBroker
run: dotnet build ./Registration/src/Service/MessageBroker/MessageBroker.csproj --configuration Release
- name: Build Infrastructure
run: dotnet build ./Registration/src/Infrastructure/Registration.Infrastructure/Registration.Infrastructure.csproj --configuration Release
- name: Build CloudServices
run: dotnet build ./Registration/src/Service/CloudServices/CloudServices.csproj --configuration Release

- name: Test
run: dotnet test ./Registration/src/Test/HandlerTest/HandlersTest.csproj

build:
name: Build and publish image
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Set BUILD_TAG
run: |
echo BUILD_TAG=$(echo ${{ github.head_ref || github.ref_name }} | sed "s,/,_,g")-${{ github.run_number }} >> $GITHUB_ENV

- name: Print BUILD_TAG defined
run: |
echo "Branch ---> ${{ github.head_ref || github.ref_name }}"
echo "Run number ---> ${{ github.run_number }}"
echo "Tag ---> ${{ env.BUILD_TAG }}"

- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUBUSERNAME }}
password: ${{ secrets.DOCKERHUBTOKEN }}

- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: ./Registration
file: ./Registration/Dockerfile
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.BUILD_TAG }},${{ env.IMAGE_NAME }}:latest
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# church-cash-flow
Aplicação para caixa de igreja e filiais

# Church - Tesouraria e Secretaria (em desenvolvimento)

Uma breve descrição sobre o que esse projeto faz e para quem ele éUma breve descrição sobre o que esse projeto faz e para quem ele é Uma breve descrição sobre o que esse projeto faz e para quem ele é Uma breve descrição sobre o que esse projeto faz e para quem ele é Uma breve descrição sobre o que esse projeto faz e para quem ele é.


## Demonstração

https://seibert.group/blog/en/wp-content/uploads/sites/2/2023/01/AWS.jpeg


## Documentação

[Documentação](https://link-da-documentação)


## Autores

- [Rodolfo Jesus](https://www.linkedin.com/in/rodolfojesus/)

6 changes: 5 additions & 1 deletion Registration/Registration.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Registration.API", "Registr
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Itens de Solução", "Itens de Solução", "{6595EA70-E381-4A77-89BE-D0D32C357217}"
ProjectSection(SolutionItems) = preProject
docker-compose.dev.yml = docker-compose.dev.yml
docker-compose.uat.yml = docker-compose.uat.yml
Dockerfile = Dockerfile
initialScript.sql = initialScript.sql
..\.github\workflows\main_churchmanager.yml = ..\.github\workflows\main_churchmanager.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Registration.API", "src\Application\Registration.API\Registration.API.csproj", "{3527C8A1-9F2D-4CC0-B239-04E191B7456A}"
Expand Down Expand Up @@ -46,7 +50,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{097130F7-5
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HandlersTest", "src\Test\HandlerTest\HandlersTest.csproj", "{E622D748-4C21-44B7-8382-F07448215A56}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CloudServices", "src\Service\CloudServices\CloudServices.csproj", "{1F0998E2-1DB3-4F27-B69C-BCDA2899C832}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CloudServices", "src\Service\CloudServices\CloudServices.csproj", "{1F0998E2-1DB3-4F27-B69C-BCDA2899C832}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
47 changes: 45 additions & 2 deletions Registration/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,53 @@ services:
dockerfile: Dockerfile
command: dotnet run
ports:
- 7171:8181
- 7272:8181
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_ENVIRONMENT=dev
- KEYUSERCREATED=AAECAwQFBgcICQoUAT0ODw==
- PASSEMAIL=#senhaforte123
- AWS_ACCESS_KEY_ID=YOUR-KEY
- AWS_SECRET_ACCESS_KEY=YOUR-SECRET
- AWS_SESSION_TOKEN=your_session_token
depends_on:
- churchmanagerdb
- rabbitDocker-dev
networks:
- netchurchmanager

churchmanagerdb:
container_name: churchmanagerdb-dev
hostname: churchmanagerdb
image: mysql
ports:
- 3308:3306
environment:
- MYSQL_ROOT_PASSWORD=sinqia123
- MYSQL_DATABASE=ChurchCashFlow
networks:
- netchurchmanager

rabbitDocker-dev:
container_name: rabbitDocker-dev
image: rabbitmq:3-management
ports:
- 5674:5672
- 15674:15672
environment:
- RABBITMQ_DEFAULT_USER=sinqia
- RABBITMQ_DEFAULT_PASS=sinqia123
networks:
- netchurchmanager

redis:
image: redis:latest
container_name: redis-UAT
ports:
- "6379:6379"
environment:
- REDIS_PASSWORD=sinqia123
command: redis-server --save 20 1 --loglevel warning --requirepass sinqia123
restart: unless-stopped
networks:
- netchurchmanager

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Registration.DomainBase.Entities.Operations.RequestsControllers;
using Registration.DomainCore.ViewModelAbstraction;
using Registration.Handlers.Handlers.Operations;
using Registration.Mapper.DTOs.Registration.MonthWork;

namespace Registration.API.Controllers.Operations;

Expand All @@ -16,7 +18,7 @@ public ReportsController(CViewModel? viewModel, ReportsHandlers handler)
_handler = handler!;
}


[Authorize(Roles = "M-TRS, L-TRS")]
[HttpGet("/api/v1/tithers")]
public async Task<IActionResult> Tithers([FromBody] TithersRequest tithers)
{
Expand All @@ -26,6 +28,7 @@ public async Task<IActionResult> Tithers([FromBody] TithersRequest tithers)

}

[Authorize(Roles = "M-TRS, L-TRS")]
[HttpGet("/api/v1/offers")]
public async Task<IActionResult> Offers([FromBody] OfferingRequest offering)
{
Expand All @@ -35,6 +38,7 @@ public async Task<IActionResult> Offers([FromBody] OfferingRequest offering)

}

[Authorize(Roles = "M-TRS, L-TRS")]
[HttpGet("/api/v1/fruiters")]
public async Task<IActionResult> Fruiters([FromBody] FirstFruitsRequest offering)
{
Expand All @@ -43,4 +47,14 @@ public async Task<IActionResult> Fruiters([FromBody] FirstFruitsRequest offering
return StatusCode(_handler.GetStatusCode(), resultViewModel);

}

[Authorize(Roles = "M-TRS, L-TRS")]
[HttpGet("/api/v1/monthly-closing")]
public async Task<IActionResult> MonthlyClosing([FromBody] EditMonthWorkDto dto)
{
var resultViewModel = await _handler.MonthlyClosingReportAsync(dto);

return StatusCode(_handler.GetStatusCode(), resultViewModel);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.AspNetCore.Authorization;
using Registration.Handlers.Handlers.Registrations;
using Registration.Mapper.DTOs.Registration.FirstFruits;
using Microsoft.Extensions.Caching.Memory;

namespace Registration.API.Controllers.Registrations;

Expand Down Expand Up @@ -73,7 +74,7 @@ public async Task<IActionResult> Create([FromBody] EditFirstFruitsDto firstFruit
return BadRequest(_viewModel);
}

var resultViewModel = await _handler.CreateAsyn(firstFruitsDto);
var resultViewModel = await _handler.CreateAsync(firstFruitsDto);

return StatusCode(_handler.GetStatusCode(), resultViewModel);
}
Expand Down
Loading
Loading