-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5450 from dfe-analytical-services/EES-4122
EES-5047: Implement character limits
- Loading branch information
Showing
19 changed files
with
481 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 28 additions & 7 deletions
35
src/GovUk.Education.ExploreEducationStatistics.Admin/Requests/DataGuidanceUpdateRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,45 @@ | ||
#nullable enable | ||
#nullable enable | ||
using FluentValidation; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace GovUk.Education.ExploreEducationStatistics.Admin.Requests; | ||
|
||
public record DataGuidanceUpdateRequest | ||
{ | ||
[Required] | ||
public string Content { get; init; } = string.Empty; | ||
|
||
[MinLength(1)] | ||
public List<DataGuidanceDataSetUpdateRequest> DataSets { get; init; } = new(); | ||
public List<DataGuidanceDataSetUpdateRequest> DataSets { get; init; } = []; | ||
|
||
public class Validator : AbstractValidator<DataGuidanceUpdateRequest> | ||
{ | ||
public Validator() | ||
{ | ||
RuleFor(request => request.Content) | ||
.NotEmpty(); | ||
|
||
RuleFor(request => request.DataSets) | ||
.NotEmpty(); | ||
} | ||
} | ||
} | ||
|
||
public record DataGuidanceDataSetUpdateRequest | ||
{ | ||
[Required] | ||
public Guid FileId { get; init; } | ||
|
||
[Required] | ||
public string Content { get; init; } = string.Empty; | ||
|
||
public class Validator : AbstractValidator<DataGuidanceDataSetUpdateRequest> | ||
{ | ||
public Validator() | ||
{ | ||
RuleFor(request => request.FileId) | ||
.NotEmpty(); | ||
|
||
RuleFor(request => request.Content) | ||
.NotEmpty() | ||
.MaximumLength(250); | ||
} | ||
} | ||
} |
33 changes: 28 additions & 5 deletions
33
src/GovUk.Education.ExploreEducationStatistics.Admin/Requests/FeaturedTableRequests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,49 @@ | ||
#nullable enable | ||
using FluentValidation; | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace GovUk.Education.ExploreEducationStatistics.Admin.Requests; | ||
|
||
public record FeaturedTableCreateRequest | ||
{ | ||
[Required] | ||
public string Name { get; init; } = string.Empty; | ||
|
||
[Required] | ||
public string Description { get; set; } = string.Empty; | ||
|
||
public Guid DataBlockId { get; set; } | ||
|
||
public class Validator : AbstractValidator<FeaturedTableCreateRequest> | ||
{ | ||
public Validator() | ||
{ | ||
RuleFor(request => request.Name) | ||
.NotEmpty() | ||
.MaximumLength(120); | ||
|
||
RuleFor(request => request.Description) | ||
.NotEmpty() | ||
.MaximumLength(200); | ||
} | ||
} | ||
} | ||
|
||
public record FeaturedTableUpdateRequest | ||
{ | ||
[Required] | ||
public string Name { get; init; } = string.Empty; | ||
|
||
[Required] | ||
public string Description { get; set; } = string.Empty; | ||
|
||
public class Validator : AbstractValidator<FeaturedTableUpdateRequest> | ||
{ | ||
public Validator() | ||
{ | ||
RuleFor(request => request.Name) | ||
.NotEmpty() | ||
.MaximumLength(120); | ||
|
||
RuleFor(request => request.Description) | ||
.NotEmpty() | ||
.MaximumLength(200); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.