подготовка

This commit is contained in:
2025-04-13 11:44:29 +04:00
parent e984b4d66f
commit 478200b4a4
7 changed files with 76 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
using MagicCarpetContracts.BusinessLogicContracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MagicCarpetBusinessLogic.Implementations;
public class ReportContract : IReportContract
{
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MagicCarpetContracts.AdapterContracts;
public interface IReportAdapter
{
}

View File

@@ -0,0 +1,19 @@
using MagicCarpetContracts.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MagicCarpetContracts.AdapterContracts.OperationResponses;
public class ReportOperationResponse : OperationResponse
{
Task<ReportOperationResponse> GetDataSaleByPeriodAsync(DateTime dateStart, DateTime dateFinish, CancellationToken ct);
Task<ReportOperationResponse> GetDataSalaryByPeriodAsync(DateTime dateStart, DateTime dateFinish, CancellationToken ct);
Task<ReportOperationResponse> CreateDocumentSalesByPeriodAsync(DateTime dateStart, DateTime dateFinish, CancellationToken ct);
Task<ReportOperationResponse> CreateDocumentSalaryByPeriodAsync(DateTime dateStart, DateTime dateFinish, CancellationToken ct);
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MagicCarpetContracts.BusinessLogicContracts;
public interface IReportContract
{
}

View File

@@ -0,0 +1,6 @@
namespace MagicCarpetWebApi.Adapters;
public class ReportAdapter
{
}

View File

@@ -0,0 +1,12 @@
using MagicCarpetContracts.AdapterContracts;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace MagicCarpetWebApi.Controllers;
[Route("api/[controller]")]
[ApiController]
public class ReportController(IReportAdapter reportAdapter) : ControllerBase
{
private IReportAdapter _reportAdapter = reportAdapter;
}

View File

@@ -1,6 +1,7 @@
using MagicCarpetBusinessLogic.Implementations;
using MagicCarpetContracts.AdapterContracts;
using MagicCarpetContracts.BuisnessLogicContracts;
using MagicCarpetContracts.BusinessLogicContracts;
using MagicCarpetContracts.Infrastructure;
using MagicCarpetContracts.StoragesContracts;
using MagicCarpetDatabase;
@@ -73,6 +74,9 @@ builder.Services.AddTransient<ISaleAdapter, SaleAdapter>();
builder.Services.AddTransient<IEmployeeAdapter, EmployeeAdapter>();
builder.Services.AddTransient<ISalaryAdapter, SalaryAdapter>();
builder.Services.AddTransient<IReportContract, ReportContract>();
builder.Services.AddTransient<IReportAdapter, ReportAdapter>();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddOpenApi();