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
510e4e47
Commit
510e4e47
authored
Aug 26, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CQRS For Projects Types
parent
7e7abea2
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
11 deletions
+20
-11
MapperConfiguration.cs
...on/ApplicationMappersConfiguration/MapperConfiguration.cs
+5
-1
PSManagement.Application.csproj
PSManagement.Application/PSManagement.Application.csproj
+4
-0
CreateProjectCommandHandler.cs
...ses/Commands/CreateProject/CreateProjectCommandHandler.cs
+1
-1
ProjectTypeDTO.cs
...gement.Application/ProjectsTypes/Common/ProjectTypeDTO.cs
+1
-0
CreateNewTypeCommandHandler.cs
...ses/Commands/CreateNewType/CreateNewTypeCommandHandler.cs
+2
-2
RemoveTypeCommandHandler.cs
.../UseCases/Commands/RemoveType/RemoveTypeCommandHandler.cs
+3
-3
UpdateTypeCommandHandler.cs
.../UseCases/Commands/UpdateType/UpdateTypeCommandHandler.cs
+1
-1
GetProjectsTypesQueryHandler.cs
.../Queries/GetProjectsTypes/GetProjectsTypesQueryHandler.cs
+1
-1
GetTypeByIdQueryHandler.cs
...s/UseCases/Queries/GetTypeById/GetTypeByIdQueryHandler.cs
+2
-2
No files found.
PSManagement.Application/ApplicationMappersConfiguration/MapperConfiguration.cs
View file @
510e4e47
...
@@ -8,6 +8,8 @@ using PSManagement.Application.Projects.Common;
...
@@ -8,6 +8,8 @@ using PSManagement.Application.Projects.Common;
using
PSManagement.Application.Projects.UseCases.Commands.CompleteProgressProject
;
using
PSManagement.Application.Projects.UseCases.Commands.CompleteProgressProject
;
using
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
;
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.Tracks.UseCaes.Commands.AddEmployeeTrack
;
using
PSManagement.Application.Tracks.UseCaes.Commands.AddEmployeeTrack
;
using
PSManagement.Application.Tracks.UseCaes.Commands.AddStepTrack
;
using
PSManagement.Application.Tracks.UseCaes.Commands.AddStepTrack
;
using
PSManagement.Application.Tracks.UseCaes.Commands.CreateTrack
;
using
PSManagement.Application.Tracks.UseCaes.Commands.CreateTrack
;
...
@@ -25,6 +27,7 @@ using System.Collections.Generic;
...
@@ -25,6 +27,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
PSManagement.Domain.ProjectsTypes.Entites
;
namespace
PSManagement.Application.Mappers
namespace
PSManagement.Application.Mappers
{
{
...
@@ -34,7 +37,7 @@ namespace PSManagement.Application.Mappers
...
@@ -34,7 +37,7 @@ namespace PSManagement.Application.Mappers
{
{
CreateMap
<
CustomerDTO
,
Customer
>().
ReverseMap
();
CreateMap
<
CustomerDTO
,
Customer
>().
ReverseMap
();
CreateMap
<
ContactInfoDTO
,
ContactInfo
>().
ReverseMap
();
CreateMap
<
ContactInfoDTO
,
ContactInfo
>().
ReverseMap
();
CreateMap
<
ProjectType
,
ProjectTypeDTO
>().
ReverseMap
();
CreateMap
<
Step
,
StepDTO
>()
CreateMap
<
Step
,
StepDTO
>()
;
;
...
@@ -74,6 +77,7 @@ namespace PSManagement.Application.Mappers
...
@@ -74,6 +77,7 @@ namespace PSManagement.Application.Mappers
CreateMap
<
Project
,
ProjectDTO
>().
ReverseMap
();
CreateMap
<
Project
,
ProjectDTO
>().
ReverseMap
();
CreateMap
<
Project
,
ProjectDetailsDTO
>().
ReverseMap
();
CreateMap
<
Project
,
ProjectDetailsDTO
>().
ReverseMap
();
CreateMap
<
ProjectType
,
ProjectTypeDTO
>().
ReverseMap
();
CreateMap
<
Project
,
ProjectInfo
>()
CreateMap
<
Project
,
ProjectInfo
>()
.
ConvertUsing
(
project
=>
project
.
ProjectInfo
);
.
ConvertUsing
(
project
=>
project
.
ProjectInfo
);
...
...
PSManagement.Application/PSManagement.Application.csproj
View file @
510e4e47
...
@@ -24,4 +24,8 @@
...
@@ -24,4 +24,8 @@
<ProjectReference Include="..\PSManagement.SharedKernel\PSManagement.SharedKernel.csproj" />
<ProjectReference Include="..\PSManagement.SharedKernel\PSManagement.SharedKernel.csproj" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<Folder Include="Projects\UseCases\Queries\GetParticipationChangeHistory\" />
</ItemGroup>
</Project>
</Project>
PSManagement.Application/Projects/UseCases/Commands/CreateProject/CreateProjectCommandHandler.cs
View file @
510e4e47
...
@@ -37,7 +37,7 @@ namespace PSManagement.Application.Projects.UseCases.Commands.CreateProject
...
@@ -37,7 +37,7 @@ namespace PSManagement.Application.Projects.UseCases.Commands.CreateProject
var
type
=
await
_projectTypesRepository
.
GetByIdAsync
(
request
.
ProjectTypeId
);
var
type
=
await
_projectTypesRepository
.
GetByIdAsync
(
request
.
ProjectTypeId
);
if
(
type
is
null
)
{
if
(
type
is
null
)
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
return
Result
.
Invalid
(
Pr
o
jectTypesErrors
.
InvalidEntryError
);
}
}
Project
project
=
_projectBuilder
Project
project
=
_projectBuilder
...
...
PSManagement.Application/ProjectsTypes/Common/ProjectTypeDTO.cs
View file @
510e4e47
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
public
string
TypeName
{
get
;
set
;
}
public
string
TypeName
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
public
int
ExpectedEffort
{
get
;
set
;
}
public
int
ExpectedEffort
{
get
;
set
;
}
public
int
ExpectedNumberOfWorker
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
PSManagement.Application/ProjectsTypes/UseCases/Commands/CreateNewType/CreateNewTypeCommandHandler.cs
View file @
510e4e47
using
Ardalis.Result
;
using
Ardalis.Result
;
using
AutoMapper
;
using
AutoMapper
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.Domain.ProjectsTypes.Entites
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
System.Linq
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading
;
...
@@ -29,7 +29,7 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
...
@@ -29,7 +29,7 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
if
(
result
.
Count
()
!=
0
)
if
(
result
.
Count
()
!=
0
)
{
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidName
);
return
Result
.
Invalid
(
Pr
o
jectTypesErrors
.
InvalidName
);
}
}
var
projectType
=
await
_projectTypesRepository
.
AddAsync
(
_mapper
.
Map
<
ProjectType
>(
request
));
var
projectType
=
await
_projectTypesRepository
.
AddAsync
(
_mapper
.
Map
<
ProjectType
>(
request
));
...
...
PSManagement.Application/ProjectsTypes/UseCases/Commands/RemoveType/RemoveTypeCommandHandler.cs
View file @
510e4e47
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
using
AutoMapper
;
using
AutoMapper
;
using
PSManagement.Domain.Projects
;
using
PSManagement.Domain.Projects
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.Domain.ProjectsTypes.Entites
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
PSManagement.SharedKernel.Specification
;
using
PSManagement.SharedKernel.Specification
;
using
System.Threading
;
using
System.Threading
;
...
@@ -31,11 +31,11 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
...
@@ -31,11 +31,11 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
if
(
result
is
null
)
if
(
result
is
null
)
{
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
return
Result
.
Invalid
(
Pr
o
jectTypesErrors
.
InvalidEntryError
);
}
}
if
(
result
.
Projects
is
not
null
)
if
(
result
.
Projects
is
not
null
)
{
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
return
Result
.
Invalid
(
Pr
o
jectTypesErrors
.
InvalidEntryError
);
}
}
await
_projectTypesRepository
.
DeleteAsync
(
result
);
await
_projectTypesRepository
.
DeleteAsync
(
result
);
...
...
PSManagement.Application/ProjectsTypes/UseCases/Commands/UpdateType/UpdateTypeCommandHandler.cs
View file @
510e4e47
using
Ardalis.Result
;
using
Ardalis.Result
;
using
AutoMapper
;
using
AutoMapper
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.Domain.ProjectsTypes.Entites
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
System.Linq
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading
;
...
...
PSManagement.Application/ProjectsTypes/UseCases/Queries/GetProjectsTypes/GetProjectsTypesQueryHandler.cs
View file @
510e4e47
using
Ardalis.Result
;
using
Ardalis.Result
;
using
AutoMapper
;
using
AutoMapper
;
using
PSManagement.Application.ProjectsTypes.Common
;
using
PSManagement.Application.ProjectsTypes.Common
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.Domain.ProjectsTypes.Entites
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
PSManagement.SharedKernel.Specification
;
using
PSManagement.SharedKernel.Specification
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
...
PSManagement.Application/ProjectsTypes/UseCases/Queries/GetTypeById/GetTypeByIdQueryHandler.cs
View file @
510e4e47
...
@@ -25,12 +25,12 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Queries.GetTypeById
...
@@ -25,12 +25,12 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Queries.GetTypeById
public
async
Task
<
Result
<
ProjectTypeDTO
>>
Handle
(
GetTypeByIdQuery
request
,
CancellationToken
cancellationToken
)
public
async
Task
<
Result
<
ProjectTypeDTO
>>
Handle
(
GetTypeByIdQuery
request
,
CancellationToken
cancellationToken
)
{
{
var
result
=
await
_projectTypesRepository
.
ListAsync
(
);
var
result
=
await
_projectTypesRepository
.
GetByIdAsync
(
request
.
TypeId
);
if
(
result
is
null
)
if
(
result
is
null
)
{
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
return
Result
.
Invalid
(
Pr
o
jectTypesErrors
.
InvalidEntryError
);
}
}
return
Result
.
Success
(
_mapper
.
Map
<
ProjectTypeDTO
>(
result
));
;
return
Result
.
Success
(
_mapper
.
Map
<
ProjectTypeDTO
>(
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