aufrüumen

This commit is contained in:
Tizian.Breuch
2025-07-25 15:46:31 +02:00
parent 8218b860ca
commit 9e298a0458
74 changed files with 453 additions and 3557 deletions

View File

@@ -0,0 +1,18 @@
// Auto-generiert von CreateWebshopFiles.ps1
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.Services.Customers.Interfaces;
namespace Webshop.Application.Services.Customers
{
public class CheckoutService : ICheckoutService
{
// Fügen Sie hier Abhängigkeiten per Dependency Injection hinzu (z.B. Repositories)
// public CheckoutService(IYourRepository repository) { }
// Fügen Sie hier Service-Methoden hinzu
}
}

View File

@@ -0,0 +1,52 @@
using System.Threading.Tasks;
using Webshop.Application.DTOs.Customers;
using Webshop.Application.Services.Customers.Interfaces;
using Webshop.Domain.Interfaces; // Wichtig für ICustomerRepository
namespace Webshop.Application.Services.Customers
{
public class CustomerService : ICustomerService
{
private readonly ICustomerRepository _customerRepository;
public CustomerService(ICustomerRepository customerRepository)
{
_customerRepository = customerRepository;
}
public async Task<CustomerDto?> GetMyProfileAsync(string userId)
{
var customer = await _customerRepository.GetByUserIdAsync(userId);
if (customer == null)
{
return null;
}
// Mappe die Entity auf das CustomerDto
return new CustomerDto
{
Id = customer.Id,
UserId = customer.AspNetUserId,
FirstName = customer.FirstName,
LastName = customer.LastName,
// Fügen Sie hier weitere Felder hinzu, die der Kunde sehen soll (Email, Phone etc.)
};
}
public async Task<bool> UpdateMyProfileAsync(string userId, UpdateCustomerProfileDto profileDto)
{
var customer = await _customerRepository.GetByUserIdAsync(userId);
if (customer == null)
{
return false; // Kunde nicht gefunden
}
// Aktualisiere die Felder
customer.FirstName = profileDto.FirstName;
customer.LastName = profileDto.LastName;
await _customerRepository.UpdateAsync(customer);
return true;
}
}
}

View File

@@ -0,0 +1,16 @@
// Auto-generiert von CreateWebshopFiles.ps1
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.DTOs;
using Webshop.Application.DTOs.Auth;
using Webshop.Application.DTOs.Users;
namespace Webshop.Application.Services.Customers.Interfaces
{
public interface ICheckoutService
{
// Fügen Sie hier Methodensignaturen hinzu
}
}

View File

@@ -0,0 +1,11 @@
using System.Threading.Tasks;
using Webshop.Application.DTOs.Customers; // Korrektes Using für DTOs
namespace Webshop.Application.Services.Customers.Interfaces
{
public interface ICustomerService
{
Task<CustomerDto?> GetMyProfileAsync(string userId);
Task<bool> UpdateMyProfileAsync(string userId, UpdateCustomerProfileDto profileDto);
}
}

View File

@@ -0,0 +1,16 @@
// Auto-generiert von CreateWebshopFiles.ps1
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.DTOs;
using Webshop.Application.DTOs.Auth;
using Webshop.Application.DTOs.Users;
namespace Webshop.Application.Services.Customers.Interfaces
{
public interface IOrderService
{
// Fügen Sie hier Methodensignaturen hinzu
}
}

View File

@@ -0,0 +1,16 @@
// Auto-generiert von CreateWebshopFiles.ps1
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.DTOs;
using Webshop.Application.DTOs.Auth;
using Webshop.Application.DTOs.Users;
namespace Webshop.Application.Services.Customers.Interfaces
{
public interface IReviewService
{
// Fügen Sie hier Methodensignaturen hinzu
}
}

View File

@@ -0,0 +1,18 @@
// Auto-generiert von CreateWebshopFiles.ps1
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.Services.Customers.Interfaces;
namespace Webshop.Application.Services.Customers
{
public class OrderService : IOrderService
{
// Fügen Sie hier Abhängigkeiten per Dependency Injection hinzu (z.B. Repositories)
// public OrderService(IYourRepository repository) { }
// Fügen Sie hier Service-Methoden hinzu
}
}

View File

@@ -0,0 +1,18 @@
// Auto-generiert von CreateWebshopFiles.ps1
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Webshop.Application.Services.Customers.Interfaces;
namespace Webshop.Application.Services.Customers
{
public class ReviewService : IReviewService
{
// Fügen Sie hier Abhängigkeiten per Dependency Injection hinzu (z.B. Repositories)
// public ReviewService(IYourRepository repository) { }
// Fügen Sie hier Service-Methoden hinzu
}
}