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
eb28e1fd
Commit
eb28e1fd
authored
Aug 29, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issues
parent
92f7ddf3
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
116 additions
and
44 deletions
+116
-44
PSManagement.Api.csproj
PSManagement.Api/PSManagement.Api.csproj
+1
-1
DependencyInjection.cs
...ion/ApplicationDependencyInjection/DependencyInjection.cs
+5
-0
MapperConfiguration.cs
...on/ApplicationMappersConfiguration/MapperConfiguration.cs
+0
-32
ProjectDTOMapperConfiguration.cs
...tionMappersConfiguration/ProjectDTOMapperConfiguration.cs
+41
-0
ChangeEmployeeParticipationCommandValidator.cs
...ticipation/ChangeEmployeeParticipationCommandValidator.cs
+19
-0
EmployeeTrackDTO.cs
PSManagement.Application/Tracks/Common/EmployeeTrackDTO.cs
+1
-1
CompleteTrackCommandHandler.cs
...ses/Commands/CompleteTrack/CompleteTrackCommandHandler.cs
+5
-0
UpdateEmployeeWorkTrackCommandHandler.cs
...mployeeWorkTrack/UpdateEmployeeWorkTrackCommandHandler.cs
+4
-3
EmployeeTrackResponse.cs
...gement.Contracts/Tracks/Response/EmployeeTrackResponse.cs
+1
-1
TracksErrors.cs
PSManagement.Domain/Tracking/DomainErrors/TracksErrors.cs
+3
-2
EmployeeTrack.cs
PSManagement.Domain/Tracking/Entities/EmployeeTrack.cs
+19
-0
Track.cs
PSManagement.Domain/Tracking/Entities/Track.cs
+13
-0
StepsController.cs
...agement.Presentation/Controllers/Steps/StepsController.cs
+4
-4
No files found.
PSManagement.Api/PSManagement.Api.csproj
View file @
eb28e1fd
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Folder Include="Middleware\ExceptionHandl
ing
\" />
<Folder Include="Middleware\ExceptionHandl
er
\" />
</ItemGroup>
</ItemGroup>
</Project>
</Project>
PSManagement.Application/ApplicationDependencyInjection/DependencyInjection.cs
View file @
eb28e1fd
...
@@ -25,6 +25,7 @@ namespace PSManagement.Application.DI
...
@@ -25,6 +25,7 @@ namespace PSManagement.Application.DI
return
services
;
return
services
;
}
}
#
region
Mediator
private
static
IServiceCollection
AddMyMediatR
(
this
IServiceCollection
services
)
{
private
static
IServiceCollection
AddMyMediatR
(
this
IServiceCollection
services
)
{
services
.
AddMediatR
(
typeof
(
DependencyInjection
).
Assembly
);
services
.
AddMediatR
(
typeof
(
DependencyInjection
).
Assembly
);
...
@@ -35,7 +36,10 @@ namespace PSManagement.Application.DI
...
@@ -35,7 +36,10 @@ namespace PSManagement.Application.DI
return
services
;
return
services
;
}
}
#
endregion
Mediator
#
region
Mappers
private
static
IServiceCollection
AddMappers
(
this
IServiceCollection
services
)
private
static
IServiceCollection
AddMappers
(
this
IServiceCollection
services
)
{
{
...
@@ -50,6 +54,7 @@ namespace PSManagement.Application.DI
...
@@ -50,6 +54,7 @@ namespace PSManagement.Application.DI
return
services
;
return
services
;
}
}
#
endregion
Mappers
}
}
}
}
...
...
PSManagement.Application/ApplicationMappersConfiguration/MapperConfiguration.cs
View file @
eb28e1fd
...
@@ -3,8 +3,6 @@ using PSManagement.Application.Contracts.Authentication;
...
@@ -3,8 +3,6 @@ using PSManagement.Application.Contracts.Authentication;
using
PSManagement.Application.Customers.Common
;
using
PSManagement.Application.Customers.Common
;
using
PSManagement.Application.Employees.Common
;
using
PSManagement.Application.Employees.Common
;
using
PSManagement.Application.Projects.Common
;
using
PSManagement.Application.Projects.Common
;
using
PSManagement.Application.Projects.UseCases.Commands.CompleteProgressProject
;
using
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
;
using
PSManagement.Application.Tracks.Common
;
using
PSManagement.Application.Tracks.Common
;
using
PSManagement.Application.ProjectsTypes.Common
;
using
PSManagement.Application.ProjectsTypes.Common
;
...
@@ -16,7 +14,6 @@ using PSManagement.Domain.Customers.ValueObjects;
...
@@ -16,7 +14,6 @@ using PSManagement.Domain.Customers.ValueObjects;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.Identity.Entities
;
using
PSManagement.Domain.Identity.Entities
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.ValueObjects
;
using
PSManagement.Domain.Tracking
;
using
PSManagement.Domain.Tracking
;
using
PSManagement.Domain.Tracking.Entities
;
using
PSManagement.Domain.Tracking.Entities
;
using
System
;
using
System
;
...
@@ -69,33 +66,4 @@ namespace PSManagement.Application.Mappers
...
@@ -69,33 +66,4 @@ namespace PSManagement.Application.Mappers
}
}
}
}
public
class
ProjectDTOMapperConfiguration
:
Profile
{
public
ProjectDTOMapperConfiguration
()
{
CreateMap
<
Project
,
ProjectDTO
>().
ReverseMap
();
CreateMap
<
Project
,
ProjectDetailsDTO
>().
ReverseMap
();
CreateMap
<
ProjectType
,
ProjectTypeDTO
>().
ReverseMap
();
CreateMap
<
Project
,
ProjectInfo
>()
.
ConvertUsing
(
project
=>
project
.
ProjectInfo
);
CreateMap
<
EmployeeParticipate
,
EmployeeParticipateDTO
>()
.
ForMember
(
d
=>
d
.
ProjectInfo
,
opt
=>
opt
.
MapFrom
(
s
=>
s
.
Project
.
ProjectInfo
))
.
ForMember
(
d
=>
d
.
Employee
,
op
=>
op
.
MapFrom
(
e
=>
e
.
Employee
))
;
CreateMap
<
CreateNewTypeCommand
,
ProjectType
>();
CreateMap
<
UpdateTypeCommand
,
ProjectType
>();
CreateMap
<
ParticipationChange
,
ParticipationChangeDTO
>().
ReverseMap
();
CreateMap
<
CompleteProjectCommand
,
ProjectCompletion
>();
}
}
}
}
PSManagement.Application/ApplicationMappersConfiguration/ProjectDTOMapperConfiguration.cs
0 → 100644
View file @
eb28e1fd
using
AutoMapper
;
using
PSManagement.Application.Projects.Common
;
using
PSManagement.Application.Projects.UseCases.Commands.CompleteProgressProject
;
using
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
;
using
PSManagement.Application.ProjectsTypes.Common
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.ValueObjects
;
using
PSManagement.Domain.ProjectsTypes.Entites
;
namespace
PSManagement.Application.Mappers
{
public
class
ProjectDTOMapperConfiguration
:
Profile
{
public
ProjectDTOMapperConfiguration
()
{
CreateMap
<
Project
,
ProjectDTO
>().
ReverseMap
();
CreateMap
<
Project
,
ProjectDetailsDTO
>().
ReverseMap
();
CreateMap
<
ProjectType
,
ProjectTypeDTO
>().
ReverseMap
();
CreateMap
<
Project
,
ProjectInfo
>()
.
ConvertUsing
(
project
=>
project
.
ProjectInfo
);
CreateMap
<
EmployeeParticipate
,
EmployeeParticipateDTO
>()
.
ForMember
(
d
=>
d
.
ProjectInfo
,
opt
=>
opt
.
MapFrom
(
s
=>
s
.
Project
.
ProjectInfo
))
.
ForMember
(
d
=>
d
.
Employee
,
op
=>
op
.
MapFrom
(
e
=>
e
.
Employee
))
;
CreateMap
<
CreateNewTypeCommand
,
ProjectType
>();
CreateMap
<
UpdateTypeCommand
,
ProjectType
>();
CreateMap
<
ParticipationChange
,
ParticipationChangeDTO
>().
ReverseMap
();
CreateMap
<
CompleteProjectCommand
,
ProjectCompletion
>();
}
}
}
PSManagement.Application/Projects/UseCases/Commands/ChangeEmployeeParticipation/ChangeEmployeeParticipationCommandValidator.cs
0 → 100644
View file @
eb28e1fd
using
FluentValidation
;
using
PSManagement.Application.Projects.UseCases.Commands.ChangeProjectManager
;
namespace
PSManagement.Application.Projects.UseCases.Commands.ChangeEmployeeParticipation
{
public
class
ChangeEmployeeParticipationCommandValidator
:
AbstractValidator
<
ChangeEmployeeParticipationCommand
>
{
public
ChangeEmployeeParticipationCommandValidator
()
{
RuleFor
(
patrticipation
=>
patrticipation
.
PartialTimeRation
)
.
GreaterThan
(
0
);
RuleFor
(
patrticipation
=>
patrticipation
.
Role
)
.
NotEmpty
()
.
MinimumLength
(
5
);
}
}
}
PSManagement.Application/Tracks/Common/EmployeeTrackDTO.cs
View file @
eb28e1fd
...
@@ -6,7 +6,7 @@ namespace PSManagement.Application.Tracks.Common
...
@@ -6,7 +6,7 @@ namespace PSManagement.Application.Tracks.Common
public
class
EmployeeTrackDTO
public
class
EmployeeTrackDTO
{
{
public
int
Id
{
get
;
set
;
}
public
int
Id
{
get
;
set
;
}
public
int
EmloyeeId
{
get
;
set
;
}
public
int
Em
p
loyeeId
{
get
;
set
;
}
public
EmployeeDTO
Employee
{
get
;
set
;
}
public
EmployeeDTO
Employee
{
get
;
set
;
}
public
int
TrackId
{
get
;
set
;
}
public
int
TrackId
{
get
;
set
;
}
public
TrackInfo
TrackInfo
{
get
;
set
;
}
public
TrackInfo
TrackInfo
{
get
;
set
;
}
...
...
PSManagement.Application/Tracks/UseCases/Commands/CompleteTrack/CompleteTrackCommandHandler.cs
View file @
eb28e1fd
...
@@ -56,6 +56,11 @@ namespace PSManagement.Application.Tracks.UseCaes.Commands.CompleteTrack
...
@@ -56,6 +56,11 @@ namespace PSManagement.Application.Tracks.UseCaes.Commands.CompleteTrack
}
}
if
(
track
.
CheckEmployeeTrack
())
{
return
Result
.
Invalid
(
TracksErrors
.
InvailEmployeeTrack
);
}
foreach
(
StepTrack
stepTrack
in
track
?.
StepTracks
)
{
foreach
(
StepTrack
stepTrack
in
track
?.
StepTracks
)
{
Step
step
=
await
_stepsRepository
.
GetByIdAsync
(
stepTrack
.
StepId
);
Step
step
=
await
_stepsRepository
.
GetByIdAsync
(
stepTrack
.
StepId
);
...
...
PSManagement.Application/Tracks/UseCases/Commands/UpdateEmployeeWorkTrack/UpdateEmployeeWorkTrackCommandHandler.cs
View file @
eb28e1fd
...
@@ -52,10 +52,11 @@ namespace PSManagement.Application.Tracks.UseCaes.Commands.UpdateEmployeeWorkTra
...
@@ -52,10 +52,11 @@ namespace PSManagement.Application.Tracks.UseCaes.Commands.UpdateEmployeeWorkTra
return
Result
.
Invalid
(
TracksErrors
.
InvalidEntryError
);
return
Result
.
Invalid
(
TracksErrors
.
InvalidEntryError
);
}
}
employeeTrack
.
UpdateEmployeeWork
(
request
.
EmployeeWork
);
employeeTrack
.
UpdateEmployeeWorkInfo
(
request
.
EmployeeWorkInfo
);
employeeTrack
.
UpdateNotes
(
request
.
Notes
);
employeeTrack
.
EmployeeWork
=
request
.
EmployeeWork
;
employeeTrack
.
EmployeeWorkInfo
=
request
.
EmployeeWorkInfo
;
employeeTrack
.
Notes
=
request
.
Notes
;
await
_employeeTracksRepository
.
UpdateAsync
(
employeeTrack
);
await
_employeeTracksRepository
.
UpdateAsync
(
employeeTrack
);
...
...
PSManagement.Contracts/Tracks/Response/EmployeeTrackResponse.cs
View file @
eb28e1fd
...
@@ -5,7 +5,7 @@ using PSManagement.Contracts.Projects.Response;
...
@@ -5,7 +5,7 @@ using PSManagement.Contracts.Projects.Response;
namespace
PSManagement.Contracts.Tracks.Response
namespace
PSManagement.Contracts.Tracks.Response
{
{
public
record
EmployeeTrackResponse
(
public
record
EmployeeTrackResponse
(
int
EmloyeeId
,
int
Em
p
loyeeId
,
int
TrackId
,
int
TrackId
,
EmployeeResponse
Employee
,
EmployeeResponse
Employee
,
TrackInfo
TrackInfo
,
TrackInfo
TrackInfo
,
...
...
PSManagement.Domain/Tracking/DomainErrors/TracksErrors.cs
View file @
eb28e1fd
using
PSManagement.SharedKernel.DomainErrors
;
using
Ardalis.Result
;
using
PSManagement.SharedKernel.DomainErrors
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
...
@@ -15,6 +16,6 @@ namespace PSManagement.Domain.Tracking.DomainErrors
...
@@ -15,6 +16,6 @@ namespace PSManagement.Domain.Tracking.DomainErrors
public
static
DomainError
StepTrackExistError
{
get
;
}
=
new
(
"TrackError.Step.Exist."
,
"the Project already have the given particpant Data"
);
public
static
DomainError
StepTrackExistError
{
get
;
}
=
new
(
"TrackError.Step.Exist."
,
"the Project already have the given particpant Data"
);
public
static
DomainError
StepTrackUnExistError
{
get
;
}
=
new
(
"TrackError.Step.UnExist."
,
"the Project doesnt have the given particpant Data"
);
public
static
DomainError
StepTrackUnExistError
{
get
;
}
=
new
(
"TrackError.Step.UnExist."
,
"the Project doesnt have the given particpant Data"
);
public
static
DomainError
TrackCompletedUpdateError
{
get
;
}
=
new
(
"TrackError.Update.complete."
,
"the track couldnt be update afert its completed"
);
public
static
DomainError
TrackCompletedUpdateError
{
get
;
}
=
new
(
"TrackError.Update.complete."
,
"the track couldnt be update afert its completed"
);
public
static
DomainError
InvailEmployeeTrack
{
get
;
}
=
new
(
"TrackError.Update.complete."
,
"the employee track is not correct"
);
}
}
}
}
PSManagement.Domain/Tracking/Entities/EmployeeTrack.cs
View file @
eb28e1fd
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.SharedKernel.Entities
;
using
PSManagement.SharedKernel.Entities
;
using
System
;
namespace
PSManagement.Domain.Tracking
namespace
PSManagement.Domain.Tracking
{
{
...
@@ -13,5 +14,23 @@ namespace PSManagement.Domain.Tracking
...
@@ -13,5 +14,23 @@ namespace PSManagement.Domain.Tracking
public
EmployeeWorkInfo
EmployeeWorkInfo
{
get
;
set
;
}
public
EmployeeWorkInfo
EmployeeWorkInfo
{
get
;
set
;
}
public
EmployeeWork
EmployeeWork
{
get
;
set
;
}
public
EmployeeWork
EmployeeWork
{
get
;
set
;
}
public
string
Notes
{
get
;
set
;
}
public
string
Notes
{
get
;
set
;
}
#
region
Encapsulation
public
void
UpdateEmployeeWork
(
EmployeeWork
employeeWork
)
{
EmployeeWork
=
employeeWork
;
}
public
void
UpdateEmployeeWorkInfo
(
EmployeeWorkInfo
employeeWorkInfo
)
{
EmployeeWorkInfo
=
employeeWorkInfo
;
}
public
void
UpdateNotes
(
string
notes
)
{
Notes
=
notes
;
}
#
endregion
Encapsulation
}
}
}
}
PSManagement.Domain/Tracking/Entities/Track.cs
View file @
eb28e1fd
...
@@ -76,6 +76,19 @@ namespace PSManagement.Domain.Tracking
...
@@ -76,6 +76,19 @@ namespace PSManagement.Domain.Tracking
});
});
}
public
bool
CheckEmployeeTrack
()
{
int
contributions
=
0
;
foreach
(
EmployeeTrack
employeeTrack
in
EmployeeTracks
)
{
contributions
+=
employeeTrack
.
EmployeeWork
.
ContributingRatio
;
}
return
contributions
==
100
;
}
}
#
endregion
Encapsulation
#
endregion
Encapsulation
}
}
...
...
PSManagement.Presentation/Controllers/Steps/StepsController.cs
View file @
eb28e1fd
...
@@ -77,23 +77,23 @@ namespace PSManagement.Presentation.Controllers.Steps
...
@@ -77,23 +77,23 @@ namespace PSManagement.Presentation.Controllers.Steps
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
[
HttpPut
(
"UpdateStepInfo
/{id}
"
)]
[
HttpPut
(
"UpdateStepInfo"
)]
public
async
Task
<
IActionResult
>
PutChangeStepInfo
(
ChangeStepInfoRequest
request
)
public
async
Task
<
IActionResult
>
PutChangeStepInfo
(
ChangeStepInfoRequest
request
)
{
{
var
query
=
_mapper
.
Map
<
UpdateStepInformationCommand
>(
request
);
;
var
query
=
_mapper
.
Map
<
UpdateStepInformationCommand
>(
request
);
;
var
result
=
_mapper
.
Map
<
Result
>(
await
_sender
.
Send
(
query
)
);
var
result
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
[
HttpPut
(
"ChangeCompletionRatio
/{id}
"
)]
[
HttpPut
(
"ChangeCompletionRatio"
)]
public
async
Task
<
IActionResult
>
PutCompletionRatio
(
UpdateCompletionRatioRequest
request
)
public
async
Task
<
IActionResult
>
PutCompletionRatio
(
UpdateCompletionRatioRequest
request
)
{
{
var
query
=
_mapper
.
Map
<
UpdateCompletionRatioCommand
>(
request
);
var
query
=
_mapper
.
Map
<
UpdateCompletionRatioCommand
>(
request
);
var
result
=
_mapper
.
Map
<
Result
>(
await
_sender
.
Send
(
query
)
);
var
result
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
...
...
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