docs: 标记自提档期完成

This commit is contained in:
2025-12-04 11:51:09 +08:00
parent 2022d1c377
commit 7d6b7d8760
29 changed files with 1165 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
using FluentValidation;
using TakeoutSaaS.Application.App.Stores.Commands;
namespace TakeoutSaaS.Application.App.Stores.Validators;
/// <summary>
/// 创建自提档期验证器。
/// </summary>
public sealed class CreateStorePickupSlotCommandValidator : AbstractValidator<CreateStorePickupSlotCommand>
{
/// <summary>
/// 初始化规则。
/// </summary>
public CreateStorePickupSlotCommandValidator()
{
RuleFor(x => x.StoreId).GreaterThan(0);
RuleFor(x => x.Name).NotEmpty().MaximumLength(64);
RuleFor(x => x.Capacity).GreaterThan(0);
RuleFor(x => x.Weekdays).NotEmpty().MaximumLength(32);
RuleFor(x => x.CutoffMinutes).GreaterThanOrEqualTo(0);
RuleFor(x => x.EndTime).GreaterThan(x => x.StartTime);
}
}

View File

@@ -0,0 +1,19 @@
using FluentValidation;
using TakeoutSaaS.Application.App.Stores.Commands;
namespace TakeoutSaaS.Application.App.Stores.Validators;
/// <summary>
/// 删除自提档期验证器。
/// </summary>
public sealed class DeleteStorePickupSlotCommandValidator : AbstractValidator<DeleteStorePickupSlotCommand>
{
/// <summary>
/// 初始化规则。
/// </summary>
public DeleteStorePickupSlotCommandValidator()
{
RuleFor(x => x.SlotId).GreaterThan(0);
RuleFor(x => x.StoreId).GreaterThan(0);
}
}

View File

@@ -0,0 +1,24 @@
using FluentValidation;
using TakeoutSaaS.Application.App.Stores.Commands;
namespace TakeoutSaaS.Application.App.Stores.Validators;
/// <summary>
/// 更新自提档期验证器。
/// </summary>
public sealed class UpdateStorePickupSlotCommandValidator : AbstractValidator<UpdateStorePickupSlotCommand>
{
/// <summary>
/// 初始化规则。
/// </summary>
public UpdateStorePickupSlotCommandValidator()
{
RuleFor(x => x.SlotId).GreaterThan(0);
RuleFor(x => x.StoreId).GreaterThan(0);
RuleFor(x => x.Name).NotEmpty().MaximumLength(64);
RuleFor(x => x.Capacity).GreaterThan(0);
RuleFor(x => x.Weekdays).NotEmpty().MaximumLength(32);
RuleFor(x => x.CutoffMinutes).GreaterThanOrEqualTo(0);
RuleFor(x => x.EndTime).GreaterThan(x => x.StartTime);
}
}

View File

@@ -0,0 +1,21 @@
using FluentValidation;
using TakeoutSaaS.Application.App.Stores.Commands;
namespace TakeoutSaaS.Application.App.Stores.Validators;
/// <summary>
/// 自提配置验证器。
/// </summary>
public sealed class UpsertStorePickupSettingCommandValidator : AbstractValidator<UpsertStorePickupSettingCommand>
{
/// <summary>
/// 初始化规则。
/// </summary>
public UpsertStorePickupSettingCommandValidator()
{
RuleFor(x => x.StoreId).GreaterThan(0);
RuleFor(x => x.AllowDaysAhead).GreaterThanOrEqualTo(0);
RuleFor(x => x.DefaultCutoffMinutes).GreaterThanOrEqualTo(0);
RuleFor(x => x.MaxQuantityPerOrder).GreaterThan(0).When(x => x.MaxQuantityPerOrder.HasValue);
}
}