Skip to content

Commit c2cc41e

Browse files
committed
more work on 2.0
1 parent 89ab283 commit c2cc41e

File tree

149 files changed

+57089
-30500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+57089
-30500
lines changed

src/Server.7z

72.8 MB
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Coderr.Server.Api.Core.Applications.Commands
6+
{
7+
[Command]
8+
public class AddTeamMember
9+
{
10+
public int UserToAdd { get; set; }
11+
public int ApplicationId { get; set; }
12+
13+
public string[] Roles { get; set; }
14+
}
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Coderr.Server.Api.Core.Applications.Commands
2+
{
3+
[Command]
4+
public class UpdateRoles
5+
{
6+
public int UserToUpdate { get; set; }
7+
public int ApplicationId { get; set; }
8+
9+
public string[] Roles { get; set; }
10+
}
11+
}

src/Server/Coderr.Server.Api/Core/Applications/Queries/GetApplicationTeamMember.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ public class GetApplicationTeamMember
2121
/// Account name
2222
/// </summary>
2323
public string UserName { get; set; }
24+
25+
public bool IsAdmin { get; set; }
2426
}
2527
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Coderr.Server.Api.Core.Invitations.Commands
6+
{
7+
[Message]
8+
public class DeleteInvitation
9+
{
10+
public int ApplicationId { get; set; }
11+
public string InvitedEmailAddress { get; set; }
12+
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Coderr.Server.Api.Core.Invitations.Events
6+
{
7+
[Event]
8+
public class InvitationDeleted
9+
{
10+
public int InvitationId { get; set; }
11+
public string InvitedEmailAddress { get; set; }
12+
public int[] ApplicationIds { get; set; }
13+
}
14+
}

src/Server/Coderr.Server.App/Core/Accounts/CommandHandlers/RequestPasswordResetHandler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Coderr.Server.Api.Core.Messaging.Commands;
44
using Coderr.Server.Domain.Core.Account;
55
using Coderr.Server.Infrastructure.Configuration;
6+
using Coderr.Server.PluginApi.Config;
67
using DotNetCqs;
78
using Griffin.Container;
89
using log4net;
@@ -18,10 +19,10 @@ internal class RequestPasswordResetHandler : IMessageHandler<RequestPasswordRese
1819
private readonly BaseConfiguration _baseConfig;
1920
private readonly ILog _logger = LogManager.GetLogger(typeof(RequestPasswordResetHandler));
2021

21-
public RequestPasswordResetHandler(IAccountRepository accountRepository, BaseConfiguration baseConfig)
22+
public RequestPasswordResetHandler(IAccountRepository accountRepository, IConfiguration<BaseConfiguration> baseConfig)
2223
{
2324
_accountRepository = accountRepository;
24-
_baseConfig = baseConfig;
25+
_baseConfig = baseConfig.Value;
2526
}
2627

2728
public async Task HandleAsync(IMessageContext context, RequestPasswordReset command)

src/Server/Coderr.Server.App/Core/ApiKeys/Events/ApplicationDeletedHandler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ namespace Coderr.Server.App.Core.ApiKeys.Events
1010
/// Will either delete an entire apikey (if the only association is with the given application) or just remove the
1111
/// application mapping.
1212
/// </summary>
13-
[Component(RegisterAsSelf = true)]
1413
public class ApplicationDeletedHandler : IMessageHandler<ApplicationDeleted>
1514
{
1615
private readonly IApiKeyRepository _repository;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System.Threading.Tasks;
2+
using Coderr.Server.Api.Core.Applications.Commands;
3+
using Coderr.Server.Domain.Core.Applications;
4+
using DotNetCqs;
5+
6+
namespace Coderr.Server.App.Core.Applications.CommandHandlers
7+
{
8+
public class AddTeamMemberHandler : IMessageHandler<AddTeamMember>
9+
{
10+
private readonly IApplicationRepository _applicationRepository;
11+
12+
public AddTeamMemberHandler(IApplicationRepository applicationRepository)
13+
{
14+
_applicationRepository = applicationRepository;
15+
}
16+
17+
public async Task HandleAsync(IMessageContext context, AddTeamMember message)
18+
{
19+
var member = new ApplicationTeamMember(message.ApplicationId, message.UserToAdd,
20+
context.Principal.Identity.Name);
21+
22+
await _applicationRepository.CreateAsync(member);
23+
}
24+
}
25+
}

src/Server/Coderr.Server.App/Core/Applications/CommandHandlers/DeleteApplicationHandler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ namespace Coderr.Server.App.Core.Applications.CommandHandlers
1111
/// <summary>
1212
/// Handler for <see cref="DeleteApplication" />.
1313
/// </summary>
14-
[Component(RegisterAsSelf = true)]
1514
public class DeleteApplicationHandler : IMessageHandler<DeleteApplication>
1615
{
1716
private readonly IApplicationRepository _repository;

0 commit comments

Comments
 (0)