diff --git a/MagicCarpetProject/MagicCarpetContracts/AdapterContracts/ISaleAdapter.cs b/MagicCarpetProject/MagicCarpetContracts/AdapterContracts/ISaleAdapter.cs index b56da1b..273e121 100644 --- a/MagicCarpetProject/MagicCarpetContracts/AdapterContracts/ISaleAdapter.cs +++ b/MagicCarpetProject/MagicCarpetContracts/AdapterContracts/ISaleAdapter.cs @@ -16,7 +16,7 @@ public interface ISaleAdapter SaleOperationResponse GetClientList(string id, DateTime fromDate, DateTime toDate); - SaleOperationResponse GetCocktailList(string id, DateTime fromDate, DateTime toDate); + SaleOperationResponse GetTourList(string id, DateTime fromDate, DateTime toDate); SaleOperationResponse GetElement(string id); diff --git a/MagicCarpetProject/MagicCarpetContracts/DataModels/PostDataModel.cs b/MagicCarpetProject/MagicCarpetContracts/DataModels/PostDataModel.cs index 7df7185..9010741 100644 --- a/MagicCarpetProject/MagicCarpetContracts/DataModels/PostDataModel.cs +++ b/MagicCarpetProject/MagicCarpetContracts/DataModels/PostDataModel.cs @@ -10,9 +10,9 @@ using System.Threading.Tasks; namespace MagicCarpetContracts.DataModels; -public class PostDataModel(string id, string postName, PostType postType, double salary) : IValidation +public class PostDataModel(string postId, string postName, PostType postType, double salary) : IValidation { - public string Id { get; private set; } = id; + public string Id { get; private set; } = postId; public string PostName { get; private set; } = postName; public PostType PostType { get; private set; } = postType; public double Salary { get; private set; } = salary; diff --git a/MagicCarpetProject/MagicCarpetTests/WebApiControllersTests/TourControllerTests.cs b/MagicCarpetProject/MagicCarpetTests/WebApiControllersTests/TourControllerTests.cs index d2b03d9..87cc5f6 100644 --- a/MagicCarpetProject/MagicCarpetTests/WebApiControllersTests/TourControllerTests.cs +++ b/MagicCarpetProject/MagicCarpetTests/WebApiControllersTests/TourControllerTests.cs @@ -370,11 +370,12 @@ internal class TourControllerTests : BaseWebApiControllerTest }); } - private static TourBindingModel CreateModel(string? id = null, string tourName = "name", TourType tourType = TourType.Beach, double price = 1) + private static TourBindingModel CreateModel(string? id = null, string tourName = "name", string tourCountry = "country", TourType tourType = TourType.Beach, double price = 1) => new() { Id = id ?? Guid.NewGuid().ToString(), TourName = tourName, + TourCountry = tourCountry, TourType = tourType.ToString(), Price = price }; diff --git a/MagicCarpetProject/MagicCarpetWebApi/Adapters/SaleAdapter.cs b/MagicCarpetProject/MagicCarpetWebApi/Adapters/SaleAdapter.cs index f21901d..dae85d1 100644 --- a/MagicCarpetProject/MagicCarpetWebApi/Adapters/SaleAdapter.cs +++ b/MagicCarpetProject/MagicCarpetWebApi/Adapters/SaleAdapter.cs @@ -125,7 +125,7 @@ public class SaleAdapter : ISaleAdapter } } - public SaleOperationResponse GetCocktailList(string id, DateTime fromDate, DateTime toDate) + public SaleOperationResponse GetTourList(string id, DateTime fromDate, DateTime toDate) { try { diff --git a/MagicCarpetProject/MagicCarpetWebApi/Controllers/EmployeesController.cs b/MagicCarpetProject/MagicCarpetWebApi/Controllers/EmployeesController.cs index e3408f4..bcd8970 100644 --- a/MagicCarpetProject/MagicCarpetWebApi/Controllers/EmployeesController.cs +++ b/MagicCarpetProject/MagicCarpetWebApi/Controllers/EmployeesController.cs @@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc; namespace MagicCarpetWebApi.Controllers; [Authorize] -[Route("api/[controller]")] +[Route("api/[controller]/[action]")] [ApiController] [Produces("application/json")] public class EmployeesController(IEmployeeAdapter adapter) : ControllerBase diff --git a/MagicCarpetProject/MagicCarpetWebApi/Controllers/SalesController.cs b/MagicCarpetProject/MagicCarpetWebApi/Controllers/SalesController.cs index ba51cf4..09775bc 100644 --- a/MagicCarpetProject/MagicCarpetWebApi/Controllers/SalesController.cs +++ b/MagicCarpetProject/MagicCarpetWebApi/Controllers/SalesController.cs @@ -33,9 +33,9 @@ public class SalesController(ISaleAdapter adapter) : ControllerBase } [HttpGet] - public IActionResult GetCocktailRecords(string id, DateTime fromDate, DateTime toDate) + public IActionResult GetTourRecords(string id, DateTime fromDate, DateTime toDate) { - return _adapter.GetCocktailList(id, fromDate, toDate).GetResponse(Request, Response); + return _adapter.GetTourList(id, fromDate, toDate).GetResponse(Request, Response); } [HttpGet("{data}")] diff --git a/MagicCarpetProject/MagicCarpetWebApi/Controllers/ToursController.cs b/MagicCarpetProject/MagicCarpetWebApi/Controllers/ToursController.cs index b6c5c9e..aeb7d34 100644 --- a/MagicCarpetProject/MagicCarpetWebApi/Controllers/ToursController.cs +++ b/MagicCarpetProject/MagicCarpetWebApi/Controllers/ToursController.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Mvc; namespace MagicCarpetWebApi.Controllers; [Authorize] -[Route("api/[controller]")] +[Route("api/[controller]/[action]")] [ApiController] [Produces("application/json")] public class ToursController(ITourAdapter adapter) : ControllerBase diff --git a/MagicCarpetProject/MagicCarpetWebApi/MagicCarpetWebApi.csproj b/MagicCarpetProject/MagicCarpetWebApi/MagicCarpetWebApi.csproj index b893207..39c7096 100644 --- a/MagicCarpetProject/MagicCarpetWebApi/MagicCarpetWebApi.csproj +++ b/MagicCarpetProject/MagicCarpetWebApi/MagicCarpetWebApi.csproj @@ -9,7 +9,6 @@ - diff --git a/MagicCarpetProject/MagicCarpetWebApi/Properties/launchSettings.json b/MagicCarpetProject/MagicCarpetWebApi/Properties/launchSettings.json index f42e527..dba3a05 100644 --- a/MagicCarpetProject/MagicCarpetWebApi/Properties/launchSettings.json +++ b/MagicCarpetProject/MagicCarpetWebApi/Properties/launchSettings.json @@ -1,18 +1,10 @@ { "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:1754", - "sslPort": 44390 - } - }, "profiles": { "http": { "commandName": "Project", "dotnetRunMessages": true, - "launchBrowser": true, + "launchBrowser": false, "launchUrl": "swagger", "applicationUrl": "http://localhost:5235", "environmentVariables": { @@ -22,20 +14,11 @@ "https": { "commandName": "Project", "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", + "launchBrowser": false, "applicationUrl": "https://localhost:7030;http://localhost:5235", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } } } }