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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Initial create lambda for process month-work
lrodolfol committed Nov 28, 2024
commit 0148e3c1632a18b06d5e0d2e94e8323d7e2d9373
23 changes: 23 additions & 0 deletions Serveless/MonthlyClosing/src/MonthlyClosing/CashFlowRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace MonthlyClosing;

public class Model
{
public int ChurchId { get; set; }
public string ChurchName { get; set; } = null!;
public string Competence { get; set; } = null!;
public string OcurredOn { get; set; } = null!;
public List<FlowJsonFile> FlowJsonFile { get; set; } = [];
}

public class FlowJsonFile
{
public string Competence { get; set; }
public DateTime Day { get; set; }
public decimal PreviousBalance { get; set; }
public decimal CurrentBalance { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public decimal AmountInputOperation { get; set; }
public decimal AmountOutPutOperation { get; set; }
public decimal TotalOperation { get; set; }
}
87 changes: 87 additions & 0 deletions Serveless/MonthlyClosing/src/MonthlyClosing/Function.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using Amazon.Lambda.Core;
using Amazon.Lambda.SQSEvents;
using Amazon.S3;
using Amazon.S3.Model;
using QuestPDF.Fluent;
using QuestPDF.Helpers;
using QuestPDF.Infrastructure;
using QuestPDF.Previewer;
using System.Security.Cryptography.X509Certificates;
using System.Text.Json;

[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))]

namespace MonthlyClosing;
public class Function
{
IAmazonS3 S3Client { get; set; }
public Function(IAmazonS3 s3Client)
{
this.S3Client = s3Client;
}
public Function()
{
S3Client = new AmazonS3Client();
}

public async Task FunctionHandler(SQSEvent evnt, ILambdaContext context)
{
foreach (SQSEvent.SQSMessage? message in evnt.Records)
{
await ProcessMessageAsync(message, context);
}
}

private async Task ProcessMessageAsync(SQSEvent.SQSMessage message, ILambdaContext context)
{
context.Logger.LogInformation($"Mensagem para processamento: {message.Body}");
var JsonSerializerOptions = new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
};
try
{
var body = JsonSerializer.Deserialize<Model>(message.Body);
if(body == null)
{
context.Logger.LogError("Error to deserialize message body");
return;
}

await CreatePDF(body);
}
catch (Exception ex)
{
context.Logger.LogError("Error to process message body");
}



// TODO: Do interesting work based on the new message
await Task.CompletedTask;
}

private async Task CreatePDF(Model cashFlowRequest)
{
QuestPDF.Settings.License = LicenseType.Community;

var document = new InvoiceDocument(cashFlowRequest);

//PutObjectRequest request = new PutObjectRequest
//{
// BucketName = "church-manager-uat",
// Key = $"month-work/{FileName}.{ImageType}",
// InputStream = new MemoryStream(imageBytes),
// ContentType = "image/ImageType"
//};

try
{
document.GeneratePdfAndShow();
}catch(Exception ex)
{
throw;
}

}
}
137 changes: 137 additions & 0 deletions Serveless/MonthlyClosing/src/MonthlyClosing/InvoiceDocument.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
using QuestPDF.Fluent;
using QuestPDF.Helpers;
using QuestPDF.Infrastructure;
using System.Reflection;

namespace MonthlyClosing;
internal class InvoiceDocument : IDocument
{
public static Image LogoImage { get; } = Image.FromFile("logo.png");
public Model Model { get; }
public DocumentMetadata GetMetadata() => DocumentMetadata.Default;
public InvoiceDocument(Model model) => Model = model;

public void Compose(IDocumentContainer container)
{
container
.Page(page =>
{
page.Margin(10);

page.PageColor(Colors.Grey.Lighten2);

page.Header().Element(ComposeHeader);
page.Content().Element(ComposeContent);

page.Footer().AlignCenter().Text(text =>
{
text.CurrentPageNumber();
text.Span(" / ");
text.TotalPages();
});
});
}

void ComposeHeader(IContainer container)
{
container.Row(row =>
{
row.RelativeItem().Column(column =>
{
column
.Item().Text($"{Model.ChurchName}")
.FontSize(20).SemiBold().FontColor(Colors.Black);

column.Item().Text(text =>
{
text.Span($"Competencia: {Model.Competence}").SemiBold();
});
});

row.ConstantItem(175).Image(LogoImage);
});
}

void ComposeContent(IContainer container)
{
container.PaddingVertical(40).Column(column =>
{
column.Spacing(20);

column.Item().Element(ComposeTable);

decimal totalPrice = 0;
totalPrice = Model.FlowJsonFile.Last().CurrentBalance;

column.Item().PaddingRight(5).AlignRight().Text($"Valor total final: {totalPrice:C}").SemiBold();

//if (!string.IsNullOrWhiteSpace("titulo comentarios"))
// column.Item().PaddingTop(25).Element(ComposeComments);
});
}

void ComposeTable(IContainer container)
{
var headerStyle = TextStyle.Default.SemiBold();

container.Table(table =>
{
table.ColumnsDefinition(columns =>
{
columns.ConstantColumn(25);
columns.RelativeColumn(10);
columns.RelativeColumn(10);
columns.RelativeColumn(10);
columns.RelativeColumn(10);
columns.RelativeColumn(10);
columns.RelativeColumn(10);
columns.RelativeColumn(10);
columns.RelativeColumn(10);
});

table.Header(header =>
{
header.Cell().Text("#").FontSize(5);
header.Cell().AlignRight().Text("Competencia").Style(headerStyle).FontSize(5);
header.Cell().AlignRight().Text("Dia").Style(headerStyle).FontSize(5);
header.Cell().AlignRight().Text("Valor anterior").Style(headerStyle).FontSize(5);
header.Cell().AlignRight().Text("Valor atual").Style(headerStyle).FontSize(5);
header.Cell().AlignRight().Text("Titulo").Style(headerStyle).FontSize(5);
header.Cell().AlignRight().Text("Valor entrada").Style(headerStyle).FontSize(5);
header.Cell().AlignRight().Text("Valor saida").Style(headerStyle).FontSize(5);
header.Cell().AlignRight().Text("Total Operacao").Style(headerStyle).FontSize(5);

header.Cell().ColumnSpan(9).PaddingTop(9).BorderBottom(1).BorderColor(Colors.Black);
});

var index = 0;
foreach (var item in Model.FlowJsonFile)
{
index++;

table.Cell().Element(CellStyle).Text($"{index}").FontSize(5);
table.Cell().Element(CellStyle).AlignRight().Text(item.Competence).FontSize(5);
table.Cell().Element(CellStyle).AlignRight().Text($"{Convert.ToDateTime(item.Day).ToString("yyyy-MM-dd")}").FontSize(5);
table.Cell().Element(CellStyle).AlignRight().Text($"{item.PreviousBalance}").FontSize(5);
table.Cell().Element(CellStyle).AlignRight().Text($"{item.CurrentBalance}").FontSize(5);
table.Cell().Element(CellStyle).AlignRight().Text($"{item.Description}").FontSize(5);
table.Cell().Element(CellStyle).AlignRight().Text($"{item.AmountInputOperation}").FontSize(5);
table.Cell().Element(CellStyle).AlignRight().Text($"{item.AmountOutPutOperation}").FontSize(5);
table.Cell().Element(CellStyle).AlignRight().Text($"{item.TotalOperation}").FontSize(5);

static IContainer CellStyle(IContainer container) => container.BorderBottom(1).BorderColor(Colors.Grey.Lighten2).PaddingVertical(5);
}
});

}

void ComposeComments(IContainer container)
{
container.ShowEntire().Background(Colors.Grey.Lighten3).Padding(10).Column(column =>
{
column.Spacing(5);
column.Item().Text("").FontSize(14).SemiBold();
column.Item().Text("");
});
}
}
25 changes: 25 additions & 0 deletions Serveless/MonthlyClosing/src/MonthlyClosing/MonthlyClosing.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
<!-- This property makes the build directory similar to a publish directory and helps the AWS .NET Lambda Mock Test Tool find project dependencies. -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!-- Generate ready to run images during publishing to improve cold start time. -->
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="2.2.0" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.1" />
<PackageReference Include="Amazon.Lambda.SQSEvents" Version="2.2.0" />
<PackageReference Include="AWSSDK.S3" Version="3.7.408" />
<PackageReference Include="QuestPDF" Version="2024.10.3" />
</ItemGroup>
<ItemGroup>
<None Update="logo.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"profiles": {
"Mock Lambda Test Tool": {
"commandName": "Executable",
"commandLineArgs": "--port 5050",
"workingDirectory": ".\\bin\\$(Configuration)\\net8.0",
"executablePath": "%USERPROFILE%\\.dotnet\\tools\\dotnet-lambda-test-tool-8.0.exe"
}
}
}
51 changes: 51 additions & 0 deletions Serveless/MonthlyClosing/src/MonthlyClosing/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# AWS Lambda Simple SQS Function Project

This starter project consists of:
* Function.cs - class file containing a class with a single function handler method
* aws-lambda-tools-defaults.json - default argument settings for use with Visual Studio and command line deployment tools for AWS

You may also have a test project depending on the options selected.

The generated function handler responds to events on an Amazon SQS queue.

After deploying your function you must configure an Amazon SQS queue as an event source to trigger your Lambda function.

## Here are some steps to follow from Visual Studio:

To deploy your function to AWS Lambda, right click the project in Solution Explorer and select *Publish to AWS Lambda*.

To view your deployed function open its Function View window by double-clicking the function name shown beneath the AWS Lambda node in the AWS Explorer tree.

To perform testing against your deployed function use the Test Invoke tab in the opened Function View window.

To configure event sources for your deployed function use the Event Sources tab in the opened Function View window.

To update the runtime configuration of your deployed function use the Configuration tab in the opened Function View window.

To view execution logs of invocations of your function use the Logs tab in the opened Function View window.

## Here are some steps to follow to get started from the command line:

Once you have edited your template and code you can deploy your application using the [Amazon.Lambda.Tools Global Tool](https://github.com/aws/aws-extensions-for-dotnet-cli#aws-lambda-amazonlambdatools) from the command line.

Install Amazon.Lambda.Tools Global Tools if not already installed.
```
dotnet tool install -g Amazon.Lambda.Tools
```

If already installed check if new version is available.
```
dotnet tool update -g Amazon.Lambda.Tools
```

Execute unit tests
```
cd "MonthlyClosing/test/MonthlyClosing.Tests"
dotnet test
```

Deploy function to AWS Lambda
```
cd "MonthlyClosing/src/MonthlyClosing"
dotnet lambda deploy-function
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"Information": [
"This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.",
"To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.",
"dotnet lambda help",
"All the command line options for the Lambda command can be specified in this file."
],
"profile": "",
"region": "",
"configuration": "Release",
"function-runtime": "dotnet8",
"function-memory-size": 512,
"function-timeout": 30,
"function-role": "arn:aws:iam::197163972763:role/permissoesBasicas",
"function-handler": "MonthlyClosing::MonthlyClosing.Function::FunctionHandler",
"function-name": "MonthlyClosing"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Serveless/MonthlyClosing/test/MonthlyClosing.Tests/FunctionTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Xunit;
using Amazon.Lambda.TestUtilities;
using Amazon.Lambda.SQSEvents;

namespace MonthlyClosing.Tests;

public class FunctionTest
{
[Fact]
public async Task TestSQSEventLambdaFunction()
{
var sqsEvent = new SQSEvent
{
Records = new List<SQSEvent.SQSMessage>
{
new SQSEvent.SQSMessage
{
Body = "{\"ChurchId\":1,\"ChurchName\":\"CEOS\\u00E3oLouren\\u00E7o\",\"Competence\":\"2024-08-01\",\"FlowJsonFile\":[{\"Competence\":\"11/2024\",\"Day\":\"2024-08-19T00:00:00\",\"PreviousBalance\":0,\"CurrentBalance\":-102.00,\"Title\":null,\"Description\":\"Saidadecaixa1\",\"AmountInputOperation\":0.00,\"AmountOutPutOperation\":102.00,\"TotalOperation\":0},{\"Competence\":\"2023/03\",\"Day\":\"2024-08-24T00:00:00\",\"PreviousBalance\":-102.00,\"CurrentBalance\":-89.20,\"Title\":null,\"Description\":\"ofertadoirmao/irma\",\"AmountInputOperation\":12.80,\"AmountOutPutOperation\":0.00,\"TotalOperation\":0},{\"Competence\":\"2023/02\",\"Day\":\"2024-08-19T00:00:00\",\"PreviousBalance\":-89.20,\"CurrentBalance\":-33.30,\"Title\":null,\"Description\":\"ofertadoirmao/irma\",\"AmountInputOperation\":55.90,\"AmountOutPutOperation\":0.00,\"TotalOperation\":0},{\"Competence\":\"2023/05\",\"Day\":\"2024-08-04T00:00:00\",\"PreviousBalance\":-33.30,\"CurrentBalance\":-20.50,\"Title\":null,\"Description\":\"ofertadoirmao/irma\",\"AmountInputOperation\":12.80,\"AmountOutPutOperation\":0.00,\"TotalOperation\":0},{\"Competence\":\"04/2023\",\"Day\":\"2024-08-29T00:00:00\",\"PreviousBalance\":-20.50,\"CurrentBalance\":36.10,\"Title\":null,\"Description\":\"Primiciasdoirmao/irma\",\"AmountInputOperation\":56.60,\"AmountOutPutOperation\":0.00,\"TotalOperation\":0},{\"Competence\":\"02/2023\",\"Day\":\"2024-08-14T00:00:00\",\"PreviousBalance\":36.10,\"CurrentBalance\":192.70,\"Title\":null,\"Description\":\"Primiciasdoirmao/irma\",\"AmountInputOperation\":156.60,\"AmountOutPutOperation\":0.00,\"TotalOperation\":0}],\"OcurredOn\":\"2024-11-28T00:16:03.673645Z\"}"
}
}
};

var logger = new TestLambdaLogger();
var context = new TestLambdaContext
{
Logger = logger
};

var function = new Function();
await function.FunctionHandler(sqsEvent, context);

Assert.Equal(1, 1);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="2.2.0" />
<PackageReference Include="Amazon.Lambda.TestUtilities" Version="2.0.0" />
<PackageReference Include="Amazon.Lambda.SQSEvents" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\MonthlyClosing\MonthlyClosing.csproj" />
</ItemGroup>
</Project>
31 changes: 31 additions & 0 deletions Serveless/Serveless.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonthlyClosing", "MonthlyClosing\src\MonthlyClosing\MonthlyClosing.csproj", "{A1D62D63-854E-46F2-A2C3-004EA6E405BD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MonthlyClosing.Tests", "MonthlyClosing\test\MonthlyClosing.Tests\MonthlyClosing.Tests.csproj", "{14B0F931-BE2A-4636-8C3F-C178937B8FC0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A1D62D63-854E-46F2-A2C3-004EA6E405BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1D62D63-854E-46F2-A2C3-004EA6E405BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1D62D63-854E-46F2-A2C3-004EA6E405BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1D62D63-854E-46F2-A2C3-004EA6E405BD}.Release|Any CPU.Build.0 = Release|Any CPU
{14B0F931-BE2A-4636-8C3F-C178937B8FC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14B0F931-BE2A-4636-8C3F-C178937B8FC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14B0F931-BE2A-4636-8C3F-C178937B8FC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14B0F931-BE2A-4636-8C3F-C178937B8FC0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DF0501C1-6687-4D6E-9B51-8C8B709CA581}
EndGlobalSection
EndGlobal