payment
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Webshop.Domain.Enums;
|
||||
|
||||
namespace Webshop.Domain.Entities;
|
||||
|
||||
@@ -8,22 +10,21 @@ namespace Webshop.Domain.Entities;
|
||||
/// </summary>
|
||||
public class PaymentMethod
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string Name { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[MaxLength(500)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
[Required]
|
||||
public bool IsActive { get; set; }
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public string PaymentGatewayType { get; set; } // "Stripe", "PayPal", etc.
|
||||
public PaymentGatewayType PaymentGatewayType { get; set; }
|
||||
|
||||
[Column(TypeName = "jsonb")]
|
||||
public string? Configuration { get; set; }
|
||||
|
||||
public decimal? ProcessingFee { get; set; }
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
public enum PaymentGatewayType
|
||||
// src/Webshop.Domain/Enums/PaymentGatewayType.cs
|
||||
namespace Webshop.Domain.Enums
|
||||
{
|
||||
Stripe,
|
||||
PayPal,
|
||||
Klarna,
|
||||
Manual // z.B. Vorkasse
|
||||
public enum PaymentGatewayType
|
||||
{
|
||||
BankTransfer,
|
||||
PayPal,
|
||||
Stripe,
|
||||
CashOnDelivery,
|
||||
Invoice
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
// Auto-generiert von CreateWebshopFiles.ps1
|
||||
using System;
|
||||
// src/Webshop.Domain/Interfaces/IPaymentMethodRepository.cs
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Webshop.Domain.Entities;
|
||||
|
||||
|
||||
namespace Webshop.Domain.Interfaces
|
||||
{
|
||||
public interface IPaymentMethodRepository
|
||||
{
|
||||
// Fügen Sie hier Methodensignaturen hinzu
|
||||
Task<IEnumerable<PaymentMethod>> GetAllAsync();
|
||||
Task<PaymentMethod?> GetByIdAsync(Guid id);
|
||||
Task AddAsync(PaymentMethod paymentMethod);
|
||||
Task UpdateAsync(PaymentMethod paymentMethod);
|
||||
Task DeleteAsync(Guid id);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user