-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rework campaigns proto file, work on dependency injection and project…
… structure, apply editorconfig code style
- Loading branch information
Showing
19 changed files
with
204 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
...odule-campaigns/src/Podkrepibg.Campaigns.Application/Configuration/DependencyInjection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
backend/module-campaigns/src/Podkrepibg.Campaigns.Application/Data/IApplicationDbContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Podkrepibg.Campaigns.Application.Data | ||
{ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.EntityFrameworkCore; | ||
using Podkrepibg.Campaigns.Domain.Entities; | ||
|
||
public interface IApplicationDbContext | ||
{ | ||
public DbSet<CampaignType> CampaignTypes { get; set; } | ||
|
||
public DbSet<CampaignSubType> CampaignSubTypes { get; set; } | ||
|
||
public DbSet<Campaign> Campaigns { get; set; } | ||
|
||
Task<int> SaveChangesAsync(CancellationToken cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...igns/src/Podkrepibg.Campaigns.Application/Queries/GetCampaigns/GetCampaignDetailsQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace Podkrepibg.Campaigns.Application.Queries.GetCampaigns | ||
{ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using MediatR; | ||
using Podkrepibg.Campaigns.Application.Data; | ||
|
||
public class GetCampaignDetailsQuery : IRequest<CampaignDetails> | ||
{ | ||
public string Id { get; set; } | ||
} | ||
|
||
public class GetCampaignDetailsQueryHandler : IRequestHandler<GetCampaignDetailsQuery, CampaignDetails> | ||
{ | ||
private readonly IApplicationDbContext _dbContext; | ||
|
||
public GetCampaignDetailsQueryHandler(IApplicationDbContext dbContext) | ||
{ | ||
_dbContext = dbContext; | ||
} | ||
|
||
public Task<CampaignDetails> Handle(GetCampaignDetailsQuery request, CancellationToken cancellationToken) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
} | ||
} |
6 changes: 0 additions & 6 deletions
6
...-campaigns/src/Podkrepibg.Campaigns.Application/Queries/GetCampaigns/GetCampaignsQuery.cs
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
backend/module-campaigns/src/Podkrepibg.Campaigns.Domain/Entities/Campaign.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
backend/module-campaigns/src/Podkrepibg.Campaigns.Domain/Entities/CampaignSubType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
backend/module-campaigns/src/Podkrepibg.Campaigns.Domain/Entities/CampaignType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...le-campaigns/src/Podkrepibg.Campaigns.Infrastructure/Configuration/DependencyInjection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace Podkrepibg.Campaigns.Infrastructure.Configuration | ||
{ | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Podkrepibg.Campaigns.Application.Data; | ||
using Podkrepibg.Campaigns.Infrastructure.Persistence; | ||
|
||
public static class DependencyInjection | ||
{ | ||
public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration) | ||
{ | ||
services.AddScoped<IApplicationDbContext>(provider => provider.GetService<CampaignsContext>()); | ||
|
||
services.AddDbContext<CampaignsContext>( | ||
options => options.UseNpgsql(configuration.GetConnectionString("CampaignDb"))); | ||
|
||
return services; | ||
} | ||
} | ||
} |
13 changes: 7 additions & 6 deletions
13
.../module-campaigns/src/Podkrepibg.Campaigns.Infrastructure/Persistence/CampaignsContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...c/Podkrepibg.Campaigns.Infrastructure/Persistence/Configurations/CampaignConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...epibg.Campaigns.Infrastructure/Persistence/Configurations/CampaignSubTypeConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...dkrepibg.Campaigns.Infrastructure/Persistence/Configurations/CampaignTypeConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.