diff --git a/README.md b/README.md new file mode 100644 index 0000000..8d3c06a --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +ShopSolution.sln +├───Webshop.Api +│ ├───Controllers +│ │ ├───Admin // Controller für Admin-Dashboard (z.B. AdminProductsController, AdminUsersController) +│ │ ├───Auth // Controller für Login/Register (AuthController) +│ │ ├───Customer // Controller für eingeloggte Kunden (z.B. OrdersController, ProfileController) +│ │ └───Public // Controller für öffentliche/nicht authentifizierte Zugriffe (z.B. ProductsController) +│ ├───appsettings.json +│ ├───Dockerfile +│ └───Program.cs +│ +├───Webshop.Application +│ ├───DTOs +│ │ ├───Auth // DTOs für Authentifizierungs-Flows +│ │ ├───Users // DTOs für Benutzerdetails +│ │ ├───ProductDto.cs // Standard-Produkt-DTO (für öffentliche Ansicht) +│ │ └───AdminProductDto.cs // Produkt-DTO mit Admin-spezifischen Details (z.B. Einkaufspreis) +│ ├───Services +│ │ ├───Admin // Geschäftslogik für Admin-Dashboard +│ │ │ ├───AdminProductService.cs +│ │ │ └───AdminUserService.cs +│ │ ├───Auth // Geschäftslogik für Authentifizierung +│ │ │ ├───IAuthService.cs +│ │ │ └───AuthService.cs +│ │ ├───Customer // Geschäftslogik für eingeloggte Kunden +│ │ │ └───// CustomerOrderService.cs (Platzhalter) +│ │ │ └───// CustomerProfileService.cs (Platzhalter) +│ │ └───Public // Geschäftslogik für öffentliche/nicht authentifizierte Features +│ │ └───ProductCatalogService.cs // (ehemals ProductService.cs) +│ +├───Webshop.Domain +│ ├───Entities // Ihre Kerngeschäftsobjekte (Product, Category, Customer, Order, etc.) +│ │ └───Address.cs // (Adress.cs umbenannt) +│ ├───Enums // Ihre Enumerationen +│ ├───Interfaces // Ihre Repository-Interfaces (IProductRepository, etc.) +│ +└───Webshop.Infrastructure + ├───Data // Ihr DbContext + ├───Migrations // Von EF Core generierte Migrationsdateien + └───Repositories // Ihre Repository-Implementierungen (ProductRepository etc.) \ No newline at end of file diff --git a/Webshop.Api/Controllers/Admin/AdminProductsController.cs b/Webshop.Api/Controllers/Admin/AdminProductsController.cs new file mode 100644 index 0000000..7c1bade --- /dev/null +++ b/Webshop.Api/Controllers/Admin/AdminProductsController.cs @@ -0,0 +1,62 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Webshop.Application.DTOs; // ProductDto and AdminProductDto +using Webshop.Application.Services.Admin; + +namespace Webshop.Api.Controllers.Admin +{ + [ApiController] + [Route("api/v1/admin/[controller]")] // z.B. /api/v1/admin/products + [Authorize(Roles = "Admin")] // Nur Benutzer mit der Rolle "Admin" dürfen zugreifen + public class AdminProductsController : ControllerBase + { + private readonly AdminProductService _adminProductService; + + public AdminProductsController(AdminProductService adminProductService) + { + _adminProductService = adminProductService; + } + + [HttpGet] // /api/v1/admin/products + public async Task>> GetAdminProducts() + { + var products = await _adminProductService.GetAllAdminProductsAsync(); + return Ok(products); + } + + [HttpGet("{id}")] // /api/v1/admin/products/{id} + public async Task> GetAdminProduct(Guid id) + { + var product = await _adminProductService.GetAdminProductByIdAsync(id); + if (product == null) return NotFound(); + return Ok(product); + } + + [HttpPost] // /api/v1/admin/products + public async Task> CreateAdminProduct([FromBody] AdminProductDto productDto) + { + if (!ModelState.IsValid) return BadRequest(ModelState); + var createdProduct = await _adminProductService.CreateAdminProductAsync(productDto); + return CreatedAtAction(nameof(GetAdminProduct), new { id = createdProduct.Id }, createdProduct); + } + + [HttpPut("{id}")] // /api/v1/admin/products/{id} + public async Task UpdateAdminProduct(Guid id, [FromBody] AdminProductDto productDto) + { + if (id != productDto.Id) return BadRequest(); + if (!ModelState.IsValid) return BadRequest(ModelState); + + var success = await _adminProductService.UpdateAdminProductAsync(productDto); + if (!success) return NotFound(); + return NoContent(); + } + + [HttpDelete("{id}")] // /api/v1/admin/products/{id} + public async Task DeleteAdminProduct(Guid id) + { + var success = await _adminProductService.DeleteAdminProductAsync(id); + if (!success) return NotFound(); + return NoContent(); + } + } +} \ No newline at end of file diff --git a/Webshop.Api/Controllers/Admin/AdminUsersController.cs b/Webshop.Api/Controllers/Admin/AdminUsersController.cs new file mode 100644 index 0000000..25d1e4c --- /dev/null +++ b/Webshop.Api/Controllers/Admin/AdminUsersController.cs @@ -0,0 +1,36 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Webshop.Application.DTOs.Users; // UserDto +using Webshop.Application.Services.Admin; + +namespace Webshop.Api.Controllers.Admin +{ + [ApiController] + [Route("api/v1/admin/[controller]")] // z.B. /api/v1/admin/users + [Authorize(Roles = "Admin")] // Nur Benutzer mit der Rolle "Admin" dürfen zugreifen + public class AdminUsersController : ControllerBase + { + private readonly AdminUserService _adminUserService; + + public AdminUsersController(AdminUserService adminUserService) + { + _adminUserService = adminUserService; + } + + [HttpGet] // /api/v1/admin/users + public async Task>> GetAllUsers() + { + var users = await _adminUserService.GetAllUsersAsync(); + return Ok(users); + } + + [HttpGet("{userId}")] // /api/v1/admin/users/{userId} + public async Task> GetUserById(string userId) + { + var user = await _adminUserService.GetUserByIdAsync(userId); + if (user == null) return NotFound(); + return Ok(user); + } + // TODO: Hier könnten weitere Methoden für User-Verwaltung (Rollen ändern, löschen etc.) hinzukommen + } +} \ No newline at end of file diff --git a/Webshop.Api/Controllers/Auth/AuthController.cs b/Webshop.Api/Controllers/Auth/AuthController.cs new file mode 100644 index 0000000..c6e1ff6 --- /dev/null +++ b/Webshop.Api/Controllers/Auth/AuthController.cs @@ -0,0 +1,49 @@ +using Microsoft.AspNetCore.Mvc; +using Webshop.Application.DTOs.Auth; +using Webshop.Application.Services.Auth; +using Microsoft.AspNetCore.Authorization; + +namespace Webshop.Api.Controllers.Auth // Beachten Sie den Namespace +{ + [ApiController] + [Route("api/v1/[controller]")] // z.B. /api/v1/auth + public class AuthController : ControllerBase + { + private readonly IAuthService _authService; + + public AuthController(IAuthService authService) + { + _authService = authService; + } + + [HttpPost("register")] // /api/v1/auth/register (für Kunden) + [AllowAnonymous] // Jeder darf sich registrieren + public async Task Register([FromBody] RegisterRequestDto request) + { + if (!ModelState.IsValid) return BadRequest(ModelState); + var result = await _authService.RegisterUserAsync(request); + if (!result.IsAuthSuccessful) return BadRequest(new { Message = result.ErrorMessage }); + return Ok(result); + } + + [HttpPost("login/customer")] // /api/v1/auth/login/customer (für Kunden-Login) + [AllowAnonymous] + public async Task LoginCustomer([FromBody] LoginRequestDto request) + { + if (!ModelState.IsValid) return BadRequest(ModelState); + var result = await _authService.LoginUserAsync(request); + if (!result.IsAuthSuccessful) return Unauthorized(new { Message = result.ErrorMessage }); + return Ok(result); + } + + [HttpPost("login/admin")] // /api/v1/auth/login/admin (für Admin-Dashboard Login) + [AllowAnonymous] + public async Task LoginAdmin([FromBody] LoginRequestDto request) + { + if (!ModelState.IsValid) return BadRequest(ModelState); + var result = await _authService.LoginAdminAsync(request); + if (!result.IsAuthSuccessful) return Unauthorized(new { Message = result.ErrorMessage }); + return Ok(result); + } + } +} \ No newline at end of file diff --git a/Webshop.Api/Controllers/Customer/OrdersController.cs b/Webshop.Api/Controllers/Customer/OrdersController.cs new file mode 100644 index 0000000..67456a8 --- /dev/null +++ b/Webshop.Api/Controllers/Customer/OrdersController.cs @@ -0,0 +1,23 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +// using Webshop.Application.DTOs.Orders; // Später erstellen +// using Webshop.Application.Services.Customer; // Später erstellen + +namespace Webshop.Api.Controllers.Customer // Beachten Sie den Namespace +{ + [ApiController] + [Route("api/v1/customer/[controller]")] // z.B. /api/v1/customer/orders + [Authorize(Roles = "Customer")] // Nur Benutzer mit der Rolle "Customer" dürfen zugreifen + public class OrdersController : ControllerBase + { + // Beispiel-Endpunkt für eingeloggte Kunden + [HttpGet("my-orders")] + public async Task GetMyOrders() + { + // Hier würden Sie die Bestellungen des eingeloggten Benutzers abrufen. + // Die Benutzer-ID können Sie über User.FindFirstValue(ClaimTypes.NameIdentifier) abrufen. + // return Ok(await _orderService.GetOrdersForCurrentUserAsync(User.FindFirstValue(ClaimTypes.NameIdentifier))); + return Ok(new { Message = "Dies sind Ihre Bestellungen (Platzhalter)." }); + } + } +} \ No newline at end of file diff --git a/Webshop.Api/Controllers/ProductsController.cs b/Webshop.Api/Controllers/ProductsController.cs deleted file mode 100644 index 25f0cb4..0000000 --- a/Webshop.Api/Controllers/ProductsController.cs +++ /dev/null @@ -1,34 +0,0 @@ -// src/Webshop.Api/Controllers/ProductsController.cs -using Microsoft.AspNetCore.Mvc; -using Webshop.Application.DTOs; -using Webshop.Application.Services; - -namespace Webshop.Api.Controllers -{ - [ApiController] - [Route("api/[controller]")] - public class ProductsController : ControllerBase - { - private readonly ProductService _productService; - - public ProductsController(ProductService productService) - { - _productService = productService; - } - - [HttpGet] - public async Task>> GetAllProducts() - { - var products = await _productService.GetAllProductsAsync(); - return Ok(products); - } - - [HttpPost] - public async Task> CreateProduct([FromBody] ProductDto productDto) - { - var createdProduct = await _productService.CreateProductAsync(productDto); - - return CreatedAtAction(nameof(GetAllProducts), new { id = createdProduct.Id }, createdProduct); - } - } -} \ No newline at end of file diff --git a/Webshop.Api/Controllers/Public/ProductsController.cs b/Webshop.Api/Controllers/Public/ProductsController.cs new file mode 100644 index 0000000..9c1d08f --- /dev/null +++ b/Webshop.Api/Controllers/Public/ProductsController.cs @@ -0,0 +1,29 @@ +using Microsoft.AspNetCore.Mvc; +using Webshop.Application.DTOs; // ProductDto +using Webshop.Application.Services.Public; // ProductCatalogService +using Microsoft.AspNetCore.Authorization; + +namespace Webshop.Api.Controllers.Public // Beachten Sie den Namespace +{ + [ApiController] + [Route("api/v1/public/[controller]")] // z.B. /api/v1/public/products + [AllowAnonymous] // Jeder darf hier zugreifen (Gast oder eingeloggter User) + public class ProductsController : ControllerBase + { + private readonly ProductService _productCatalogService; // Umbenannt + + public ProductsController(ProductService productCatalogService) // Injiziert den umbenannten Service + { + _productCatalogService = productCatalogService; + } + + [HttpGet] // /api/v1/public/products + public async Task>> GetAllProducts() + { + var products = await _productCatalogService.GetAllProductsAsync(); // Ruft Service-Methode auf + return Ok(products); + } + // Keine POST, PUT, DELETE hier für öffentliche Zugriffe. + // Diese gehören in den AdminProductsController. + } +} \ No newline at end of file diff --git a/Webshop.Api/Program.cs b/Webshop.Api/Program.cs index 37cf6f4..47bbed7 100644 --- a/Webshop.Api/Program.cs +++ b/Webshop.Api/Program.cs @@ -3,31 +3,32 @@ using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using Microsoft.IdentityModel.Tokens; using System.Text; -using Webshop.Application.Services; +using Webshop.Application.Services.Public; // Produktkatalog Service (jetzt ProductService) +using Webshop.Application.Services.Auth; // Auth Services +using Webshop.Application.Services.Admin; // Admin Services using Webshop.Domain.Interfaces; using Webshop.Infrastructure.Data; using Webshop.Infrastructure.Repositories; - +using Microsoft.AspNetCore.HttpOverrides; // Für UseForwardedHeaders +using Microsoft.Extensions.Logging; // Für ILogger var builder = WebApplication.CreateBuilder(args); // --- START: DIENSTE ZUM CONTAINER HINZUFÜGEN --- // 1. Datenbank-Kontext (DbContext) registrieren -// Sagt der Anwendung, wie sie sich mit der PostgreSQL-Datenbank verbinden soll. builder.Services.AddDbContext(options => - options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"))); + options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")) +); // 2. ASP.NET Core Identity für Benutzerverwaltung registrieren -// Verwendet unseren DbContext, um Benutzer- und Rollen-Daten zu speichern. builder.Services.AddIdentity() .AddEntityFrameworkStores() .AddDefaultTokenProviders(); // 3. JWT-Authentifizierung konfigurieren -// Richtet ein, wie die API die von Benutzern gesendeten Tokens validieren soll. var jwtSettings = builder.Configuration.GetSection("JwtSettings"); -var secretKey = jwtSettings["Secret"] ?? throw new InvalidOperationException("JWT Secret not found"); +var secretKey = jwtSettings["Secret"] ?? throw new InvalidOperationException("JWT Secret not found in configuration."); builder.Services.AddAuthentication(options => { @@ -47,14 +48,25 @@ builder.Services.AddAuthentication(options => IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secretKey)) }; }); +builder.Services.AddAuthorization(); // Aktiviert die Autorisierung // 4. Unsere eigenen Interfaces und Klassen registrieren (Dependency Injection) -// Sagt: "Immer wenn jemand nach 'IProductRepository' fragt, gib ihm eine neue 'ProductRepository'-Instanz." builder.Services.AddScoped(); -# region Services -builder.Services.AddScoped(); -# endregion +// AUTH Services +builder.Services.AddScoped(); + +// PUBLIC Services +builder.Services.AddScoped(); // Ihr ProductService ist hier registriert + +// ADMIN Services +builder.Services.AddScoped(); +builder.Services.AddScoped(); + +// CUSTOMER Services (später Implementierungen hinzufügen) +// builder.Services.AddScoped(); + + // 5. Controller und Swagger/OpenAPI hinzufügen builder.Services.AddControllers(); builder.Services.AddEndpointsApiExplorer(); @@ -64,13 +76,14 @@ builder.Services.AddSwaggerGen(); var app = builder.Build(); +// Optional: Automatisches Anwenden von Migrationen beim Start (nur für Entwicklung/Tests) using (var scope = app.Services.CreateScope()) { var services = scope.ServiceProvider; try { var context = services.GetRequiredService(); - context.Database.Migrate(); + context.Database.Migrate(); // Wendet ausstehende Migrationen an } catch (Exception ex) { @@ -83,25 +96,91 @@ using (var scope = app.Services.CreateScope()) app.UseForwardedHeaders(new ForwardedHeadersOptions { - ForwardedHeaders = Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedFor | Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedProto + ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }); -//if (app.Environment.IsDevelopment()) -//{ - app.UseSwagger(); - app.UseSwaggerUI(); -//} +// Swagger immer aktivieren (auch in Produktion für API-Dokumentation) +// Für die Produktion wäre es sicherer, dies an `app.Environment.IsDevelopment()` zu binden +// if (app.Environment.IsDevelopment()) +// { +app.UseSwagger(); +app.UseSwaggerUI(); +// } -//app.UseHttpsRedirection(); +// app.UseHttpsRedirection(); // Auskommentiert für Docker HTTP-Entwicklung // WICHTIG: Die Reihenfolge ist entscheidend! -// Zuerst prüfen, wer der Benutzer ist (Authentifizierung)... app.UseAuthentication(); -// ...dann prüfen, was der Benutzer darf (Autorisierung). app.UseAuthorization(); app.MapControllers(); // --- ENDE: HTTP REQUEST PIPELINE KONFIGURIEREN --- -app.Run(); \ No newline at end of file +app.Run(); + +// --- TEMPORÄRER INITIALER ADMIN- UND KUNDEN-SETUP (NUR FÜR ERSTE ENTWICKLUNG!) --- +// Dieser Block erstellt Rollen und initiale Benutzer, falls sie noch nicht existieren. +// Entfernen oder kommentiere dies aus, NACHDEM du deine ersten Benutzer erstellt hast! +using (var scope = app.Services.CreateScope()) // Eigener Scope, da app.Run() blockierend ist +{ + var serviceProvider = scope.ServiceProvider; + var roleManager = serviceProvider.GetRequiredService>(); + var userManager = serviceProvider.GetRequiredService>(); + + string[] roleNames = { "Admin", "Customer" }; + + foreach (var roleName in roleNames) + { + var roleExist = await roleManager.RoleExistsAsync(roleName); + if (!roleExist) + { + await roleManager.CreateAsync(new IdentityRole(roleName)); + } + } + + // Erstelle einen initialen Admin-Benutzer + var adminUser = await userManager.FindByEmailAsync("admin@yourwebshop.com"); // << ANPASSEN >> + if (adminUser == null) + { + adminUser = new IdentityUser + { + UserName = "admin@yourwebshop.com", // << ANPASSEN >> + Email = "admin@yourwebshop.com", // << ANPASSEN >> + EmailConfirmed = true + }; + var createAdmin = await userManager.CreateAsync(adminUser, "SecureAdminPass123!"); // << ANPASSEN >> + if (createAdmin.Succeeded) + { + await userManager.AddToRoleAsync(adminUser, "Admin"); + Console.WriteLine("Admin user created."); + } + else + { + Console.WriteLine($"Error creating admin user: {string.Join(", ", createAdmin.Errors.Select(e => e.Description))}"); + } + } + + // Erstelle einen initialen Kunden-Benutzer + var customerUser = await userManager.FindByEmailAsync("customer@yourwebshop.com"); // << ANPASSEN >> + if (customerUser == null) + { + customerUser = new IdentityUser + { + UserName = "customer@yourwebshop.com", // << ANPASSEN >> + Email = "customer@yourwebshop.com", // << ANPASSEN >> + EmailConfirmed = true + }; + var createCustomer = await userManager.CreateAsync(customerUser, "SecureCustomerPass123!"); // << ANPASSEN >> + if (createCustomer.Succeeded) + { + await userManager.AddToRoleAsync(customerUser, "Customer"); + Console.WriteLine("Customer user created."); + } + else + { + Console.WriteLine($"Error creating customer user: {string.Join(", ", createCustomer.Errors.Select(e => e.Description))}"); + } + } +} +// --- ENDE DES TEMPORÄREN SETUP-BLOCKS --- \ No newline at end of file diff --git a/Webshop.Application/DTOs/AdminProductDto.cs b/Webshop.Application/DTOs/AdminProductDto.cs new file mode 100644 index 0000000..8d827aa --- /dev/null +++ b/Webshop.Application/DTOs/AdminProductDto.cs @@ -0,0 +1,22 @@ +namespace Webshop.Application.DTOs +{ + public class AdminProductDto + { + public Guid Id { get; set; } + public string Name { get; set; } = string.Empty; + public string Description { get; set; } = string.Empty; + public string SKU { get; set; } = string.Empty; + public decimal Price { get; set; } + public decimal? OldPrice { get; set; } + public bool IsActive { get; set; } = true; + public bool IsInStock { get; set; } = true; + public int StockQuantity { get; set; } + public decimal? Weight { get; set; } + public string? ImageUrl { get; set; } + public string Slug { get; set; } = string.Empty; + public DateTimeOffset CreatedDate { get; set; } + public DateTimeOffset? LastModifiedDate { get; set; } + public Guid? SupplierId { get; set; } + public decimal? PurchasePrice { get; set; } // Admin-spezifisches Feld + } +} \ No newline at end of file diff --git a/Webshop.Application/DTOs/Auth/AuthResponseDto.cs b/Webshop.Application/DTOs/Auth/AuthResponseDto.cs new file mode 100644 index 0000000..715a33a --- /dev/null +++ b/Webshop.Application/DTOs/Auth/AuthResponseDto.cs @@ -0,0 +1,12 @@ +namespace Webshop.Application.DTOs.Auth +{ + public class AuthResponseDto + { + public bool IsAuthSuccessful { get; set; } + public string ErrorMessage { get; set; } = string.Empty; + public string Token { get; set; } = string.Empty; + public string UserId { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public List Roles { get; set; } = new List(); + } +} \ No newline at end of file diff --git a/Webshop.Application/DTOs/Auth/LoginRequestDto.cs b/Webshop.Application/DTOs/Auth/LoginRequestDto.cs new file mode 100644 index 0000000..12ea00a --- /dev/null +++ b/Webshop.Application/DTOs/Auth/LoginRequestDto.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; + +namespace Webshop.Application.DTOs.Auth +{ + public class LoginRequestDto + { + [Required(ErrorMessage = "E-Mail ist erforderlich.")] + [EmailAddress(ErrorMessage = "Ungültiges E-Mail-Format.")] + public string Email { get; set; } = string.Empty; + + [Required(ErrorMessage = "Passwort ist erforderlich.")] + public string Password { get; set; } = string.Empty; + } +} \ No newline at end of file diff --git a/Webshop.Application/DTOs/Auth/RegisterRequestDto.cs b/Webshop.Application/DTOs/Auth/RegisterRequestDto.cs new file mode 100644 index 0000000..bbd754f --- /dev/null +++ b/Webshop.Application/DTOs/Auth/RegisterRequestDto.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; + +namespace Webshop.Application.DTOs.Auth +{ + public class RegisterRequestDto + { + [Required(ErrorMessage = "E-Mail ist erforderlich.")] + [EmailAddress(ErrorMessage = "Ungültiges E-Mail-Format.")] + public string Email { get; set; } = string.Empty; + + [Required(ErrorMessage = "Passwort ist erforderlich.")] + [MinLength(6, ErrorMessage = "Passwort muss mindestens 6 Zeichen lang sein.")] + public string Password { get; set; } = string.Empty; + + [Required(ErrorMessage = "Passwortbestätigung ist erforderlich.")] + [Compare("Password", ErrorMessage = "Passwörter stimmen nicht überein.")] + public string ConfirmPassword { get; set; } = string.Empty; + + public string? FirstName { get; set; } + public string? LastName { get; set; } + } +} \ No newline at end of file diff --git a/Webshop.Application/DTOs/Users/UserDto.cs b/Webshop.Application/DTOs/Users/UserDto.cs new file mode 100644 index 0000000..c2590da --- /dev/null +++ b/Webshop.Application/DTOs/Users/UserDto.cs @@ -0,0 +1,12 @@ +namespace Webshop.Application.DTOs.Users +{ + public class UserDto + { + public string Id { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public string UserName { get; set; } = string.Empty; + public List Roles { get; set; } = new List(); + public DateTimeOffset CreatedDate { get; set; } // Placeholder, as IdentityUser doesn't have it directly + public bool EmailConfirmed { get; set; } + } +} \ No newline at end of file diff --git a/Webshop.Application/Services/ProductService.cs b/Webshop.Application/Services/Public/ProductService.cs similarity index 98% rename from Webshop.Application/Services/ProductService.cs rename to Webshop.Application/Services/Public/ProductService.cs index e33a002..bb8cbda 100644 --- a/Webshop.Application/Services/ProductService.cs +++ b/Webshop.Application/Services/Public/ProductService.cs @@ -3,7 +3,7 @@ using Webshop.Application.DTOs; using Webshop.Domain.Entities; using Webshop.Domain.Interfaces; -namespace Webshop.Application.Services +namespace Webshop.Application.Services.Public { public class ProductService { diff --git a/Webshop.Application/Webshop.Application.csproj b/Webshop.Application/Webshop.Application.csproj index 2e530f3..0baf47b 100644 --- a/Webshop.Application/Webshop.Application.csproj +++ b/Webshop.Application/Webshop.Application.csproj @@ -14,4 +14,10 @@ + + + + + + diff --git a/Webshop.Domain/Entities/Adress.cs b/Webshop.Domain/Entities/Address.cs similarity index 100% rename from Webshop.Domain/Entities/Adress.cs rename to Webshop.Domain/Entities/Address.cs