Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
e77016f
feat: proposal for api reorganization
akovylyaeva Nov 25, 2025
b09ed7b
docs(readme): bring test coverage score up to date
Nov 25, 2025
de904cd
refactor: move ItemsController.cs one level higner in the folders hie…
Nov 25, 2025
b272348
format: try to fail on unnecessary usings
Nov 25, 2025
fa1b865
Revert "format: try to fail on unnecessary usings"
Nov 25, 2025
b0a61b8
chore: change ItemsController namespace
akovylyaeva Nov 26, 2025
9096fc0
chore: remove Handlers folder
akovylyaeva Nov 26, 2025
956958f
fix!: rename ItemsResponse to GetAllItemsResponse to sync with the re…
Nov 26, 2025
388e95f
format: fail lint when namespaces aren't in sync with folder names
Nov 26, 2025
e4a243b
refactor: fix EnternalDeps typo to ExternalDeps
Nov 26, 2025
e14e045
chore: change AddScoped to AddTransient
akovylyaeva Nov 27, 2025
bb7e07a
feat: new proposal for api reorganization
Nov 27, 2025
12ae07a
chore: add using
Nov 27, 2025
dc426d7
test: remove test
Nov 27, 2025
656782d
chore: add using
Nov 27, 2025
126f94e
docs(readme): bring test coverage score up to date
Nov 27, 2025
0f4d592
feat: return HolderEmployeeMapper
Jan 19, 2026
fb8162a
docs(readme): bring test coverage score up to date
Jan 19, 2026
b18305b
fix: fix lint
Jan 19, 2026
a4516f7
fix: fix summary for swagger
Jan 20, 2026
3801c2b
refactor: move CreateItemTypeRequest and CreateItemTypeResponse to Ap…
Jan 20, 2026
f57a525
docs(readme): bring test coverage score up to date
Jan 20, 2026
7070545
test: add swagger attributes
Jan 21, 2026
b1e573a
Merge branch 'master' into feature/second-part-of-api-reorganization
Jan 22, 2026
7594cbc
chore(js-client): Update js-client by OpenAPI
Jan 22, 2026
5ef8a36
docs(readme): bring test coverage score up to date
Jan 22, 2026
a7fde4c
Merge branch 'master' into feature/proposal-for-api-reorganization
Feb 9, 2026
5811d49
chore(js-client): Update js-client by OpenAPI
Feb 9, 2026
e128af0
docs(readme): bring test coverage score up to date
Feb 9, 2026
1165a09
chore: delete new swagger attributes
Feb 9, 2026
23c4cdb
chore: return new swagger XML comments
Feb 9, 2026
beea967
refactor: delete unused import
Feb 9, 2026
6bd766a
refactor: discard changes in Program.cs
Feb 9, 2026
ac29ce2
refactor: delete unused line
Feb 9, 2026
339113b
refactor: return changes in Program.cs
Feb 10, 2026
7d71bf1
Merge remote-tracking branch 'origin/feature/proposal-for-api-reorgan…
MDI74 Feb 10, 2026
9975c94
Merge branch 'master' into feature/second-part-of-api-reorganization
MDI74 Feb 10, 2026
59fdf9d
chore(js-client): Update js-client by OpenAPI
Feb 10, 2026
3a2a267
refactor: change namespace in ItemsController
MDI74 Feb 10, 2026
2926153
Merge branch 'feature/second-part-of-api-reorganization' of github.co…
MDI74 Feb 10, 2026
7db02c9
docs(readme): bring test coverage score up to date
Feb 10, 2026
2da0724
chore(js-client): Update js-client by OpenAPI
Feb 10, 2026
67957a4
fix: fix lint
MDI74 Feb 10, 2026
f411220
Merge branch 'feature/second-part-of-api-reorganization' of github.co…
MDI74 Feb 10, 2026
bbb9c46
refactor: change latter in name of parameter
Feb 10, 2026
fe57623
refactor: return CreateItemCommand
MDI74 Feb 10, 2026
cd0817f
docs(readme): bring test coverage score up to date
Feb 10, 2026
f50cf67
refactor: add HardDeleteItemHandler
MDI74 Feb 10, 2026
c73b572
Merge branch 'master' into feature/second-part-of-api-reorganization
MDI74 Feb 10, 2026
2c4ffdb
chore(js-client): Update js-client by OpenAPI
Feb 10, 2026
86715d5
docs(readme): bring test coverage score up to date
Feb 10, 2026
62a37b0
refactor: add handlers to ItemTypes and delete HardDeleteItemTypeComm…
Feb 10, 2026
26b5f04
chore(js-client): Update js-client by OpenAPI
Feb 10, 2026
f90304f
docs(readme): bring test coverage score up to date
Feb 10, 2026
546c783
refactor: move commands to features folders
Feb 10, 2026
df105e3
Merge branch 'feature/second-part-of-api-reorganization' of github.co…
Feb 10, 2026
02a0ac2
refactor: rename Dto folder to SharedDto and fix usings
Feb 10, 2026
b8c6a4d
refacot: rename ItemTypesResponse to GetAllItemTypesResponse
MDI74 Feb 10, 2026
79d0d9f
chore(js-client): Update js-client by OpenAPI
Feb 10, 2026
d6b77e9
refactor: move SharedCommands to Features
MDI74 Feb 10, 2026
f0bce75
Merge branch 'feature/second-part-of-api-reorganization' of github.co…
MDI74 Feb 10, 2026
f57f46d
refactor: rename queries and move them to Features
MDI74 Feb 10, 2026
57ad699
Merge branch 'master' into feature/second-part-of-api-reorganization
MDI74 Feb 10, 2026
1dcc506
chore(js-client): Update js-client by OpenAPI
Feb 10, 2026
b495379
chore: remove extra await in ItemTypesController.cs
Feb 10, 2026
32be137
chore: reorder DependencyInjection.cs to group by operation, not by type
Feb 10, 2026
93ce1b7
refactor: move SharedCommand and SharedDtos to the root folder of App…
MDI74 Feb 10, 2026
42f144b
fix: remove seed from memory database so that fix flacky
MDI74 Feb 10, 2026
af8cdfa
refactor: introduce IEmployeesApi.cs in Aplication and inject it in G…
Feb 10, 2026
0030a4e
chore: remove extra await in ItemsController.cs
Feb 10, 2026
bfbb3eb
docs(readme): bring test coverage score up to date
Feb 10, 2026
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
80 changes: 0 additions & 80 deletions Api/Controllers/ItemTypesController.cs

This file was deleted.

28 changes: 18 additions & 10 deletions Api/DependencyInjection.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
using Api.ExternalDeps.EmployeesApi;
using Api.Features.Items.CreateItem;
using Api.Features.Items.GetAllItems;
using Application;
using Application.Commands;
using Application.Queries;
using Application.ExternalDeps.EmployeesApi;
using Application.Features.Items.CreateItem;
using Application.Features.Items.GetAllItems;
using Application.Features.Items.HardDeleteItem;
using Application.Features.ItemTypes.CreateItemType;
using Application.Features.ItemTypes.GetAllItemTypes;
using Application.Features.ItemTypes.HardDeleteItemType;
using Microsoft.EntityFrameworkCore;

namespace Api;
Expand All @@ -29,17 +32,22 @@ public static void AddApplication(this IServiceCollection services, IConfigurati

services.Configure<ExternalDepsUrls>(configuration.GetSection(nameof(ExternalDepsUrls)));

services.AddTransient<EmployeesApi, EmployeesApi>();
services.AddTransient<IEmployeesApi, EmployeesApi>();

services.AddTransient<CreateItemTypeHandler>();
services.AddTransient<CreateItemTypeCommand>();
services.AddTransient<HardDeleteItemTypeCommand>();
services.AddTransient<AllItemTypesQuery>();

services.AddTransient<GetAllItemTypesHandler>();
services.AddTransient<GetAllItemTypesQuery>();

services.AddTransient<HardDeleteItemTypeHandler>();

services.AddTransient<CreateItemHandler>();
services.AddTransient<CreateItemCommand>();
services.AddTransient<AllItemsQuery>();
services.AddTransient<HardDeleteItemCommand>();

services.AddTransient<GetAllItemsHandler>();
services.AddTransient<CreateItemHandler>();
services.AddTransient<GetAllItemsQuery>();

services.AddTransient<HardDeleteItemHandler>();
}
}
4 changes: 2 additions & 2 deletions Api/ExternalDeps/EmployeesApi/EmployeesApi.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Api.ExternalDeps.EmployeesApi.Responses;
using Application.ExternalDeps.EmployeesApi;
using Microsoft.Extensions.Options;
using TourmalineCore.AspNetCore.JwtAuthentication.Core.Options;

namespace Api.ExternalDeps.EmployeesApi;

public class EmployeesApi
public class EmployeesApi : IEmployeesApi
{
private readonly ExternalDepsUrls _externalDepsUrls;
private readonly AuthenticationOptions _authenticationOptions;
Expand Down
58 changes: 58 additions & 0 deletions Api/Features/ItemTypes/ItemTypesController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using System.ComponentModel.DataAnnotations;
using Application.Features.ItemTypes.CreateItemType;
using Application.Features.ItemTypes.GetAllItemTypes;
using Application.Features.ItemTypes.HardDeleteItemType;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using TourmalineCore.AspNetCore.JwtAuthentication.Core.Filters;

namespace Api.Features.ItemTypes;

[Authorize]
[ApiController]
[Route("api/item-types")]
public class ItemTypesController : ControllerBase
{
/// <summary>
/// Get all item types
/// </summary>
[RequiresPermission(UserClaimsProvider.CanViewItemsTypes)]
[HttpGet]
public Task<GetAllItemTypesResponse> GetAllItemTypesAsync(
[FromServices] GetAllItemTypesHandler getAllItemTypesHandler
)
{
return getAllItemTypesHandler.HandleAsync();
}

/// <summary>
/// Adds item type
/// </summary>
/// <param name="createItemTypeRequest"></param>
[RequiresPermission(UserClaimsProvider.CanManageItemsTypes)]
[HttpPost]
public Task<CreateItemTypeResponse> CreateItemTypeAsync(
[FromServices] CreateItemTypeHandler createItemTypeHandler,
[Required][FromBody] CreateItemTypeRequest createItemTypeRequest
)
{
return createItemTypeHandler.HandleAsync(createItemTypeRequest);
}

/// <summary>
/// Deletes specific item type
/// </summary>
/// <param name="itemTypeId"></param>
[RequiresPermission(UserClaimsProvider.AUTO_TESTS_ONLY_IsItemTypesHardDeleteAllowed)]
[HttpDelete("{itemTypeId}/hard-delete")]
public async Task<object> HardDeleteItemTypeAsync(
[FromServices] HardDeleteItemTypeHandler hardDeleteItemTypeHandler,
[Required][FromRoute] long itemTypeId
)
{
return new
{
isDeleted = await hardDeleteItemTypeHandler.HandleAsync(itemTypeId)
};
}
}
34 changes: 0 additions & 34 deletions Api/Features/Items/CreateItem/CreateItemHandler.cs

This file was deleted.

10 changes: 5 additions & 5 deletions Api/Features/Items/ItemsController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using Api.Features.Items.CreateItem;
using Api.Features.Items.GetAllItems;
using Application.Commands;
using Application.Features.Items.CreateItem;
using Application.Features.Items.GetAllItems;
using Application.Features.Items.HardDeleteItem;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using TourmalineCore.AspNetCore.JwtAuthentication.Core.Filters;
Expand Down Expand Up @@ -46,13 +46,13 @@ [Required][FromBody] CreateItemRequest createItemRequest
[RequiresPermission(UserClaimsProvider.AUTO_TESTS_ONLY_IsItemsHardDeleteAllowed)]
[HttpDelete("{itemId}/hard-delete")]
public async Task<object> HardDeleteItemAsync(
[FromServices] HardDeleteItemCommand hardDeleteItemCommand,
[FromServices] HardDeleteItemHandler hardDeleteItemHandler,
[Required][FromRoute] long itemId
)
{
return new
{
isDeleted = await hardDeleteItemCommand.ExecuteAsync(itemId)
isDeleted = await hardDeleteItemHandler.HandleAsync(itemId)
};
}
}
6 changes: 0 additions & 6 deletions Api/Responses/ItemTypesResponse.cs

This file was deleted.

69 changes: 0 additions & 69 deletions Application/Commands/CreateItemCommand.cs

This file was deleted.

18 changes: 0 additions & 18 deletions Application/Commands/HardDeleteItemCommand.cs

This file was deleted.

18 changes: 0 additions & 18 deletions Application/Commands/HardDeleteItemTypeCommand.cs

This file was deleted.

Loading