docs: 标记自提档期完成
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user