feat(order): add all-orders APIs and query workflow
All checks were successful
Build and Deploy TenantApi + SkuWorker / build-and-deploy (push) Successful in 1m51s
All checks were successful
Build and Deploy TenantApi + SkuWorker / build-and-deploy (push) Successful in 1m51s
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using TakeoutSaaS.Domain.Orders.Entities;
|
||||
using TakeoutSaaS.Domain.Orders.Enums;
|
||||
using TakeoutSaaS.Domain.Deliveries.Entities;
|
||||
using TakeoutSaaS.Domain.Payments.Entities;
|
||||
using TakeoutSaaS.Domain.Payments.Enums;
|
||||
|
||||
namespace TakeoutSaaS.Domain.Orders.Repositories;
|
||||
@@ -37,6 +39,30 @@ public interface IOrderRepository
|
||||
/// <returns>订单集合。</returns>
|
||||
Task<IReadOnlyList<Order>> SearchAsync(long tenantId, OrderStatus? status, PaymentStatus? paymentStatus, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 全部订单列表筛选查询。
|
||||
/// </summary>
|
||||
/// <param name="tenantId">租户 ID。</param>
|
||||
/// <param name="storeId">门店 ID。</param>
|
||||
/// <param name="startAt">开始时间(含)。</param>
|
||||
/// <param name="endAt">结束时间(不含)。</param>
|
||||
/// <param name="status">订单状态。</param>
|
||||
/// <param name="deliveryType">履约方式。</param>
|
||||
/// <param name="paymentMethod">支付方式。</param>
|
||||
/// <param name="keyword">关键词(订单号/手机号)。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>订单集合。</returns>
|
||||
Task<IReadOnlyList<Order>> SearchAllOrdersAsync(
|
||||
long tenantId,
|
||||
long? storeId,
|
||||
DateTime? startAt,
|
||||
DateTime? endAt,
|
||||
OrderStatus? status,
|
||||
DeliveryType? deliveryType,
|
||||
PaymentMethod? paymentMethod,
|
||||
string? keyword,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 获取订单明细行。
|
||||
/// </summary>
|
||||
@@ -46,6 +72,18 @@ public interface IOrderRepository
|
||||
/// <returns>订单明细集合。</returns>
|
||||
Task<IReadOnlyList<OrderItem>> GetItemsAsync(long orderId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 按订单集合读取明细。
|
||||
/// </summary>
|
||||
/// <param name="orderIds">订单 ID 集合。</param>
|
||||
/// <param name="tenantId">租户 ID。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>订单明细字典。</returns>
|
||||
Task<IReadOnlyDictionary<long, IReadOnlyList<OrderItem>>> GetItemsByOrderIdsAsync(
|
||||
IReadOnlyCollection<long> orderIds,
|
||||
long tenantId,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 获取订单状态流转记录。
|
||||
/// </summary>
|
||||
@@ -64,6 +102,36 @@ public interface IOrderRepository
|
||||
/// <returns>退款申请列表。</returns>
|
||||
Task<IReadOnlyList<RefundRequest>> GetRefundsAsync(long orderId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 按订单集合查询已退款订单 ID。
|
||||
/// </summary>
|
||||
/// <param name="orderIds">订单 ID 集合。</param>
|
||||
/// <param name="tenantId">租户 ID。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>已退款订单 ID 集合。</returns>
|
||||
Task<IReadOnlySet<long>> GetRefundedOrderIdsAsync(
|
||||
IReadOnlyCollection<long> orderIds,
|
||||
long tenantId,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 获取订单最近支付记录。
|
||||
/// </summary>
|
||||
/// <param name="orderId">订单 ID。</param>
|
||||
/// <param name="tenantId">租户 ID。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>支付记录或 null。</returns>
|
||||
Task<PaymentRecord?> GetLatestPaymentRecordAsync(long orderId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 获取订单最近配送单。
|
||||
/// </summary>
|
||||
/// <param name="orderId">订单 ID。</param>
|
||||
/// <param name="tenantId">租户 ID。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>配送单或 null。</returns>
|
||||
Task<DeliveryOrder?> GetLatestDeliveryOrderAsync(long orderId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增订单。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user