diff --git a/Optivem.Kata.Banking.sln b/Optivem.Kata.Banking.sln index c0962b8..1a318ba 100644 --- a/Optivem.Kata.Banking.sln +++ b/Optivem.Kata.Banking.sln @@ -25,7 +25,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Optivem.Kata.Banking.Infrastructure", "src\Optivem.Kata.Banking.Infrastructure\Optivem.Kata.Banking.Infrastructure.csproj", "{5ED71E33-2789-42BF-BA97-309E0BF23576}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Optivem.Kata.Banking.Infrastructure", "src\Optivem.Kata.Banking.Infrastructure\Optivem.Kata.Banking.Infrastructure.csproj", "{5ED71E33-2789-42BF-BA97-309E0BF23576}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Optivem.Kata.Banking.Web", "src\Optivem.Kata.Banking.Web\Optivem.Kata.Banking.Web.csproj", "{60BF7524-33C9-4FF0-9A90-9FD89590C091}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -49,6 +51,10 @@ Global {5ED71E33-2789-42BF-BA97-309E0BF23576}.Debug|Any CPU.Build.0 = Debug|Any CPU {5ED71E33-2789-42BF-BA97-309E0BF23576}.Release|Any CPU.ActiveCfg = Release|Any CPU {5ED71E33-2789-42BF-BA97-309E0BF23576}.Release|Any CPU.Build.0 = Release|Any CPU + {60BF7524-33C9-4FF0-9A90-9FD89590C091}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60BF7524-33C9-4FF0-9A90-9FD89590C091}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60BF7524-33C9-4FF0-9A90-9FD89590C091}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60BF7524-33C9-4FF0-9A90-9FD89590C091}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -60,6 +66,7 @@ Global {6F7B163D-5322-417B-BBF4-2F4D7B6CB90D} = {AE08FCE5-B7A9-4C14-B4CD-2556AEA39C61} {BA3D1039-A55B-43AE-8FD1-A218D3099819} = {6F7B163D-5322-417B-BBF4-2F4D7B6CB90D} {5ED71E33-2789-42BF-BA97-309E0BF23576} = {7A5CBAC9-F45B-408C-BC28-3ABBFB424E3E} + {60BF7524-33C9-4FF0-9A90-9FD89590C091} = {7A5CBAC9-F45B-408C-BC28-3ABBFB424E3E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7E8BB1C9-ACCB-46AB-88F8-F715384B5B0E} diff --git a/src/Optivem.Kata.Banking.Web/Controllers/WeatherForecastController.cs b/src/Optivem.Kata.Banking.Web/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..bf47123 --- /dev/null +++ b/src/Optivem.Kata.Banking.Web/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Optivem.Kata.Banking.Web.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateTime.Now.AddDays(index), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} \ No newline at end of file diff --git a/src/Optivem.Kata.Banking.Web/Optivem.Kata.Banking.Web.csproj b/src/Optivem.Kata.Banking.Web/Optivem.Kata.Banking.Web.csproj new file mode 100644 index 0000000..60bf9ea --- /dev/null +++ b/src/Optivem.Kata.Banking.Web/Optivem.Kata.Banking.Web.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/Optivem.Kata.Banking.Web/Program.cs b/src/Optivem.Kata.Banking.Web/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/src/Optivem.Kata.Banking.Web/Program.cs @@ -0,0 +1,25 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/src/Optivem.Kata.Banking.Web/Properties/launchSettings.json b/src/Optivem.Kata.Banking.Web/Properties/launchSettings.json new file mode 100644 index 0000000..455c3f6 --- /dev/null +++ b/src/Optivem.Kata.Banking.Web/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:55085", + "sslPort": 44382 + } + }, + "profiles": { + "Optivem.Kata.Banking.Web": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7251;http://localhost:5251", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/Optivem.Kata.Banking.Web/WeatherForecast.cs b/src/Optivem.Kata.Banking.Web/WeatherForecast.cs new file mode 100644 index 0000000..1857cd9 --- /dev/null +++ b/src/Optivem.Kata.Banking.Web/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace Optivem.Kata.Banking.Web +{ + public class WeatherForecast + { + public DateTime Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} \ No newline at end of file diff --git a/src/Optivem.Kata.Banking.Web/appsettings.Development.json b/src/Optivem.Kata.Banking.Web/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/src/Optivem.Kata.Banking.Web/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/Optivem.Kata.Banking.Web/appsettings.json b/src/Optivem.Kata.Banking.Web/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/src/Optivem.Kata.Banking.Web/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/test/Optivem.Kata.Banking.Test/System/BankAccountControllerSystemTest.cs b/test/Optivem.Kata.Banking.Test/System/BankAccountControllerSystemTest.cs new file mode 100644 index 0000000..37c0595 --- /dev/null +++ b/test/Optivem.Kata.Banking.Test/System/BankAccountControllerSystemTest.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Optivem.Kata.Banking.Test.System +{ + public class BankAccountControllerSystemTest + { + + + } +}