feat: 桌码管理支持区域、批量生成与二维码导出
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using MediatR;
|
||||
using TakeoutSaaS.Application.App.Stores.Dto;
|
||||
|
||||
namespace TakeoutSaaS.Application.App.Stores.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 创建桌台区域命令。
|
||||
/// </summary>
|
||||
public sealed record CreateStoreTableAreaCommand : IRequest<StoreTableAreaDto>
|
||||
{
|
||||
/// <summary>
|
||||
/// 门店 ID。
|
||||
/// </summary>
|
||||
public long StoreId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 区域名称。
|
||||
/// </summary>
|
||||
public string Name { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 区域描述。
|
||||
/// </summary>
|
||||
public string? Description { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序值。
|
||||
/// </summary>
|
||||
public int SortOrder { get; init; } = 100;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using MediatR;
|
||||
|
||||
namespace TakeoutSaaS.Application.App.Stores.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 删除桌台区域命令。
|
||||
/// </summary>
|
||||
public sealed record DeleteStoreTableAreaCommand : IRequest<bool>
|
||||
{
|
||||
/// <summary>
|
||||
/// 门店 ID。
|
||||
/// </summary>
|
||||
public long StoreId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 区域 ID。
|
||||
/// </summary>
|
||||
public long AreaId { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using MediatR;
|
||||
|
||||
namespace TakeoutSaaS.Application.App.Stores.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 删除桌码命令。
|
||||
/// </summary>
|
||||
public sealed record DeleteStoreTableCommand : IRequest<bool>
|
||||
{
|
||||
/// <summary>
|
||||
/// 门店 ID。
|
||||
/// </summary>
|
||||
public long StoreId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 桌台 ID。
|
||||
/// </summary>
|
||||
public long TableId { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using MediatR;
|
||||
using TakeoutSaaS.Application.App.Stores.Dto;
|
||||
|
||||
namespace TakeoutSaaS.Application.App.Stores.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 批量生成桌码命令。
|
||||
/// </summary>
|
||||
public sealed record GenerateStoreTablesCommand : IRequest<IReadOnlyList<StoreTableDto>>
|
||||
{
|
||||
/// <summary>
|
||||
/// 门店 ID。
|
||||
/// </summary>
|
||||
public long StoreId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 桌码前缀。
|
||||
/// </summary>
|
||||
public string TableCodePrefix { get; init; } = "T";
|
||||
|
||||
/// <summary>
|
||||
/// 起始序号。
|
||||
/// </summary>
|
||||
public int StartNumber { get; init; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 生成数量。
|
||||
/// </summary>
|
||||
public int Count { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 默认容量。
|
||||
/// </summary>
|
||||
public int DefaultCapacity { get; init; } = 2;
|
||||
|
||||
/// <summary>
|
||||
/// 区域 ID。
|
||||
/// </summary>
|
||||
public long? AreaId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 标签。
|
||||
/// </summary>
|
||||
public string? Tags { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using MediatR;
|
||||
using TakeoutSaaS.Application.App.Stores.Dto;
|
||||
|
||||
namespace TakeoutSaaS.Application.App.Stores.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 更新桌台区域命令。
|
||||
/// </summary>
|
||||
public sealed record UpdateStoreTableAreaCommand : IRequest<StoreTableAreaDto?>
|
||||
{
|
||||
/// <summary>
|
||||
/// 区域 ID。
|
||||
/// </summary>
|
||||
public long AreaId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 门店 ID。
|
||||
/// </summary>
|
||||
public long StoreId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 区域名称。
|
||||
/// </summary>
|
||||
public string Name { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 区域描述。
|
||||
/// </summary>
|
||||
public string? Description { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序值。
|
||||
/// </summary>
|
||||
public int SortOrder { get; init; } = 100;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using MediatR;
|
||||
using TakeoutSaaS.Application.App.Stores.Dto;
|
||||
using TakeoutSaaS.Domain.Stores.Enums;
|
||||
|
||||
namespace TakeoutSaaS.Application.App.Stores.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 更新桌码命令。
|
||||
/// </summary>
|
||||
public sealed record UpdateStoreTableCommand : IRequest<StoreTableDto?>
|
||||
{
|
||||
/// <summary>
|
||||
/// 门店 ID。
|
||||
/// </summary>
|
||||
public long StoreId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 桌台 ID。
|
||||
/// </summary>
|
||||
public long TableId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 区域 ID。
|
||||
/// </summary>
|
||||
public long? AreaId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 桌码。
|
||||
/// </summary>
|
||||
public string TableCode { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 容量。
|
||||
/// </summary>
|
||||
public int Capacity { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 标签。
|
||||
/// </summary>
|
||||
public string? Tags { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态。
|
||||
/// </summary>
|
||||
public StoreTableStatus Status { get; init; } = StoreTableStatus.Idle;
|
||||
}
|
||||
Reference in New Issue
Block a user