Skip to content

Commit

Permalink
Merge pull request #42 from KNPhilip/deployment
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
KNPhilip authored Feb 21, 2024
2 parents af04226 + b885199 commit 9227311
Show file tree
Hide file tree
Showing 83 changed files with 327 additions and 311 deletions.
4 changes: 2 additions & 2 deletions src/AuctionService/Consumers/AuctionCreatedFaultConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AuctionService.Consumers
{
public class AuctionCreatedFaultConsumer : IConsumer<Fault<AuctionCreated>>
public sealed class AuctionCreatedFaultConsumer : IConsumer<Fault<AuctionCreated>>
{
public async Task Consume(ConsumeContext<Fault<AuctionCreated>> context)
{
Expand All @@ -22,4 +22,4 @@ public async Task Consume(ConsumeContext<Fault<AuctionCreated>> context)
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Consumers/AuctionFinishedConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace AuctionService.Consumers
{
public class AuctionFinishedConsumer(AuctionContext dbContext) : IConsumer<AuctionFinished>
public sealed class AuctionFinishedConsumer(AuctionContext dbContext) : IConsumer<AuctionFinished>
{
public async Task Consume(ConsumeContext<AuctionFinished> context)
{
Expand All @@ -25,4 +25,4 @@ public async Task Consume(ConsumeContext<AuctionFinished> context)
await dbContext.SaveChangesAsync();
}
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Consumers/BidPlacedConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace AuctionService.Consumers
{
public class BidPlacedConsumer(AuctionContext dbContext) : IConsumer<BidPlaced>
public sealed class BidPlacedConsumer(AuctionContext dbContext) : IConsumer<BidPlaced>
{
public async Task Consume(ConsumeContext<BidPlaced> context)
{
Expand All @@ -22,4 +22,4 @@ public async Task Consume(ConsumeContext<BidPlaced> context)
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Contracts/AuctionCreated.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Contracts
{
public class AuctionCreated
public sealed class AuctionCreated
{
public Guid Id { get; set; }
public int ReservePrice { get; set; }
Expand All @@ -19,4 +19,4 @@ public class AuctionCreated
public int Mileage { get; set; }
public string ImageUrl { get; set; } = string.Empty;
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Contracts/AuctionDeleted.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Contracts
{
public class AuctionDeleted
public sealed class AuctionDeleted
{
public string? Id { get; set; }
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Contracts/AuctionFinished.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace AuctionService.Contracts
{
public class AuctionFinished
public sealed class AuctionFinished
{
public bool ItemSold { get; set; }
public string? AuctionId { get; set; }
public string? Winner { get; set; }
public string? Seller { get; set; }
public int? Amount { get; set; }
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Contracts/AuctionUpdated.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Contracts
{
public class AuctionUpdated
public sealed class AuctionUpdated
{
public string? Id { get; set; }
public string? Make { get; set; }
Expand All @@ -9,4 +9,4 @@ public class AuctionUpdated
public string? Color { get; set; }
public int Mileage { get; set; }
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Contracts/BidPlaced.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AuctionService.Contracts
{
public class BidPlaced
public sealed class BidPlaced
{
public string? Id { get; set; }
public string? AuctionId { get; set; }
Expand All @@ -9,4 +9,4 @@ public class BidPlaced
public int Amount { get; set; }
public string? BidStatus { get; set; }
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Controllers/AuctionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace AuctionService.Controllers
{
[ApiController]
[Route("api/[controller]")]
public class AuctionsController(IMapper mapper, IPublishEndpoint publishEndpoint,
public sealed class AuctionsController(IMapper mapper, IPublishEndpoint publishEndpoint,
IAuctionRepository auctionRepository) : ControllerBase
{
[HttpGet]
Expand Down Expand Up @@ -90,4 +90,4 @@ public async Task<ActionResult> DeleteAuction(Guid id)
return success ? Ok() : BadRequest("Could not update the database.");
}
}
}
}
6 changes: 3 additions & 3 deletions src/AuctionService/Data/AuctionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace AuctionService.Data
{
public class AuctionContext(DbContextOptions options) : DbContext(options)
public sealed class AuctionContext(DbContextOptions options) : DbContext(options)
{
public DbSet<Auction> Auctions { get; set; }

protected override void OnModelCreating(ModelBuilder modelBuilder)
protected sealed override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);

Expand All @@ -17,4 +17,4 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.AddOutboxStateEntity();
}
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Data/DbInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace AuctionService.Data
{
public class DbInitializer
public sealed class DbInitializer
{
public static void InitDb(WebApplication app)
{
Expand Down Expand Up @@ -210,4 +210,4 @@ public static List<Auction> GetDbAuctions() =>
}
];
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Dtos/AuctionDto.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AuctionService.Dtos
{
public class AuctionDto
public sealed class AuctionDto
{
public Guid Id { get; set; }
public int ReservePrice { get; set; }
Expand All @@ -19,4 +19,4 @@ public class AuctionDto
public int Mileage { get; set; }
public string ImageUrl { get; set; } = string.Empty;
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Dtos/CreateAuctionDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace AuctionService.Dtos
{
public class CreateAuctionDto
public sealed class CreateAuctionDto
{
[Required]
public string? Make { get; set; }
Expand All @@ -28,4 +28,4 @@ public class CreateAuctionDto
[Required]
public DateTime AuctionEnd { get; set; }
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Dtos/UpdateAuctionDto.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace AuctionService.Dtos
{
public class UpdateAuctionDto
public sealed class UpdateAuctionDto
{
public string? Make { get; set; }
public string? Model { get; set; }
public int? Year { get; set; }
public string? Color { get; set; }
public int? Mileage { get; set; }
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Entities/Auction.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AuctionService.Entities
{
public class Auction
public sealed class Auction
{
public Guid Id { get; set; }
public int ReservePrice { get; set; }
Expand All @@ -16,4 +16,4 @@ public class Auction

public bool HasReservePrice() => ReservePrice > 0;
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/Entities/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace AuctionService.Entities
{
[Table("Items")]
public class Item
public sealed class Item
{
public Guid Id { get; set; }
public string Make { get; set; } = string.Empty;
Expand All @@ -17,4 +17,4 @@ public class Item
public Auction? Auction { get; set; }
public Guid AuctionId { get; set; }
}
}
}
2 changes: 1 addition & 1 deletion src/AuctionService/Entities/Status.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ public enum Status
Finished,
ReserveNotMet
}
}
}
2 changes: 1 addition & 1 deletion src/AuctionService/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@
/// <summary>
/// Represents the entry point for the AuctionService program.
/// </summary>
public partial class Program {}
public sealed partial class Program {}
4 changes: 2 additions & 2 deletions src/AuctionService/Repositories/AuctionRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace AuctionService.Repositories
{
public class AuctionRepository(AuctionContext context, IMapper mapper) : IAuctionRepository
public sealed class AuctionRepository(AuctionContext context, IMapper mapper) : IAuctionRepository
{
public void AddAuction(Auction request) =>
context.Auctions.Add(request);
Expand Down Expand Up @@ -36,4 +36,4 @@ public async Task<List<AuctionDto>> GetAuctionsAsync(string request)

public async Task<bool> SaveChangesAsync() => await context.SaveChangesAsync() > 0;
}
}
}
2 changes: 1 addition & 1 deletion src/AuctionService/Repositories/IAuctionRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public interface IAuctionRepository
void RemoveAuction(Auction request);
Task<bool> SaveChangesAsync();
}
}
}
4 changes: 2 additions & 2 deletions src/AuctionService/RequestHelpers/MappingProfiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace AuctionService.RequestHelpers
{
public class MappingProfiles : Profile
public sealed class MappingProfiles : Profile
{
public MappingProfiles()
{
Expand All @@ -22,4 +22,4 @@ public MappingProfiles()
CreateMap<Item, AuctionUpdated>();
}
}
}
}
6 changes: 3 additions & 3 deletions src/AuctionService/Services/GrpcAuctionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

namespace AuctionService.Services
{
public class GrpcAuctionService(AuctionContext dbContext) : GrpcAuction.GrpcAuctionBase
public sealed class GrpcAuctionService(AuctionContext dbContext) : GrpcAuction.GrpcAuctionBase
{
public override async Task<GrpcAuctionResponse> GetAuction(GetAuctionRequest request, ServerCallContext context)
public sealed override async Task<GrpcAuctionResponse> GetAuction(GetAuctionRequest request, ServerCallContext context)
{
Console.WriteLine("==> Recieved gRPC request for auction");

Expand All @@ -26,4 +26,4 @@ public override async Task<GrpcAuctionResponse> GetAuction(GetAuctionRequest req
return response;
}
}
}
}
4 changes: 2 additions & 2 deletions src/BiddingService/Consumers/AuctionCreatedConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace BiddingService.Consumers
{
public class AuctionCreatedConsumer : IConsumer<AuctionCreated>
public sealed class AuctionCreatedConsumer : IConsumer<AuctionCreated>
{
public async Task Consume(ConsumeContext<AuctionCreated> context)
{
Expand All @@ -20,4 +20,4 @@ public async Task Consume(ConsumeContext<AuctionCreated> context)
await auction.SaveAsync();
}
}
}
}
4 changes: 2 additions & 2 deletions src/BiddingService/Contracts/AuctionCreated.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace BiddingService.Contracts
{
public class AuctionCreated
public sealed class AuctionCreated
{
public Guid Id { get; set; }
public int ReservePrice { get; set; }
Expand All @@ -19,4 +19,4 @@ public class AuctionCreated
public int Mileage { get; set; }
public string ImageUrl { get; set; } = string.Empty;
}
}
}
4 changes: 2 additions & 2 deletions src/BiddingService/Contracts/AuctionDeleted.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace BiddingService.Contracts
{
public class AuctionDeleted
public sealed class AuctionDeleted
{
public string? Id { get; set; }
}
}
}
4 changes: 2 additions & 2 deletions src/BiddingService/Contracts/AuctionFinished.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace BiddingService.Contracts
{
public class AuctionFinished
public sealed class AuctionFinished
{
public bool ItemSold { get; set; }
public string? AuctionId { get; set; }
public string? Winner { get; set; }
public string? Seller { get; set; }
public int? Amount { get; set; }
}
}
}
4 changes: 2 additions & 2 deletions src/BiddingService/Contracts/AuctionUpdated.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace BiddingService.Contracts
{
public class AuctionUpdated
public sealed class AuctionUpdated
{
public string? Id { get; set; }
public string? Make { get; set; }
Expand All @@ -9,4 +9,4 @@ public class AuctionUpdated
public string? Color { get; set; }
public int Mileage { get; set; }
}
}
}
Loading

0 comments on commit 9227311

Please sign in to comment.