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 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 Validate(ValidationContext validationContext) => OfferingSchedule.Validate(StartsAt, EndsAt, validationContext); }