GEDRAGSWIJZIGING (goedgekeurd): de validatiemeldingen waren Engels en zijn nu Nederlands bij Texts:DefaultLanguage=nl (alleen zichtbaar voor beheerders). De Engelse teksten zijn de oude meldingen, letterlijk. TextCatalog.Default omvat nu alle geladen SlpModularCms.*-assemblies (fallback buiten DI). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
24 lines
931 B
C#
24 lines
931 B
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace SlpModularCms.Modules.Offerings.Models;
|
|
|
|
public record CreateOfferingRequest(
|
|
[Required, MaxLength(100)] string Title,
|
|
// Optional: missing, null and "" are all stored as "" (the websites that do not use them leave them out).
|
|
[MaxLength(500)] string? Description,
|
|
[Required, MaxLength(50)] string Price,
|
|
[MaxLength(100)] string? PriceNote,
|
|
[Required, FeaturesValidation] List<string> Features,
|
|
[Required(AllowEmptyStrings = true), MaxLength(50)] string CtaLabel,
|
|
bool Featured = false,
|
|
[MaxLength(130)] string? Slug = null,
|
|
Guid? CategoryId = null,
|
|
bool IsActive = true,
|
|
DateTimeOffset? StartsAt = null,
|
|
DateTimeOffset? EndsAt = null
|
|
) : IValidatableObject
|
|
{
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
=> OfferingSchedule.Validate(StartsAt, EndsAt, validationContext);
|
|
}
|