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
fcb517f9
Commit
fcb517f9
authored
Aug 25, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add project types and completion entities
parent
cd02d535
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
313 additions
and
31 deletions
+313
-31
GetEmployeeTrackHistoryQueryHandler.cs
...ployeeTrackHistory/GetEmployeeTrackHistoryQueryHandler.cs
+1
-1
PSManagement.Application.csproj
PSManagement.Application/PSManagement.Application.csproj
+1
-1
AttachmentDTO.cs
PSManagement.Application/Projects/Common/AttachmentDTO.cs
+1
-0
ProjectCompletionDTO.cs
...ement.Application/Projects/Common/ProjectCompletionDTO.cs
+15
-0
ProjectDTO.cs
PSManagement.Application/Projects/Common/ProjectDTO.cs
+2
-0
CompleteProjectCommand.cs
...eCases/Commands/CompleteProject/CompleteProjectCommand.cs
+6
-2
CompleteProjectCommandHandler.cs
...Commands/CompleteProject/CompleteProjectCommandHandler.cs
+9
-8
GetProjectParticipantsQuery.cs
...es/Queries/GetParticipants/GetProjectParticipantsQuery.cs
+0
-0
ProjectTypeDTO.cs
...gement.Application/ProjectsTypes/Common/ProjectTypeDTO.cs
+11
-0
CreateNewTypeCommand.cs
...s/UseCases/Commands/CreateNewType/CreateNewTypeCommand.cs
+14
-0
CreateNewTypeCommandHandler.cs
...ses/Commands/CreateNewType/CreateNewTypeCommandHandler.cs
+40
-0
RemoveTypeCommand.cs
...tsTypes/UseCases/Commands/RemoveType/RemoveTypeCommand.cs
+9
-0
RemoveTypeCommandHandler.cs
.../UseCases/Commands/RemoveType/RemoveTypeCommandHandler.cs
+47
-0
UpdateTypeCommand.cs
...tsTypes/UseCases/Commands/UpdateType/UpdateTypeCommand.cs
+13
-0
UpdateTypeCommandHandler.cs
.../UseCases/Commands/UpdateType/UpdateTypeCommandHandler.cs
+40
-0
GetProjectsTypesQuery.cs
...seCases/Queries/GetProjectsTypes/GetProjectsTypesQuery.cs
+11
-0
GetProjectsTypesQueryHandler.cs
.../Queries/GetProjectsTypes/GetProjectsTypesQueryHandler.cs
+40
-0
GetTypeByIdQuery.cs
...ctsTypes/UseCases/Queries/GetTypeById/GetTypeByIdQuery.cs
+10
-0
GetTypeByIdQueryHandler.cs
...s/UseCases/Queries/GetTypeById/GetTypeByIdQueryHandler.cs
+39
-0
EmployeeTrackDTO.cs
PSManagement.Application/Tracks/Common/EmployeeTrackDTO.cs
+2
-2
StepTrackResponse.cs
PSManagement.Contracts/Steps/Response/StepTrackResponse.cs
+0
-16
EmployeeTrackResponse.cs
...gement.Contracts/Tracks/Response/EmployeeTrackResponse.cs
+2
-1
No files found.
PSManagement.Application/Employees/UseCases/Queries/GetEmployeeTrackHistory/GetEmployeeTrackHistoryQueryHandler.cs
View file @
fcb517f9
...
...
@@ -10,7 +10,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System
;
namespace
PSManagement.Application.Employees.UseCases.Queries.GetEmployeeTrackHistory
{
public
class
GetEmployeeTrackHistoryQueryHandler
:
IQueryHandler
<
GetEmployeeTrackHistoryQuery
,
Result
<
IEnumerable
<
EmployeeTrackDTO
>>>
...
...
PSManagement.Application/PSManagement.Application.csproj
View file @
fcb517f9
...
...
@@ -7,7 +7,7 @@
<ItemGroup>
<Folder Include="Behaviors\AuthorizationBehavior\" />
<Folder Include="Projects\UseCases\Commands\ChangeParticip
antPartialTime
\" />
<Folder Include="Projects\UseCases\Commands\ChangeParticip
tionInfo
\" />
<Folder Include="Tracks\UseCaes\Queries\GetUncompletedTracks\" />
</ItemGroup>
...
...
PSManagement.Application/Projects/Common/AttachmentDTO.cs
View file @
fcb517f9
...
...
@@ -8,4 +8,5 @@
public
string
AttachmentName
{
get
;
set
;
}
public
string
AttachmentDescription
{
get
;
set
;
}
}
}
\ No newline at end of file
PSManagement.Application/Projects/Common/ProjectCompletionDTO.cs
0 → 100644
View file @
fcb517f9
using
System
;
namespace
PSManagement.Application.Projects.Common
{
public
class
ProjectCompletionDTO
{
public
int
Id
{
get
;
set
;
}
public
int
ProjectId
{
get
;
set
;
}
public
ProjectDTO
Project
{
get
;
set
;
}
public
DateTime
CompletionDate
{
get
;
set
;
}
public
String
CustomerNotes
{
get
;
set
;
}
public
int
CustomerRate
{
get
;
set
;
}
}
}
\ No newline at end of file
PSManagement.Application/Projects/Common/ProjectDTO.cs
View file @
fcb517f9
using
PSManagement.Application.Employees.Common
;
using
PSManagement.Application.FinancialSpends.Common
;
using
PSManagement.Application.ProjectsTypes.Common
;
using
PSManagement.Domain.Customers.Entities
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.Projects.Entities
;
...
...
@@ -15,6 +16,7 @@ namespace PSManagement.Application.Projects.Common
public
ProposalInfo
ProposalInfo
{
get
;
set
;
}
public
ProjectClassification
ProjectClassification
{
get
;
set
;
}
public
ProjectInfo
ProjectInfo
{
get
;
set
;
}
public
ProjectTypeDTO
ProjectType
{
get
;
set
;
}
public
string
CurrentState
{
get
;
set
;
}
public
Aggreement
ProjectAggreement
{
get
;
set
;
}
public
int
TeamLeaderId
{
get
;
set
;
}
...
...
PSManagement.Application/Projects/UseCases/Commands/CompletePro
gressProject/CompleteProgress
ProjectCommand.cs
→
PSManagement.Application/Projects/UseCases/Commands/CompletePro
ject/Complete
ProjectCommand.cs
View file @
fcb517f9
using
Ardalis.Result
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
System
;
namespace
PSManagement.Application.Projects.UseCases.Commands.CompleteProgressProject
{
public
record
CompleteProgressProjectCommand
(
int
ProjectId
public
record
CompleteProjectCommand
(
int
ProjectId
,
DateTime
CompletionDate
,
String
CustomerNotes
,
int
CustomerRate
)
:
ICommand
<
Result
>;
}
PSManagement.Application/Projects/UseCases/Commands/CompletePro
gressProject/CompleteProgress
ProjectCommandHandler.cs
→
PSManagement.Application/Projects/UseCases/Commands/CompletePro
ject/Complete
ProjectCommandHandler.cs
View file @
fcb517f9
using
Ardalis.Result
;
using
AutoMapper
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
...
...
@@ -9,23 +10,23 @@ using System.Threading.Tasks;
namespace
PSManagement.Application.Projects.UseCases.Commands.CompleteProgressProject
{
public
class
CompletePro
gressProjectCommandHandler
:
ICommandHandler
<
CompleteProgress
ProjectCommand
,
Result
>
public
class
CompletePro
jectCommandHandler
:
ICommandHandler
<
Complete
ProjectCommand
,
Result
>
{
private
readonly
IProjectsRepository
_projectsRepository
;
private
readonly
IUnitOfWork
_unitOfWork
;
public
CompletePro
gressPro
jectCommandHandler
(
private
IMapper
_mapper
;
public
CompleteProjectCommandHandler
(
IProjectsRepository
projectsRepository
,
IUnitOfWork
unitOfWork
)
IUnitOfWork
unitOfWork
,
IMapper
mapper
)
{
_projectsRepository
=
projectsRepository
;
_unitOfWork
=
unitOfWork
;
_mapper
=
mapper
;
}
public
async
Task
<
Result
>
Handle
(
CompletePro
gressPro
jectCommand
request
,
CancellationToken
cancellationToken
)
public
async
Task
<
Result
>
Handle
(
CompleteProjectCommand
request
,
CancellationToken
cancellationToken
)
{
Project
project
=
await
_projectsRepository
.
GetByIdAsync
(
request
.
ProjectId
);
if
(
project
is
null
)
...
...
@@ -34,7 +35,7 @@ namespace PSManagement.Application.Projects.UseCases.Commands.CompleteProgressPr
}
else
{
Result
result
=
project
.
Complete
();
Result
result
=
project
.
Complete
(
_mapper
.
Map
<
ProjectCompletion
>(
request
)
);
await
_unitOfWork
.
SaveChangesAsync
();
return
result
;
}
...
...
PSManagement.Application/Projects/UseCases/Queries/GetParticipants/GetProjectParticipants.cs
→
PSManagement.Application/Projects/UseCases/Queries/GetParticipants/GetProjectParticipants
Query
.cs
View file @
fcb517f9
File moved
PSManagement.Application/ProjectsTypes/Common/ProjectTypeDTO.cs
0 → 100644
View file @
fcb517f9
namespace
PSManagement.Application.ProjectsTypes.Common
{
public
class
ProjectTypeDTO
{
public
int
Id
{
get
;
set
;
}
public
string
TypeName
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
public
int
ExpectedEffort
{
get
;
set
;
}
}
}
\ No newline at end of file
PSManagement.Application/ProjectsTypes/UseCases/Commands/CreateNewType/CreateNewTypeCommand.cs
0 → 100644
View file @
fcb517f9
using
Ardalis.Result
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
PSManagement.SharedKernel.CQRS.Query
;
namespace
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
{
public
record
CreateNewTypeCommand
(
string
TypeName
,
string
Description
,
int
ExpectedEffort
)
:
ILoggableCommand
<
Result
<
int
>>;
}
PSManagement.Application/ProjectsTypes/UseCases/Commands/CreateNewType/CreateNewTypeCommandHandler.cs
0 → 100644
View file @
fcb517f9
using
Ardalis.Result
;
using
AutoMapper
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
{
public
class
CreateNewTypeCommandHandler
:
ICommandHandler
<
CreateNewTypeCommand
,
Result
<
int
>>
{
private
readonly
IProjectTypesRepository
_projectTypesRepository
;
private
readonly
IMapper
_mapper
;
public
CreateNewTypeCommandHandler
(
IMapper
mapper
,
IProjectTypesRepository
projectTypesRepository
)
{
_projectTypesRepository
=
projectTypesRepository
;
_mapper
=
mapper
;
}
public
async
Task
<
Result
<
int
>>
Handle
(
CreateNewTypeCommand
request
,
CancellationToken
cancellationToken
)
{
var
result
=
await
_projectTypesRepository
.
GetByTypeName
(
request
.
TypeName
);
if
(
result
is
not
null
)
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidName
);
}
var
projectType
=
await
_projectTypesRepository
.
AddAsync
(
_mapper
.
Map
<
ProjectType
>(
request
));
return
Result
.
Success
(
projectType
.
Id
);
}
}
}
PSManagement.Application/ProjectsTypes/UseCases/Commands/RemoveType/RemoveTypeCommand.cs
0 → 100644
View file @
fcb517f9
using
Ardalis.Result
;
using
PSManagement.SharedKernel.CQRS.Command
;
namespace
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
{
public
record
RemoveTypeCommand
(
int
typeId
)
:
ILoggableCommand
<
Result
>;
}
PSManagement.Application/ProjectsTypes/UseCases/Commands/RemoveType/RemoveTypeCommandHandler.cs
0 → 100644
View file @
fcb517f9
using
Ardalis.Result
;
using
AutoMapper
;
using
PSManagement.Domain.Projects
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
PSManagement.SharedKernel.Specification
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
{
public
class
RemoveTypeCommandHandler
:
ICommandHandler
<
RemoveTypeCommand
,
Result
>
{
private
readonly
IProjectTypesRepository
_projectTypesRepository
;
private
readonly
IMapper
_mapper
;
private
readonly
BaseSpecification
<
ProjectType
>
_specification
;
public
RemoveTypeCommandHandler
(
IMapper
mapper
,
IProjectTypesRepository
projectTypesRepository
)
{
_projectTypesRepository
=
projectTypesRepository
;
_mapper
=
mapper
;
_specification
=
new
ProjectTypeSpecification
();
}
public
async
Task
<
Result
>
Handle
(
RemoveTypeCommand
request
,
CancellationToken
cancellationToken
)
{
var
result
=
await
_projectTypesRepository
.
GetByIdAsync
(
request
.
typeId
,
_specification
);
if
(
result
is
null
)
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
}
if
(
result
.
Projects
is
not
null
)
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
}
await
_projectTypesRepository
.
DeleteAsync
(
result
);
return
Result
.
Success
();
}
}
}
PSManagement.Application/ProjectsTypes/UseCases/Commands/UpdateType/UpdateTypeCommand.cs
0 → 100644
View file @
fcb517f9
using
Ardalis.Result
;
using
PSManagement.SharedKernel.CQRS.Command
;
namespace
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
{
public
record
UpdateTypeCommand
(
int
Id
,
string
TypeName
,
string
Description
,
int
ExpectedEffort
)
:
ILoggableCommand
<
Result
>;
}
PSManagement.Application/ProjectsTypes/UseCases/Commands/UpdateType/UpdateTypeCommandHandler.cs
0 → 100644
View file @
fcb517f9
using
Ardalis.Result
;
using
AutoMapper
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
{
public
class
UpdateTypeCommandHandler
:
ICommandHandler
<
UpdateTypeCommand
,
Result
>
{
private
readonly
IProjectTypesRepository
_projectTypesRepository
;
private
readonly
IMapper
_mapper
;
public
UpdateTypeCommandHandler
(
IMapper
mapper
,
IProjectTypesRepository
projectTypesRepository
)
{
_projectTypesRepository
=
projectTypesRepository
;
_mapper
=
mapper
;
}
public
async
Task
<
Result
>
Handle
(
UpdateTypeCommand
request
,
CancellationToken
cancellationToken
)
{
var
result
=
await
_projectTypesRepository
.
GetByTypeName
(
request
.
TypeName
);
if
(
result
is
not
null
)
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
}
var
projectType
=
await
_projectTypesRepository
.
UpdateAsync
(
_mapper
.
Map
<
ProjectType
>(
request
));
return
Result
.
Success
();
}
}
}
PSManagement.Application/ProjectsTypes/UseCases/Queries/GetProjectsTypes/GetProjectsTypesQuery.cs
0 → 100644
View file @
fcb517f9
using
Ardalis.Result
;
using
PSManagement.Application.ProjectsTypes.Common
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
PSManagement.SharedKernel.Specification
;
using
System.Collections.Generic
;
namespace
PSManagement.Application.ProjectsTypes.UseCases.Queries.GetProjectsTypes
{
public
record
GetProjectsTypesQuery
(
)
:
IQuery
<
Result
<
IEnumerable
<
ProjectTypeDTO
>>>;
}
PSManagement.Application/ProjectsTypes/UseCases/Queries/GetProjectsTypes/GetProjectsTypesQueryHandler.cs
0 → 100644
View file @
fcb517f9
using
Ardalis.Result
;
using
AutoMapper
;
using
PSManagement.Application.ProjectsTypes.Common
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
PSManagement.SharedKernel.Specification
;
using
System.Collections.Generic
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.ProjectsTypes.UseCases.Queries.GetProjectsTypes
{
public
class
GetProjectsTypesQueryHandler
:
IQueryHandler
<
GetProjectsTypesQuery
,
Result
<
IEnumerable
<
ProjectTypeDTO
>>>
{
private
readonly
IProjectTypesRepository
_projectTypesRepository
;
private
readonly
IMapper
_mapper
;
private
readonly
BaseSpecification
<
ProjectType
>
_specification
;
public
GetProjectsTypesQueryHandler
(
IMapper
mapper
,
IProjectTypesRepository
projectTypesRepository
)
{
_projectTypesRepository
=
projectTypesRepository
;
_mapper
=
mapper
;
}
public
async
Task
<
Result
<
IEnumerable
<
ProjectTypeDTO
>>>
Handle
(
GetProjectsTypesQuery
request
,
CancellationToken
cancellationToken
)
{
var
result
=
await
_projectTypesRepository
.
ListAsync
();
if
(
result
is
null
)
{
result
=
new
List
<
ProjectType
>();
}
return
Result
.
Success
(
_mapper
.
Map
<
Result
<
IEnumerable
<
ProjectTypeDTO
>>>(
result
));
;
}
}
}
PSManagement.Application/ProjectsTypes/UseCases/Queries/GetTypeById/GetTypeByIdQuery.cs
0 → 100644
View file @
fcb517f9
using
Ardalis.Result
;
using
PSManagement.Application.ProjectsTypes.Common
;
using
PSManagement.SharedKernel.CQRS.Query
;
namespace
PSManagement.Application.ProjectsTypes.UseCases.Queries.GetTypeById
{
public
record
GetTypeByIdQuery
(
int
TypeId
)
:
IQuery
<
Result
<
ProjectTypeDTO
>>;
}
PSManagement.Application/ProjectsTypes/UseCases/Queries/GetTypeById/GetTypeByIdQueryHandler.cs
0 → 100644
View file @
fcb517f9
using
Ardalis.Result
;
using
AutoMapper
;
using
PSManagement.Application.ProjectsTypes.Common
;
using
PSManagement.Application.ProjectsTypes.UseCases.Queries.GetProjectsTypes
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.ProjectsTypes.UseCases.Queries.GetTypeById
{
public
class
GetTypeByIdQueryHandler
:
IQueryHandler
<
GetTypeByIdQuery
,
Result
<
ProjectTypeDTO
>>
{
private
readonly
IProjectTypesRepository
_projectTypesRepository
;
private
readonly
IMapper
_mapper
;
public
GetTypeByIdQueryHandler
(
IMapper
mapper
,
IProjectTypesRepository
projectTypesRepository
)
{
_projectTypesRepository
=
projectTypesRepository
;
_mapper
=
mapper
;
}
public
async
Task
<
Result
<
ProjectTypeDTO
>>
Handle
(
GetProjectsTypesQuery
request
,
CancellationToken
cancellationToken
)
{
var
result
=
await
_projectTypesRepository
.
ListAsync
();
if
(
result
is
null
)
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
}
return
Result
.
Success
(
_mapper
.
Map
<
Result
<
ProjectTypeDTO
>>(
result
));
;
}
}
}
PSManagement.Application/Tracks/Common/EmployeeTrackDTO.cs
View file @
fcb517f9
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Application.Employees.Common
;
namespace
PSManagement.Application.Tracks.Common
{
public
class
EmployeeTrackDTO
{
public
int
Id
{
get
;
set
;
}
public
int
EmloyeeId
{
get
;
set
;
}
public
Employee
Em
loyee
{
get
;
set
;
}
public
Employee
DTO
Emp
loyee
{
get
;
set
;
}
public
int
TrackId
{
get
;
set
;
}
public
TrackInfo
TrackInfo
{
get
;
set
;
}
public
EmployeeWorkInfo
EmployeeWorkInfo
{
get
;
set
;
}
...
...
PSManagement.Contracts/Steps/Response/StepTrackResponse.cs
deleted
100644 → 0
View file @
cd02d535
using
PSManagement.Domain.Tracking.ValueObjects
;
using
System
;
namespace
PSManagement.Contracts.Projects.Response
{
public
class
StepTrackResponse
{
public
int
StepId
{
get
;
set
;
}
public
int
TrackId
{
get
;
set
;
}
public
String
ExecutionState
{
get
;
set
;
}
public
TrackInfo
TrackInfo
{
get
;
set
;
}
public
int
ExecutionRatio
{
get
;
set
;
}
}
}
\ No newline at end of file
PSManagement.Contracts/Tracks/Response/EmployeeTrackResponse.cs
View file @
fcb517f9
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Contracts.Projects.Response
;
namespace
PSManagement.Contracts.Tracks.Response
{
public
record
EmployeeTrackResponse
(
int
EmloyeeId
,
int
TrackId
,
Employee
Employee
,
Employee
Response
Employee
,
TrackInfo
TrackInfo
,
EmployeeWorkInfo
EmployeeWorkInfo
,
EmployeeWork
EmployeeWork
,
...
...
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