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
4f8f60d1
Commit
4f8f60d1
authored
Aug 25, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mapping issues
parent
9c6c50b6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
152 additions
and
6 deletions
+152
-6
CustomersController.cs
...nagement.Api/Controllers/Customers/CustomersController.cs
+1
-1
EmployeesController.cs
...nagement.Api/Controllers/Employees/EmployeesController.cs
+15
-1
ProjectsController.cs
PSManagement.Api/Controllers/Projects/ProjectsController.cs
+14
-4
ProjectsTypesController.cs
....Api/Controllers/ProjectsTypes/ProjectsTypesController.cs
+109
-0
TracksController.cs
PSManagement.Api/Controllers/Tracks/TracksController.cs
+10
-0
appsettings.json
PSManagement.Api/appsettings.json
+3
-0
No files found.
PSManagement.Api/Controllers/Customers/CustomersController.cs
View file @
4f8f60d1
...
@@ -25,7 +25,7 @@ namespace PSManagement.Api.Controllers.Customers
...
@@ -25,7 +25,7 @@ namespace PSManagement.Api.Controllers.Customers
[
Route
(
"api/[controller]"
)]
[
Route
(
"api/[controller]"
)]
[
Authorize
]
[
Authorize
]
public
class
CustomersController
:
APIController
public
class
CustomersController
:
APIController
{
{
private
readonly
IMediator
_sender
;
private
readonly
IMediator
_sender
;
private
readonly
IMapper
_mapper
;
private
readonly
IMapper
_mapper
;
...
...
PSManagement.Api/Controllers/Employees/EmployeesController.cs
View file @
4f8f60d1
...
@@ -8,6 +8,7 @@ using PSManagement.Application.Contracts.Providers;
...
@@ -8,6 +8,7 @@ using PSManagement.Application.Contracts.Providers;
using
PSManagement.Application.Contracts.SyncData
;
using
PSManagement.Application.Contracts.SyncData
;
using
PSManagement.Application.Employees.UseCases.Commands.UpdateEmployeeWorkHours
;
using
PSManagement.Application.Employees.UseCases.Commands.UpdateEmployeeWorkHours
;
using
PSManagement.Application.Employees.UseCases.Queries.GetAvailableEmployees
;
using
PSManagement.Application.Employees.UseCases.Queries.GetAvailableEmployees
;
using
PSManagement.Application.Employees.UseCases.Queries.GetDepartments
;
using
PSManagement.Application.Employees.UseCases.Queries.GetEmployeeById
;
using
PSManagement.Application.Employees.UseCases.Queries.GetEmployeeById
;
using
PSManagement.Application.Employees.UseCases.Queries.GetEmployeesByFilter
;
using
PSManagement.Application.Employees.UseCases.Queries.GetEmployeesByFilter
;
using
PSManagement.Application.Employees.UseCases.Queries.GetEmployeeTrackHistory
;
using
PSManagement.Application.Employees.UseCases.Queries.GetEmployeeTrackHistory
;
...
@@ -32,11 +33,13 @@ namespace PSManagement.Api.Controllers.Employees
...
@@ -32,11 +33,13 @@ namespace PSManagement.Api.Controllers.Employees
public
EmployeesController
(
public
EmployeesController
(
ISyncEmployeesService
syncEmployeesService
,
ISyncEmployeesService
syncEmployeesService
,
IMapper
mapper
,
IMapper
mapper
,
IMediator
sender
)
IMediator
sender
,
IEmployeesProvider
employeesProvider
)
{
{
_syncEmployeesService
=
syncEmployeesService
;
_syncEmployeesService
=
syncEmployeesService
;
_mapper
=
mapper
;
_mapper
=
mapper
;
_sender
=
sender
;
_sender
=
sender
;
_employeesProvider
=
employeesProvider
;
}
}
...
@@ -70,6 +73,17 @@ namespace PSManagement.Api.Controllers.Employees
...
@@ -70,6 +73,17 @@ namespace PSManagement.Api.Controllers.Employees
return
HandleResult
(
_mapper
.
Map
<
Result
<
IEnumerable
<
EmployeeResponse
>>>(
result
));
return
HandleResult
(
_mapper
.
Map
<
Result
<
IEnumerable
<
EmployeeResponse
>>>(
result
));
}
}
[
HttpGet
(
"Departments"
)]
public
async
Task
<
IActionResult
>
GetDepartments
()
{
var
query
=
new
GetDepartmentsQuery
();
var
result
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
_mapper
.
Map
<
Result
<
IEnumerable
<
DepartmentResponse
>>>(
result
));
}
[
HttpGet
(
"EmployeeParticipations"
)]
[
HttpGet
(
"EmployeeParticipations"
)]
public
async
Task
<
IActionResult
>
GetEmployeeParticipations
([
FromQuery
]
GetEmployeeParticipationRequest
request
)
public
async
Task
<
IActionResult
>
GetEmployeeParticipations
([
FromQuery
]
GetEmployeeParticipationRequest
request
)
...
...
PSManagement.Api/Controllers/Projects/ProjectsController.cs
View file @
4f8f60d1
...
@@ -182,18 +182,28 @@ namespace PSManagement.Api.Controllers.Projects
...
@@ -182,18 +182,28 @@ namespace PSManagement.Api.Controllers.Projects
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
[
HttpPost
(
"CompleteProject
/{id}
"
)]
[
HttpPost
(
"CompleteProject"
)]
public
async
Task
<
IActionResult
>
PostCompleteProjectRequest
(
int
id
)
public
async
Task
<
IActionResult
>
PostCompleteProjectRequest
(
CompleteProjectRequest
request
)
{
{
var
query
=
new
CompleteProjectCommand
(
id
);
var
query
=
_mapper
.
Map
<
CompleteProjectCommand
>(
request
);
var
result
=
await
_sender
.
Send
(
query
);
var
result
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
#
endregion
project
state
operations
#
endregion
project
state
operations
[
HttpPost
(
"ChangeParticipation"
)]
public
async
Task
<
IActionResult
>
PostChangePArticipation
(
ChangeEmployeeParticipationRequest
request
)
{
var
query
=
_mapper
.
Map
<
ChangeEmployeeParticipationCommand
>(
request
);
var
result
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
result
);
}
[
HttpGet
(
"{id}"
)]
[
HttpGet
(
"{id}"
)]
public
async
Task
<
IActionResult
>
Get
(
int
id
)
public
async
Task
<
IActionResult
>
Get
(
int
id
)
...
...
PSManagement.Api/Controllers/ProjectsTypes/ProjectsTypesController.cs
0 → 100644
View file @
4f8f60d1
using
Ardalis.Result
;
using
AutoMapper
;
using
MediatR
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
PSManagement.Api.Controllers.ApiBase
;
using
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
;
using
PSManagement.Application.ProjectsTypes.UseCases.Queries.GetProjectsTypes
;
using
PSManagement.Application.ProjectsTypes.UseCases.Queries.GetTypeById
;
using
PSManagement.Contracts.ProjectsTypes.Request
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
PSManagement.Api.Controllers
{
[
Route
(
"api/[controller]"
)]
[
ApiController
]
public
class
ProjectsTypesController
:
APIController
{
private
readonly
IMediator
_sender
;
private
readonly
IMapper
_mapper
;
public
ProjectsTypesController
(
IMediator
sender
,
IMapper
mapper
)
{
_sender
=
sender
;
_mapper
=
mapper
;
}
[
HttpGet
]
public
async
Task
<
IActionResult
>
Get
()
{
var
query
=
new
GetProjectsTypesQuery
();
var
result
=
_mapper
.
Map
<
Result
<
IEnumerable
<
ProjectTypeResponse
>>>(
await
_sender
.
Send
(
query
));
return
HandleResult
(
result
);
}
[
HttpGet
(
"{id}"
)]
public
async
Task
<
IActionResult
>
Get
(
int
id
)
{
var
query
=
new
GetTypeByIdQuery
(
id
);
var
result
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
_mapper
.
Map
<
Result
<
ProjectTypeResponse
>>(
result
));
}
[
HttpPost
]
public
async
Task
<
IActionResult
>
Post
(
CreateNewTypeRequest
request
)
{
var
command
=
_mapper
.
Map
<
CreateNewTypeCommand
>(
request
);
var
result
=
await
_sender
.
Send
(
command
);
if
(
result
.
IsSuccess
)
{
var
query
=
new
GetTypeByIdQuery
(
result
.
Value
);
var
response
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
_mapper
.
Map
<
Result
<
ProjectTypeResponse
>>(
response
));
}
else
{
return
HandleResult
(
result
);
}
}
[
HttpDelete
(
"{id}"
)]
public
async
Task
<
IActionResult
>
Delete
(
int
id
)
{
var
command
=
new
RemoveTypeCommand
(
id
);
var
result
=
await
_sender
.
Send
(
command
);
return
HandleResult
(
result
);
}
[
HttpPut
(
"{id}"
)]
public
async
Task
<
IActionResult
>
Put
(
int
id
,
UpdateTypeCommand
request
)
{
if
(
id
!=
request
.
Id
)
{
return
Problem
();
}
var
command
=
_mapper
.
Map
<
UpdateTypeCommand
>(
request
);
var
result
=
await
_sender
.
Send
(
command
);
return
HandleResult
(
result
);
}
}
}
PSManagement.Api/Controllers/Tracks/TracksController.cs
View file @
4f8f60d1
...
@@ -14,6 +14,7 @@ using PSManagement.Application.Tracks.UseCaes.Queries.GetEmployeesTrack;
...
@@ -14,6 +14,7 @@ using PSManagement.Application.Tracks.UseCaes.Queries.GetEmployeesTrack;
using
PSManagement.Application.Tracks.UseCaes.Queries.GetStepsTrack
;
using
PSManagement.Application.Tracks.UseCaes.Queries.GetStepsTrack
;
using
PSManagement.Application.Tracks.UseCaes.Queries.GetTrackById
;
using
PSManagement.Application.Tracks.UseCaes.Queries.GetTrackById
;
using
PSManagement.Application.Tracks.UseCaes.Queries.GetTracksByProject
;
using
PSManagement.Application.Tracks.UseCaes.Queries.GetTracksByProject
;
using
PSManagement.Application.Tracks.UseCaes.Queries.GetUncompletedTracks
;
using
PSManagement.Contracts.Tracks.Requests
;
using
PSManagement.Contracts.Tracks.Requests
;
using
PSManagement.Contracts.Tracks.Response
;
using
PSManagement.Contracts.Tracks.Response
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -53,6 +54,15 @@ namespace PSManagement.Api.Controllers.Tracks
...
@@ -53,6 +54,15 @@ namespace PSManagement.Api.Controllers.Tracks
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
[
HttpGet
(
"UnCompleted"
)]
public
async
Task
<
IActionResult
>
GetUnCompleted
()
{
var
query
=
new
GetUnCompletedTracksQuery
();
var
result
=
_mapper
.
Map
<
Result
<
IEnumerable
<
TrackResponse
>>>(
await
_sender
.
Send
(
query
));
return
HandleResult
(
result
);
}
[
HttpGet
(
"GetEmployeesTrack/{id}"
)]
[
HttpGet
(
"GetEmployeesTrack/{id}"
)]
public
async
Task
<
IActionResult
>
GetEmployeesTrack
([
FromRoute
]
int
id
)
public
async
Task
<
IActionResult
>
GetEmployeesTrack
([
FromRoute
]
int
id
)
...
...
PSManagement.Api/appsettings.json
View file @
4f8f60d1
...
@@ -18,5 +18,8 @@
...
@@ -18,5 +18,8 @@
},
},
"EmpoyeesSyncJobSettings"
:
{
"EmpoyeesSyncJobSettings"
:
{
"SyncIntervalInMinutes"
:
60
"SyncIntervalInMinutes"
:
60
},
"FileServiceSettings"
:
{
"AvailableExtension"
:
[
"png"
,
"pdf"
]
}
}
}
}
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