Skip to content

Commit

Permalink
Merge branch 'main' into ABL-174-admin-api-send-announcements-to-spec…
Browse files Browse the repository at this point in the history
…ify-identities
  • Loading branch information
mergify[bot] authored Jan 27, 2025
2 parents 297a235 + 0421851 commit 0f7ccd0
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 119 deletions.
3 changes: 2 additions & 1 deletion .ci/appsettings.override.postgres.docker.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
},
"Messages": {
"Application": {
"DidDomainName": "localhost"
"DidDomainName": "localhost",
"MaxNumberOfMessageRecipients": 5
},
"Infrastructure": {
"SqlDatabase": {
Expand Down
3 changes: 2 additions & 1 deletion .ci/appsettings.override.postgres.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
},
"Messages": {
"Application": {
"DidDomainName": "localhost"
"DidDomainName": "localhost",
"MaxNumberOfMessageRecipients": 5
},
"Infrastructure": {
"SqlDatabase": {
Expand Down
3 changes: 2 additions & 1 deletion .ci/appsettings.override.sqlserver.docker.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
},
"Messages": {
"Application": {
"DidDomainName": "localhost"
"DidDomainName": "localhost",
"MaxNumberOfMessageRecipients": 5
},
"Infrastructure": {
"SqlDatabase": {
Expand Down
3 changes: 2 additions & 1 deletion .ci/appsettings.override.sqlserver.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
},
"Messages": {
"Application": {
"DidDomainName": "localhost"
"DidDomainName": "localhost",
"MaxNumberOfMessageRecipients": 5
},
"Infrastructure": {
"SqlDatabase": {
Expand Down
3 changes: 2 additions & 1 deletion Applications/ConsumerApi/src/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
"Pagination": {
"DefaultPageSize": 50,
"MaxPageSize": 200
}
},
"MaxNumberOfMessageRecipients": 1
},
"Infrastructure": {
"SqlDatabase": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
},
"Messages": {
"Application": {
"DidDomainName": "localhost"
"DidDomainName": "localhost",
"MaxNumberOfMessageRecipients": 5
},
"Infrastructure": {
"SqlDatabase": {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "enmshed-backbone-performance-tests",
"license": "MIT",
"devDependencies": {
"@babel/core": "7.26.0",
"@babel/core": "7.26.7",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
"@babel/preset-env": "7.26.0",
"@babel/preset-env": "7.26.7",
"@babel/preset-typescript": "7.26.0",
"@js-soft/eslint-config-ts": "1.6.13",
"@js-soft/license-check": "1.0.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class ApplicationOptions
[MinLength(3)]
[MaxLength(45)]
public string DidDomainName { get; set; } = null!;

[Required]
public int MaxNumberOfMessageRecipients { get; set; }
}

public class PaginationOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
using Backbone.Modules.Messages.Domain.Ids;
using Backbone.Tooling.Extensions;
using FluentValidation;
using Microsoft.Extensions.Options;

namespace Backbone.Modules.Messages.Application.Messages.Commands.SendMessage;

public class Validator : AbstractValidator<SendMessageCommand>
{
public Validator()
public Validator(IOptions<ApplicationOptions> options)
{
RuleFor(m => m.Recipients)
.DetailedNotNull()
Expand All @@ -21,7 +22,8 @@ public Validator()
.SetValidator(new SendMessageCommandRecipientInformationValidator()));

RuleFor(m => m.Recipients.Count)
.InclusiveBetween(1, 50).WithErrorCode(GenericApplicationErrors.Validation.InvalidPropertyValue().Code);
.LessThanOrEqualTo(options.Value.MaxNumberOfMessageRecipients)
.WithErrorCode(GenericApplicationErrors.Validation.InvalidPropertyValue().Code);

RuleFor(m => m.Body).DetailedNotNull().NumberOfBytes(1, 10.Mebibytes());

Expand Down

0 comments on commit 0f7ccd0

Please sign in to comment.