完成门店管理后端接口与任务

This commit is contained in:
2026-01-01 07:26:14 +08:00
parent dc9f6136d6
commit fc55003d3d
131 changed files with 15333 additions and 201 deletions

View File

@@ -0,0 +1,20 @@
using MediatR;
using TakeoutSaaS.Application.App.Stores.Dto;
namespace TakeoutSaaS.Application.App.Stores.Commands;
/// <summary>
/// 批量更新营业时段命令。
/// </summary>
public sealed record BatchUpdateBusinessHoursCommand : IRequest<IReadOnlyList<StoreBusinessHourDto>>
{
/// <summary>
/// 门店 ID。
/// </summary>
public long StoreId { get; init; }
/// <summary>
/// 营业时段集合。
/// </summary>
public IReadOnlyList<StoreBusinessHourInputDto> Items { get; init; } = [];
}

View File

@@ -7,105 +7,120 @@ namespace TakeoutSaaS.Application.App.Stores.Commands;
/// <summary>
/// 创建门店命令。
/// </summary>
public sealed class CreateStoreCommand : IRequest<StoreDto>
public sealed record CreateStoreCommand : IRequest<StoreDto>
{
/// <summary>
/// 商户 ID。
/// </summary>
public long MerchantId { get; set; }
public long MerchantId { get; init; }
/// <summary>
/// 门店编码。
/// </summary>
public string Code { get; set; } = string.Empty;
public string Code { get; init; } = string.Empty;
/// <summary>
/// 门店名称。
/// </summary>
public string Name { get; set; } = string.Empty;
public string Name { get; init; } = string.Empty;
/// <summary>
/// 电话。
/// </summary>
public string? Phone { get; set; }
public string? Phone { get; init; }
/// <summary>
/// 负责人。
/// </summary>
public string? ManagerName { get; set; }
public string? ManagerName { get; init; }
/// <summary>
/// 状态。
/// </summary>
public StoreStatus Status { get; set; } = StoreStatus.Closed;
public StoreStatus Status { get; init; } = StoreStatus.Closed;
/// <summary>
/// 门头招牌图。
/// </summary>
public string? SignboardImageUrl { get; init; }
/// <summary>
/// 主体类型。
/// </summary>
public StoreOwnershipType OwnershipType { get; init; } = StoreOwnershipType.SameEntity;
/// <summary>
/// 行业类目 ID。
/// </summary>
public long? CategoryId { get; init; }
/// <summary>
/// 省份。
/// </summary>
public string? Province { get; set; }
public string? Province { get; init; }
/// <summary>
/// 城市。
/// </summary>
public string? City { get; set; }
public string? City { get; init; }
/// <summary>
/// 区县。
/// </summary>
public string? District { get; set; }
public string? District { get; init; }
/// <summary>
/// 详细地址。
/// </summary>
public string? Address { get; set; }
public string? Address { get; init; }
/// <summary>
/// 经度。
/// </summary>
public double? Longitude { get; set; }
public double? Longitude { get; init; }
/// <summary>
/// 纬度。
/// </summary>
public double? Latitude { get; set; }
public double? Latitude { get; init; }
/// <summary>
/// 公告。
/// </summary>
public string? Announcement { get; set; }
public string? Announcement { get; init; }
/// <summary>
/// 标签。
/// </summary>
public string? Tags { get; set; }
public string? Tags { get; init; }
/// <summary>
/// 配送半径。
/// </summary>
public decimal DeliveryRadiusKm { get; set; }
public decimal DeliveryRadiusKm { get; init; }
/// <summary>
/// 支持堂食。
/// </summary>
public bool SupportsDineIn { get; set; } = true;
public bool SupportsDineIn { get; init; } = true;
/// <summary>
/// 支持自提。
/// </summary>
public bool SupportsPickup { get; set; } = true;
public bool SupportsPickup { get; init; } = true;
/// <summary>
/// 支持配送。
/// </summary>
public bool SupportsDelivery { get; set; } = true;
public bool SupportsDelivery { get; init; } = true;
/// <summary>
/// 支持预约。
/// </summary>
public bool SupportsReservation { get; set; }
public bool SupportsReservation { get; init; }
/// <summary>
/// 支持排队叫号。
/// </summary>
public bool SupportsQueueing { get; set; }
public bool SupportsQueueing { get; init; }
}

View File

@@ -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 CreateStoreQualificationCommand : IRequest<StoreQualificationDto>
{
/// <summary>
/// 门店 ID。
/// </summary>
public long StoreId { get; init; }
/// <summary>
/// 资质类型。
/// </summary>
public StoreQualificationType QualificationType { get; init; }
/// <summary>
/// 证照文件 URL。
/// </summary>
public string FileUrl { get; init; } = string.Empty;
/// <summary>
/// 证照编号。
/// </summary>
public string? DocumentNumber { get; init; }
/// <summary>
/// 签发日期。
/// </summary>
public DateTime? IssuedAt { get; init; }
/// <summary>
/// 到期日期。
/// </summary>
public DateTime? ExpiresAt { get; init; }
/// <summary>
/// 排序值。
/// </summary>
public int SortOrder { get; init; } = 100;
}

View File

@@ -0,0 +1,19 @@
using MediatR;
namespace TakeoutSaaS.Application.App.Stores.Commands;
/// <summary>
/// 删除门店资质命令。
/// </summary>
public sealed record DeleteStoreQualificationCommand : IRequest<bool>
{
/// <summary>
/// 门店 ID。
/// </summary>
public long StoreId { get; init; }
/// <summary>
/// 资质 ID。
/// </summary>
public long QualificationId { get; init; }
}

View File

@@ -0,0 +1,14 @@
using MediatR;
namespace TakeoutSaaS.Application.App.Stores.Commands;
/// <summary>
/// 提交门店审核命令。
/// </summary>
public sealed record SubmitStoreAuditCommand : IRequest<bool>
{
/// <summary>
/// 门店 ID。
/// </summary>
public long StoreId { get; init; }
}

View File

@@ -0,0 +1,31 @@
using MediatR;
using TakeoutSaaS.Application.App.Stores.Dto;
using TakeoutSaaS.Domain.Stores.Enums;
namespace TakeoutSaaS.Application.App.Stores.Commands;
/// <summary>
/// 切换门店经营状态命令。
/// </summary>
public sealed record ToggleBusinessStatusCommand : IRequest<StoreDto>
{
/// <summary>
/// 门店 ID。
/// </summary>
public long StoreId { get; init; }
/// <summary>
/// 目标经营状态。
/// </summary>
public StoreBusinessStatus BusinessStatus { get; init; }
/// <summary>
/// 歇业原因。
/// </summary>
public StoreClosureReason? ClosureReason { get; init; }
/// <summary>
/// 歇业原因补充说明。
/// </summary>
public string? ClosureReasonText { get; init; }
}

View File

@@ -44,6 +44,16 @@ public sealed record UpdateStoreCommand : IRequest<StoreDto?>
/// </summary>
public StoreStatus Status { get; init; } = StoreStatus.Closed;
/// <summary>
/// 门头招牌图。
/// </summary>
public string? SignboardImageUrl { get; init; }
/// <summary>
/// 行业类目 ID。
/// </summary>
public long? CategoryId { get; init; }
/// <summary>
/// 省份。
/// </summary>

View File

@@ -0,0 +1,41 @@
using MediatR;
using TakeoutSaaS.Application.App.Stores.Dto;
using TakeoutSaaS.Domain.Stores.Enums;
namespace TakeoutSaaS.Application.App.Stores.Commands;
/// <summary>
/// 更新门店费用配置命令。
/// </summary>
public sealed record UpdateStoreFeeCommand : IRequest<StoreFeeDto>
{
/// <summary>
/// 门店 ID。
/// </summary>
public long StoreId { get; init; }
/// <summary>
/// 起送费。
/// </summary>
public decimal MinimumOrderAmount { get; init; }
/// <summary>
/// 配送费。
/// </summary>
public decimal DeliveryFee { get; init; }
/// <summary>
/// 打包费模式。
/// </summary>
public PackagingFeeMode PackagingFeeMode { get; init; }
/// <summary>
/// 固定打包费。
/// </summary>
public decimal? FixedPackagingFee { get; init; }
/// <summary>
/// 免配送费门槛。
/// </summary>
public decimal? FreeDeliveryThreshold { get; init; }
}

View File

@@ -0,0 +1,45 @@
using MediatR;
using TakeoutSaaS.Application.App.Stores.Dto;
namespace TakeoutSaaS.Application.App.Stores.Commands;
/// <summary>
/// 更新门店资质命令。
/// </summary>
public sealed record UpdateStoreQualificationCommand : IRequest<StoreQualificationDto?>
{
/// <summary>
/// 门店 ID。
/// </summary>
public long StoreId { get; init; }
/// <summary>
/// 资质 ID。
/// </summary>
public long QualificationId { get; init; }
/// <summary>
/// 证照文件 URL。
/// </summary>
public string? FileUrl { get; init; }
/// <summary>
/// 证照编号。
/// </summary>
public string? DocumentNumber { get; init; }
/// <summary>
/// 签发日期。
/// </summary>
public DateTime? IssuedAt { get; init; }
/// <summary>
/// 到期日期。
/// </summary>
public DateTime? ExpiresAt { get; init; }
/// <summary>
/// 排序值。
/// </summary>
public int? SortOrder { get; init; }
}