Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
#25 add TeamLeaveProject distinct input/payload
Browse files Browse the repository at this point in the history
  • Loading branch information
gfg7 committed Oct 25, 2023
1 parent 013d0bc commit 9fe9c48
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async Task GivenКомандаЯвляетсяУчастникомПро
public async Task WhenУдаляетКомандуИзСоставаПроекта(string username, string teamName, string project)
{
var team = await Db.Teams.Find(x => x.Name == teamName).FirstAsync();
var input = new TeamLeaveProjectNotice(team.Id, project);
var input = new TeamLeaveProjectInput(team.Id, project);

_currentUserProviderFake.LoginAs(username);
try
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Garnet.Teams.Infrastructure.Api.TeamLeaveProject
{
public record TeamLeaveProjectNotice(
public record TeamLeaveProjectInput(
string TeamId,
string ProjectId
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Garnet.Teams.Infrastructure.Api.TeamLeaveProject
{
public record TeamLeaveProjectPayload(
string TeamId,
string ProjectId
) : TeamLeaveProjectInput(TeamId, ProjectId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ public async Task<TeamJoinProjectRequestPayload> TeamJoinProjectRequest(Cancella
return new TeamJoinProjectRequestPayload(joinProjectRequest.Id, joinProjectRequest.TeamId, joinProjectRequest.ProjectId);
}

public async Task<TeamLeaveProjectNotice> TeamLeaveProject(CancellationToken ct, TeamLeaveProjectNotice input)
public async Task<TeamLeaveProjectPayload> TeamLeaveProject(CancellationToken ct, TeamLeaveProjectInput input)
{
var result = await _teamLeaveProjectCommand.Execute(ct, input.TeamId, input.ProjectId);
result.ThrowQueryExceptionIfHasErrors();

return input;
return new TeamLeaveProjectPayload(input.TeamId, input.ProjectId);
}

public async Task<TeamJoinInvitePayload> TeamJoinInvite(CancellationToken ct, TeamJoinInviteInput input)
Expand Down

0 comments on commit 9fe9c48

Please sign in to comment.