Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
ProjectsStatusManagement
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hasan.bahjat
ProjectsStatusManagement
Commits
9c065223
Commit
9c065223
authored
Aug 13, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement Project Controller
parent
e9254581
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
143 additions
and
5 deletions
+143
-5
CustomersController.cs
...nagement.Api/Controllers/Customers/CustomersController.cs
+2
-1
ProjectsController.cs
PSManagement.Api/Controllers/Projects/ProjectsController.cs
+96
-3
StepsController.cs
PSManagement.Api/Controllers/Steps/StepsController.cs
+15
-0
TracksController.cs
PSManagement.Api/Controllers/Tracks/TracksController.cs
+10
-0
CustomerMapperConfiguration.cs
PSManagement.Api/Mappers/CustomerMapperConfiguration.cs
+19
-1
PSManagement.Api.csproj
PSManagement.Api/PSManagement.Api.csproj
+1
-0
No files found.
PSManagement.Api/Controllers/Customers/CustomersController.cs
View file @
9c065223
...
...
@@ -51,7 +51,8 @@ namespace PSManagement.Api.Controllers.Customers
var
result
=
await
_sender
.
Send
(
query
);
return
Ok
(
result
);
return
Ok
(
_mapper
.
Map
<
Result
<
CustomerRecord
>>(
result
));
}
[
HttpPost
]
public
async
Task
<
IActionResult
>
CreateCustomer
(
CreateCustomerRequest
request
)
...
...
PSManagement.Api/Controllers/Projects/ProjectsController.cs
View file @
9c065223
using
AutoMapper
;
using
MediatR
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
PSManagement.Api.Controllers.ApiBase
;
using
PSManagement.Application.Projects.UseCases.Commands.AddAttachment
;
using
PSManagement.Application.Projects.UseCases.Commands.CreateProject
;
using
PSManagement.Application.Projects.UseCases.Queries.GetProject
;
using
PSManagement.Contracts.Projects.Requests
;
using
System
;
using
PSManagement.Contracts.Projects.Response
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Ardalis.Result
;
using
PSManagement.Application.Projects.UseCases.Queries.ListAllProject
;
using
PSManagement.Application.Projects.UseCases.Commands.AddParticipant
;
using
PSManagement.Application.Projects.UseCases.Commands.RemoveParticipant
;
using
PSManagement.Application.Projects.UseCases.Commands.AddProjectStep
;
using
PSManagement.Application.Projects.UseCases.Commands.ChangeProjectTeamLeader
;
using
PSManagement.Application.Projects.UseCases.Commands.ApproveProject
;
using
PSManagement.Application.Projects.UseCases.Queries.GetParticipants
;
namespace
PSManagement.Api.Controllers.Projects
{
...
...
@@ -26,6 +33,92 @@ namespace PSManagement.Api.Controllers.Projects
_sender
=
sender
;
}
[
HttpGet
]
public
async
Task
<
IActionResult
>
Get
([
FromQuery
]
ListAllProjectsRequest
request
)
{
var
query
=
_mapper
.
Map
<
ListAllProjectsQuery
>(
request
);
var
result
=
_mapper
.
Map
<
Result
<
IEnumerable
<
ProjectResponse
>>>(
await
_sender
.
Send
(
query
));
return
Ok
(
result
);
}
[
HttpGet
(
"GetParticipants{id}"
)]
public
async
Task
<
IActionResult
>
GetParticipants
(
int
id
)
{
GetProjectParticipantsQuery
query
=
new
(
id
);
var
result
=
await
_sender
.
Send
(
query
);
return
Ok
(
_mapper
.
Map
<
Result
<
IEnumerable
<
EmployeeParticipateResponse
>>>(
result
));
}
[
HttpPost
(
"ApproveProject"
)]
public
async
Task
<
IActionResult
>
ApproveProjectRequest
(
ApproveProjectRequest
request
)
{
var
query
=
_mapper
.
Map
<
ApproveProjectCommand
>(
request
);
var
result
=
await
_sender
.
Send
(
query
);
return
Ok
(
result
);
}
[
HttpPost
(
"ChangeTeamLeader"
)]
public
async
Task
<
IActionResult
>
ChangeTeamLeader
(
ChangeProjectTeamLeaderRequest
request
)
{
var
query
=
_mapper
.
Map
<
ChangeProjectTeamLeaderCommand
>(
request
);
var
result
=
await
_sender
.
Send
(
query
);
return
Ok
(
result
);
}
[
HttpPost
(
"AddProjectStep"
)]
public
async
Task
<
IActionResult
>
AddParticipant
(
AddProjectStepRequest
request
)
{
var
query
=
_mapper
.
Map
<
AddProjectStepCommand
>(
request
);
var
result
=
await
_sender
.
Send
(
query
);
return
Ok
(
result
);
}
[
HttpPost
(
"RemoveParticipant"
)]
public
async
Task
<
IActionResult
>
RemoveParticipant
(
RemoveParticipantRequest
request
)
{
var
query
=
_mapper
.
Map
<
RemoveParticipantCommand
>(
request
);
var
result
=
await
_sender
.
Send
(
query
);
return
Ok
(
result
);
}
[
HttpPost
(
"AddParticipant"
)]
public
async
Task
<
IActionResult
>
AddParticipant
(
AddParticipantRequest
request
)
{
var
query
=
_mapper
.
Map
<
AddParticipantCommand
>(
request
);
var
result
=
await
_sender
.
Send
(
query
);
return
Ok
(
result
);
}
[
HttpGet
(
"{id}"
)]
public
async
Task
<
IActionResult
>
Get
(
int
id
)
{
var
query
=
new
GetProjectByIdQuery
(
id
);
var
result
=
await
_sender
.
Send
(
query
);
return
Ok
(
_mapper
.
Map
<
Result
<
ProjectResponse
>>(
result
));
}
[
HttpPost
]
public
async
Task
<
IActionResult
>
Post
([
FromBody
]
CreateProjectRequest
request
)
{
...
...
PSManagement.Api/Controllers/Steps/StepsController.cs
0 → 100644
View file @
9c065223
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
PSManagement.Api.Controllers.ApiBase
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
PSManagement.Api.Controllers.Steps
{
[
Route
(
"api/[controller]"
)]
public
class
StepsController
:
APIController
{
}
}
PSManagement.Api/Controllers/Tracks/TracksController.cs
0 → 100644
View file @
9c065223
using
Microsoft.AspNetCore.Mvc
;
using
PSManagement.Api.Controllers.ApiBase
;
namespace
PSManagement.Api.Controllers.Tracks
{
[
Route
(
"api/[controller]"
)]
public
class
TracksController
:
APIController
{
}
}
PSManagement.Api/Mappers/CustomerMapperConfiguration.cs
View file @
9c065223
...
...
@@ -3,10 +3,19 @@ using PSManagement.Application.Customers.Common;
using
PSManagement.Application.Customers.UseCases.Commands.AddContactInfo
;
using
PSManagement.Application.Customers.UseCases.Commands.CreateCustomer
;
using
PSManagement.Application.Customers.UseCases.Commands.UpdateCustomer
;
using
PSManagement.Application.Employees.Common
;
using
PSManagement.Application.Projects.Common
;
using
PSManagement.Application.Projects.UseCases.Commands.AddParticipant
;
using
PSManagement.Application.Projects.UseCases.Commands.AddProjectStep
;
using
PSManagement.Application.Projects.UseCases.Commands.ApproveProject
;
using
PSManagement.Application.Projects.UseCases.Commands.ChangeProjectTeamLeader
;
using
PSManagement.Application.Projects.UseCases.Commands.CreateProject
;
using
PSManagement.Application.Projects.UseCases.Commands.RemoveParticipant
;
using
PSManagement.Application.Projects.UseCases.Queries.ListAllProject
;
using
PSManagement.Contracts.Customers.Requests
;
using
PSManagement.Contracts.Customers.Responses
;
using
PSManagement.Contracts.Projects.Requests
;
using
PSManagement.Contracts.Projects.Response
;
using
PSManagement.SharedKernel.Utilities
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -38,7 +47,16 @@ namespace PSManagement.Api.Mappers
public
ProjectMapperConfiguration
()
{
CreateMap
<
CreateProjectRequest
,
CreateProjectCommand
>().
ReverseMap
();
CreateMap
<
ListAllProjectsRequest
,
ListAllProjectsQuery
>().
ReverseMap
();
CreateMap
<
ApproveProjectRequest
,
ApproveProjectCommand
>().
ReverseMap
();
CreateMap
<
AddParticipantRequest
,
AddParticipantCommand
>().
ReverseMap
();
CreateMap
<
AddProjectStepRequest
,
AddProjectStepCommand
>().
ReverseMap
();
CreateMap
<
ChangeProjectTeamLeaderRequest
,
ChangeProjectTeamLeaderCommand
>().
ReverseMap
();
CreateMap
<
RemoveParticipantRequest
,
RemoveParticipantCommand
>().
ReverseMap
();
CreateMap
<
EmployeeResponse
,
EmployeeDTO
>().
ReverseMap
();
CreateMap
<
EmployeeParticipateResponse
,
EmployeeParticipateDTO
>().
ReverseMap
();
}
}
}
PSManagement.Api/PSManagement.Api.csproj
View file @
9c065223
...
...
@@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>
<ItemGroup>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment