feat: 管理端核心实体CRUD补齐

This commit is contained in:
2025-12-02 10:19:35 +08:00
parent 1a01454266
commit 93141fbf0c
75 changed files with 4513 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
using System.Text.Json.Serialization;
using TakeoutSaaS.Domain.Payments.Enums;
using TakeoutSaaS.Shared.Abstractions.Serialization;
namespace TakeoutSaaS.Application.App.Payments.Dto;
/// <summary>
/// 支付记录 DTO。
/// </summary>
public sealed class PaymentDto
{
/// <summary>
/// 支付记录 ID。
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long Id { get; init; }
/// <summary>
/// 租户 ID。
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long TenantId { get; init; }
/// <summary>
/// 订单 ID。
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long OrderId { get; init; }
/// <summary>
/// 支付方式。
/// </summary>
public PaymentMethod Method { get; init; }
/// <summary>
/// 支付状态。
/// </summary>
public PaymentStatus Status { get; init; }
/// <summary>
/// 金额。
/// </summary>
public decimal Amount { get; init; }
/// <summary>
/// 平台交易号。
/// </summary>
public string? TradeNo { get; init; }
/// <summary>
/// 渠道单号。
/// </summary>
public string? ChannelTransactionId { get; init; }
/// <summary>
/// 支付时间。
/// </summary>
public DateTime? PaidAt { get; init; }
/// <summary>
/// 备注。
/// </summary>
public string? Remark { get; init; }
/// <summary>
/// 原始回调。
/// </summary>
public string? Payload { get; init; }
/// <summary>
/// 退款记录。
/// </summary>
public IReadOnlyList<PaymentRefundDto> Refunds { get; init; } = Array.Empty<PaymentRefundDto>();
}

View File

@@ -0,0 +1,49 @@
using System.Text.Json.Serialization;
using TakeoutSaaS.Domain.Payments.Enums;
using TakeoutSaaS.Shared.Abstractions.Serialization;
namespace TakeoutSaaS.Application.App.Payments.Dto;
/// <summary>
/// 退款记录 DTO。
/// </summary>
public sealed class PaymentRefundDto
{
/// <summary>
/// 退款记录 ID。
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long Id { get; init; }
/// <summary>
/// 支付记录 ID。
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long PaymentRecordId { get; init; }
/// <summary>
/// 订单 ID。
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long OrderId { get; init; }
/// <summary>
/// 金额。
/// </summary>
public decimal Amount { get; init; }
/// <summary>
/// 渠道退款号。
/// </summary>
public string? ChannelRefundId { get; init; }
/// <summary>
/// 状态。
/// </summary>
public PaymentRefundStatus Status { get; init; }
/// <summary>
/// 原始回调。
/// </summary>
public string? Payload { get; init; }
}