feat(finance): add tenant settlement query backend
This commit is contained in:
@@ -0,0 +1,128 @@
|
||||
using TakeoutSaaS.Domain.Payments.Enums;
|
||||
|
||||
namespace TakeoutSaaS.Domain.Finance.Models;
|
||||
|
||||
/// <summary>
|
||||
/// 到账查询汇总行。
|
||||
/// </summary>
|
||||
public sealed record FinanceSettlementListItemSnapshot
|
||||
{
|
||||
/// <summary>
|
||||
/// 到账日期(UTC 日期)。
|
||||
/// </summary>
|
||||
public required DateTime ArrivedDate { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付方式。
|
||||
/// </summary>
|
||||
public required PaymentMethod PaymentMethod { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 交易笔数。
|
||||
/// </summary>
|
||||
public required int TransactionCount { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 到账金额。
|
||||
/// </summary>
|
||||
public required decimal ArrivedAmount { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 到账查询明细行。
|
||||
/// </summary>
|
||||
public sealed record FinanceSettlementDetailItemSnapshot
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单号。
|
||||
/// </summary>
|
||||
public required string OrderNo { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付金额。
|
||||
/// </summary>
|
||||
public required decimal Amount { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付时间(UTC)。
|
||||
/// </summary>
|
||||
public required DateTime PaidAt { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 到账查询分页快照。
|
||||
/// </summary>
|
||||
public sealed record FinanceSettlementPageSnapshot
|
||||
{
|
||||
/// <summary>
|
||||
/// 列表项。
|
||||
/// </summary>
|
||||
public required IReadOnlyList<FinanceSettlementListItemSnapshot> Items { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 总数。
|
||||
/// </summary>
|
||||
public required int TotalCount { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 到账概览统计快照。
|
||||
/// </summary>
|
||||
public sealed record FinanceSettlementStatsSnapshot
|
||||
{
|
||||
/// <summary>
|
||||
/// 今日到账。
|
||||
/// </summary>
|
||||
public required decimal TodayArrivedAmount { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 昨日到账。
|
||||
/// </summary>
|
||||
public required decimal YesterdayArrivedAmount { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 本月到账。
|
||||
/// </summary>
|
||||
public required decimal CurrentMonthArrivedAmount { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 本月交易笔数。
|
||||
/// </summary>
|
||||
public required int CurrentMonthTransactionCount { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 到账账户信息快照。
|
||||
/// </summary>
|
||||
public sealed record FinanceSettlementAccountSnapshot
|
||||
{
|
||||
/// <summary>
|
||||
/// 银行名称。
|
||||
/// </summary>
|
||||
public required string BankName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 开户名。
|
||||
/// </summary>
|
||||
public required string BankAccountName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 脱敏银行账号。
|
||||
/// </summary>
|
||||
public required string BankAccountNoMasked { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信商户号(脱敏)。
|
||||
/// </summary>
|
||||
public required string WechatMerchantNoMasked { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 支付宝 PID(脱敏)。
|
||||
/// </summary>
|
||||
public required string AlipayPidMasked { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 结算周期文案。
|
||||
/// </summary>
|
||||
public required string SettlementPeriodText { get; init; }
|
||||
}
|
||||
@@ -63,4 +63,55 @@ public interface IFinanceTransactionRepository
|
||||
PaymentMethod? paymentMethod,
|
||||
string? keyword,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 查询到账概览统计。
|
||||
/// </summary>
|
||||
Task<FinanceSettlementStatsSnapshot> GetSettlementStatsAsync(
|
||||
long tenantId,
|
||||
long storeId,
|
||||
DateTime currentUtc,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 查询到账账户信息。
|
||||
/// </summary>
|
||||
Task<FinanceSettlementAccountSnapshot?> GetSettlementAccountAsync(
|
||||
long tenantId,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 查询到账汇总分页。
|
||||
/// </summary>
|
||||
Task<FinanceSettlementPageSnapshot> SearchSettlementPageAsync(
|
||||
long tenantId,
|
||||
long storeId,
|
||||
DateTime? startAt,
|
||||
DateTime? endAt,
|
||||
PaymentMethod? paymentMethod,
|
||||
int page,
|
||||
int pageSize,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 查询到账明细。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<FinanceSettlementDetailItemSnapshot>> GetSettlementDetailsAsync(
|
||||
long tenantId,
|
||||
long storeId,
|
||||
DateTime arrivedDate,
|
||||
PaymentMethod paymentMethod,
|
||||
int take,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 查询到账导出数据。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<FinanceSettlementListItemSnapshot>> ListSettlementForExportAsync(
|
||||
long tenantId,
|
||||
long storeId,
|
||||
DateTime? startAt,
|
||||
DateTime? endAt,
|
||||
PaymentMethod? paymentMethod,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user