feat: migrate snowflake ids and refresh migrations
This commit is contained in:
@@ -11,7 +11,7 @@ public sealed class Store : MultiTenantEntityBase
|
||||
/// <summary>
|
||||
/// 所属商户标识。
|
||||
/// </summary>
|
||||
public Guid MerchantId { get; set; }
|
||||
public long MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 门店编码,便于扫码及外部对接。
|
||||
|
||||
@@ -11,7 +11,7 @@ public sealed class StoreBusinessHour : MultiTenantEntityBase
|
||||
/// <summary>
|
||||
/// 门店标识。
|
||||
/// </summary>
|
||||
public Guid StoreId { get; set; }
|
||||
public long StoreId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 星期几,0 表示周日。
|
||||
|
||||
@@ -10,7 +10,7 @@ public sealed class StoreDeliveryZone : MultiTenantEntityBase
|
||||
/// <summary>
|
||||
/// 门店标识。
|
||||
/// </summary>
|
||||
public Guid StoreId { get; set; }
|
||||
public long StoreId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 区域名称。
|
||||
@@ -36,4 +36,9 @@ public sealed class StoreDeliveryZone : MultiTenantEntityBase
|
||||
/// 预计送达分钟。
|
||||
/// </summary>
|
||||
public int? EstimatedMinutes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序值。
|
||||
/// </summary>
|
||||
public int SortOrder { get; set; } = 100;
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ public sealed class StoreEmployeeShift : MultiTenantEntityBase
|
||||
/// <summary>
|
||||
/// 门店标识。
|
||||
/// </summary>
|
||||
public Guid StoreId { get; set; }
|
||||
public long StoreId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 员工标识。
|
||||
/// </summary>
|
||||
public Guid StaffId { get; set; }
|
||||
public long StaffId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 班次日期。
|
||||
|
||||
@@ -10,7 +10,7 @@ public sealed class StoreHoliday : MultiTenantEntityBase
|
||||
/// <summary>
|
||||
/// 门店标识。
|
||||
/// </summary>
|
||||
public Guid StoreId { get; set; }
|
||||
public long StoreId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日期。
|
||||
|
||||
@@ -11,12 +11,12 @@ public sealed class StoreTable : MultiTenantEntityBase
|
||||
/// <summary>
|
||||
/// 门店标识。
|
||||
/// </summary>
|
||||
public Guid StoreId { get; set; }
|
||||
public long StoreId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所在区域 ID。
|
||||
/// </summary>
|
||||
public Guid? AreaId { get; set; }
|
||||
public long? AreaId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 桌码。
|
||||
|
||||
@@ -10,7 +10,7 @@ public sealed class StoreTableArea : MultiTenantEntityBase
|
||||
/// <summary>
|
||||
/// 门店标识。
|
||||
/// </summary>
|
||||
public Guid StoreId { get; set; }
|
||||
public long StoreId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 区域名称。
|
||||
@@ -21,4 +21,9 @@ public sealed class StoreTableArea : MultiTenantEntityBase
|
||||
/// 区域描述。
|
||||
/// </summary>
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序值。
|
||||
/// </summary>
|
||||
public int SortOrder { get; set; } = 100;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using TakeoutSaaS.Domain.Stores.Entities;
|
||||
using TakeoutSaaS.Domain.Stores.Enums;
|
||||
|
||||
namespace TakeoutSaaS.Domain.Stores.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// 门店聚合仓储契约。
|
||||
/// </summary>
|
||||
public interface IStoreRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 依据标识获取门店。
|
||||
/// </summary>
|
||||
Task<Store?> FindByIdAsync(long storeId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 按租户筛选门店列表。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<Store>> SearchAsync(long tenantId, StoreStatus? status, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 获取门店营业时段。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<StoreBusinessHour>> GetBusinessHoursAsync(long storeId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 获取门店配送区域配置。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<StoreDeliveryZone>> GetDeliveryZonesAsync(long storeId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 获取门店节假日配置。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<StoreHoliday>> GetHolidaysAsync(long storeId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 获取门店桌台区域。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<StoreTableArea>> GetTableAreasAsync(long storeId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 获取门店桌台列表。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<StoreTable>> GetTablesAsync(long storeId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 获取门店员工排班。
|
||||
/// </summary>
|
||||
Task<IReadOnlyList<StoreEmployeeShift>> GetShiftsAsync(long storeId, long tenantId, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增门店。
|
||||
/// </summary>
|
||||
Task AddStoreAsync(Store store, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增营业时段。
|
||||
/// </summary>
|
||||
Task AddBusinessHoursAsync(IEnumerable<StoreBusinessHour> hours, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增配送区域。
|
||||
/// </summary>
|
||||
Task AddDeliveryZonesAsync(IEnumerable<StoreDeliveryZone> zones, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增节假日配置。
|
||||
/// </summary>
|
||||
Task AddHolidaysAsync(IEnumerable<StoreHoliday> holidays, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增桌台区域。
|
||||
/// </summary>
|
||||
Task AddTableAreasAsync(IEnumerable<StoreTableArea> areas, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增桌台。
|
||||
/// </summary>
|
||||
Task AddTablesAsync(IEnumerable<StoreTable> tables, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 新增排班。
|
||||
/// </summary>
|
||||
Task AddShiftsAsync(IEnumerable<StoreEmployeeShift> shifts, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// 持久化变更。
|
||||
/// </summary>
|
||||
Task SaveChangesAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user