Skip to content

Commit

Permalink
0.11.0-BETA
Browse files Browse the repository at this point in the history
  • Loading branch information
NatanAmorim committed Mar 22, 2024
1 parent 65c0ccf commit 4b9d852
Show file tree
Hide file tree
Showing 52 changed files with 122 additions and 117 deletions.
12 changes: 6 additions & 6 deletions BackgroundJobs/SubscriptionInvoiceBackgroundJob.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.BackgroundServices;
namespace GsServer.BackgroundServices;

/// <summary>
/// Invoice: Lists the products or services delivered or provided, along with
Expand All @@ -25,27 +25,27 @@ protected async override Task ExecuteAsync(CancellationToken stoppingToken)
{
try
{
_logger.LogInformation("Background subscription invoice service started.");
_logger.LogInformation("Background subscription invoice service started");

// Delay for Until 12 AM UTC time asynchronously.
// 9 AM BRT (Brasília Time), UTC/GMT -3 hours.
await Task.Delay((int)Math.Ceiling(MillisecondsUntilTwelveAmUtc()), stoppingToken);

_logger.LogInformation("Background subscription invoice service, generating invoices.");
_logger.LogInformation("Background subscription invoice service, generating invoices");
// TODO

_logger.LogInformation("Background subscription invoice service, sending emails.");
_logger.LogInformation("Background subscription invoice service, sending emails");
// TODO

_logger.LogInformation("Background subscription invoice service work completed.");
_logger.LogInformation("Background subscription invoice service work completed");
}
catch (Exception Exception)
{
_logger.LogError(
"Background invoice service stopped because of an error {Exception}",
Exception
);
// break; // TODO do i need to break?
// break; // TODO do I need to break?
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ e este projeto adere a [Versionamento Semântico (PT-BR)](https://semver.org/lan
- Finish implementation of gRPC with the new protobufs.
-->

## 0.11.0-BETA (Mar 22, 2024)

- Rename Package and Project from "gs_server" to "GsServer".
- Update protobufs from `617c788f5` to `a1d46b748`.

## 0.10.0-BETA (Mar 22, 2024)

- Create "RequestTracerId" in every log using `HttpContext.TraceIdentifier`.
Expand Down Expand Up @@ -65,7 +70,7 @@ e este projeto adere a [Versionamento Semântico (PT-BR)](https://semver.org/lan
- Authentication and Authorization.
- Create `TODO.md`.
- Update protobufs from `3c0043404` to `726541499`.
- Removed wildcard operator `*` in `<ItemGroup>` on `gs_server.csproj` causing a warning loop on vscode when there's an error.
- Removed wildcard operator `*` in `<ItemGroup>` on `GsServer.csproj` causing a warning loop on vscode when there's an error.

## 0.5.0-BETA (Feb 27, 2024)

Expand Down
2 changes: 1 addition & 1 deletion CustomTypes/DecimalValue.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Protobufs;
namespace GsServer.Protobufs;

// Source: https://learn.microsoft.com/en-us/aspnet/core/grpc/protobuf?view=aspnetcore-8.0#decimals
// Source: https://github.com/dotnet-architecture/eBooks/blob/1ed30275281b9060964fcb2a4c363fe7797fe3f3/current/grpc-for-wcf-developers/gRPC-for-WCF-Developers.pdf#decimals
Expand Down
6 changes: 3 additions & 3 deletions Data/DatabaseContext.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
global using Microsoft.EntityFrameworkCore;
using gs_server;
using gs_server.EntityConfigurations;
using gs_server.Models;
using GsServer;
using GsServer.EntityConfigurations;
using GsServer.Models;

public class DatabaseContext(
DbContextOptions<DatabaseContext> options,
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/AttendanceConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class AttendanceConfiguration : IEntityTypeConfiguration<AttendanceModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/BackgroundJobConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class BackgroundJobConfiguration : IEntityTypeConfiguration<BackgroundJobModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/CustomerConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class CustomerConfiguration : IEntityTypeConfiguration<CustomerModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/DisciplineConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class DisciplineConfiguration : IEntityTypeConfiguration<DisciplineModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/InstructorConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class InstructorConfiguration : IEntityTypeConfiguration<InstructorModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/NotificationConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class NotificationConfiguration : IEntityTypeConfiguration<NotificationModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/OrderConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class OrderConfiguration : IEntityTypeConfiguration<OrderModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/PaymentConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class PaymentConfiguration : IEntityTypeConfiguration<PaymentModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/PersonConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class PersonConfiguration : IEntityTypeConfiguration<PersonModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/ProductConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class ProductConfiguration : IEntityTypeConfiguration<ProductModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/PromotionConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class PromotionConfiguration : IEntityTypeConfiguration<PromotionModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/RefreshTokenConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class RefreshTokenConfiguration : IEntityTypeConfiguration<RefreshTokenModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/SaleBillingConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class SaleBillingConfiguration : IEntityTypeConfiguration<SaleBillingModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/SaleConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class SaleConfiguration : IEntityTypeConfiguration<SaleModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/SubscriptionBillingConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class SubscriptionBillingConfiguration : IEntityTypeConfiguration<SubscriptionBillingModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/SubscriptionConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class SubscriptionConfiguration : IEntityTypeConfiguration<SubscriptionModel>
{
Expand Down
4 changes: 2 additions & 2 deletions Data/EntityConfigurations/UserConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using gs_server.Models;
using GsServer.Models;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace gs_server.EntityConfigurations;
namespace GsServer.EntityConfigurations;

public class UserConfiguration : IEntityTypeConfiguration<UserModel>
{
Expand Down
2 changes: 1 addition & 1 deletion Models/AttendanceModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class AttendanceModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/BackgroundJobModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class BackgroundJobModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/CustomerModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class CustomerModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/DisciplineModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class DisciplineModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/InstructorModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class InstructorModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/NotificationModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

// Sends reminders for upcoming events, invoice expirations, etc.
public class NotificationModel
Expand Down
2 changes: 1 addition & 1 deletion Models/OrderModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class OrderModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/PaymentModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class PaymentModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/PersonModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class PersonModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/ProductModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class ProductModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/PromotionModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

/*
Implementation Considerations:
Expand Down
2 changes: 1 addition & 1 deletion Models/RefreshTokenModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class RefreshTokenModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/ReturnModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class ReturnModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/SaleBillingModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

/// <summary>
/// Billing: Refers to the process of stating the amount due to the customer, it
Expand Down
2 changes: 1 addition & 1 deletion Models/SaleModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class SaleModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/SubscriptionBillingModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

/// <summary>
/// Billing: Refers to the process of stating the amount due to the customer, it
Expand Down
2 changes: 1 addition & 1 deletion Models/SubscriptionModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class SubscriptionModel
{
Expand Down
2 changes: 1 addition & 1 deletion Models/UserModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server.Models;
namespace GsServer.Models;

public class UserModel
{
Expand Down
10 changes: 5 additions & 5 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text;
using Amazon.CloudWatchLogs;
using gs_server.BackgroundServices;
using gs_server.Services;
using GsServer.BackgroundServices;
using GsServer.Services;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens;
using Serilog;
Expand Down Expand Up @@ -48,7 +48,7 @@
string AwsSecretAccessKey = builder.Configuration.GetSection("AWS:S3:AwsSecretAccessKey").Value!;

// AWS CloudWatch client
AmazonCloudWatchLogsClient client = new(AwsAccessKeyId, AwsSecretAccessKey);
// AmazonCloudWatchLogsClient client = new(AwsAccessKeyId, AwsSecretAccessKey);

builder.Host.UseSerilog(
(context, configuration) =>
Expand Down Expand Up @@ -90,7 +90,7 @@
}
else
{
Log.Information("Server initialized.");
Log.Information("Server initialized");
}

app.Use(async (context, next) =>
Expand All @@ -109,7 +109,7 @@

// Log response details (e.g., status code, headers)
Log.Information(
"({TraceIdentifier}) Sent gRPC response.",
"({TraceIdentifier}) Sent gRPC response",
context.TraceIdentifier
);
});
Expand Down
2 changes: 1 addition & 1 deletion Result.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace gs_server;
namespace GsServer;

public readonly struct Result<TValue, TError>
{
Expand Down
Loading

0 comments on commit 4b9d852

Please sign in to comment.