Expanded on existing whiteboard
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using AipsCore.Domain.Abstract.Rule;
|
||||
using AipsCore.Domain.Abstract.ValueObject;
|
||||
using AipsCore.Domain.Common.Validation.Rules;
|
||||
|
||||
namespace AipsCore.Domain.Models.Whiteboard.ValueObjects;
|
||||
|
||||
public record WhiteboardCreatedAt : AbstractValueObject
|
||||
{
|
||||
public DateTime CreatedAtValue { get; init; }
|
||||
|
||||
public WhiteboardCreatedAt(DateTime CreatedAtValue)
|
||||
{
|
||||
this.CreatedAtValue = CreatedAtValue;
|
||||
Validate();
|
||||
}
|
||||
|
||||
protected override ICollection<IRule> GetValidationRules()
|
||||
{
|
||||
return [
|
||||
new DateInPastRule(CreatedAtValue)
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using AipsCore.Domain.Abstract.Rule;
|
||||
using AipsCore.Domain.Abstract.ValueObject;
|
||||
using AipsCore.Domain.Common.Validation.Rules;
|
||||
|
||||
namespace AipsCore.Domain.Models.Whiteboard.ValueObjects;
|
||||
|
||||
public record WhiteboardDeletedAt : AbstractValueObject
|
||||
{
|
||||
public DateTime? DeletedAtValue { get; init; }
|
||||
|
||||
public WhiteboardDeletedAt(DateTime? DeletedAtValue)
|
||||
{
|
||||
this.DeletedAtValue = DeletedAtValue;
|
||||
Validate();
|
||||
}
|
||||
|
||||
protected override ICollection<IRule> GetValidationRules()
|
||||
{
|
||||
return [
|
||||
new DateInPastRule(DeletedAtValue)
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using AipsCore.Domain.Abstract.Rule;
|
||||
using AipsCore.Domain.Abstract.ValueObject;
|
||||
using AipsCore.Domain.Common.Validation.Rules;
|
||||
|
||||
namespace AipsCore.Domain.Models.Whiteboard.ValueObjects;
|
||||
|
||||
public record WhiteboardMaxParticipants : AbstractValueObject
|
||||
{
|
||||
private const int MinMaxParticipants = 1;
|
||||
private const int MaxMaxParticipants = 100;
|
||||
public int MaxParticipantsValue { get; init; }
|
||||
|
||||
public WhiteboardMaxParticipants(int MaxParticipantsValue)
|
||||
{
|
||||
this.MaxParticipantsValue = MaxParticipantsValue;
|
||||
Validate();
|
||||
}
|
||||
protected override ICollection<IRule> GetValidationRules()
|
||||
{
|
||||
return [
|
||||
new MinValueRule<int>(MaxParticipantsValue, MinMaxParticipants),
|
||||
new MaxValueRule<int>(MaxParticipantsValue, MaxMaxParticipants)
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user