feat: migrate snowflake ids and refresh migrations

This commit is contained in:
2025-12-02 09:04:37 +08:00
parent 462e15abbb
commit 148475fa43
174 changed files with 8020 additions and 34278 deletions

View File

@@ -11,7 +11,7 @@ public sealed class DeliveryEvent : MultiTenantEntityBase
/// <summary>
/// 配送单标识。
/// </summary>
public Guid DeliveryOrderId { get; set; }
public long DeliveryOrderId { get; set; }
/// <summary>
/// 事件类型。

View File

@@ -8,7 +8,7 @@ namespace TakeoutSaaS.Domain.Deliveries.Entities;
/// </summary>
public sealed class DeliveryOrder : MultiTenantEntityBase
{
public Guid OrderId { get; set; }
public long OrderId { get; set; }
/// <summary>
/// 配送服务商。

View File

@@ -0,0 +1,42 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using TakeoutSaaS.Domain.Deliveries.Entities;
namespace TakeoutSaaS.Domain.Deliveries.Repositories;
/// <summary>
/// 配送聚合仓储契约。
/// </summary>
public interface IDeliveryRepository
{
/// <summary>
/// 依据标识获取配送单。
/// </summary>
Task<DeliveryOrder?> FindByIdAsync(long deliveryOrderId, long tenantId, CancellationToken cancellationToken = default);
/// <summary>
/// 依据订单标识获取配送单。
/// </summary>
Task<DeliveryOrder?> FindByOrderIdAsync(long orderId, long tenantId, CancellationToken cancellationToken = default);
/// <summary>
/// 获取配送事件轨迹。
/// </summary>
Task<IReadOnlyList<DeliveryEvent>> GetEventsAsync(long deliveryOrderId, long tenantId, CancellationToken cancellationToken = default);
/// <summary>
/// 新增配送单。
/// </summary>
Task AddDeliveryOrderAsync(DeliveryOrder deliveryOrder, CancellationToken cancellationToken = default);
/// <summary>
/// 新增配送事件。
/// </summary>
Task AddEventAsync(DeliveryEvent deliveryEvent, CancellationToken cancellationToken = default);
/// <summary>
/// 持久化变更。
/// </summary>
Task SaveChangesAsync(CancellationToken cancellationToken = default);
}