shop info

This commit is contained in:
Tizian.Breuch
2025-08-12 11:07:15 +02:00
parent 0a43b1d7e8
commit 1692fe198e
13 changed files with 387 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
// src/Webshop.Application/Services/Public/IShopInfoService.cs
using System.Threading.Tasks;
using Webshop.Application.DTOs.Shop;
namespace Webshop.Application.Services.Public
{
public interface IShopInfoService
{
Task<PublicShopInfoDto> GetPublicShopInfoAsync();
}
}

View File

@@ -0,0 +1,43 @@
// src/Webshop.Application/Services/Public/ShopInfoService.cs
using System.Threading.Tasks;
using Webshop.Application.DTOs.Shop;
using Webshop.Domain.Interfaces;
namespace Webshop.Application.Services.Public
{
public class ShopInfoService : IShopInfoService
{
private readonly IShopInfoRepository _shopInfoRepository;
public ShopInfoService(IShopInfoRepository shopInfoRepository)
{
_shopInfoRepository = shopInfoRepository;
}
public async Task<PublicShopInfoDto> GetPublicShopInfoAsync()
{
var shopInfo = await _shopInfoRepository.GetAsync();
if (shopInfo == null)
{
// Gib Standardwerte zurück, wenn nichts konfiguriert ist
return new PublicShopInfoDto { ShopName = "Webshop" };
}
return new PublicShopInfoDto
{
ShopName = shopInfo.ShopName,
Slogan = shopInfo.Slogan,
ContactEmail = shopInfo.ContactEmail,
PhoneNumber = shopInfo.PhoneNumber,
Street = shopInfo.Street,
City = shopInfo.City,
PostalCode = shopInfo.PostalCode,
Country = shopInfo.Country,
FacebookUrl = shopInfo.FacebookUrl,
InstagramUrl = shopInfo.InstagramUrl,
TwitterUrl = shopInfo.TwitterUrl
};
}
}
}