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
c2f1792e
Commit
c2f1792e
authored
Aug 10, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADD CQRS for each domain
parent
bdff6c68
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
9 deletions
+79
-9
CustomerMapperConfiguration.cs
...ion/ApplicationDTOsMappers/CustomerMapperConfiguration.cs
+0
-0
IDateTimeProvider.cs
...ment.Application/Contracts/Providers/IDateTimeProvider.cs
+1
-0
IDepartmentsProvider.cs
...t.Application/Contracts/Providers/IDepartmentsProvider.cs
+10
-0
IEmployeesProvider.cs
...ent.Application/Contracts/Providers/IEmployeesProvider.cs
+14
-0
ISyncEmployeesService.cs
...t.Application/Contracts/SyncData/ISyncEmployeesService.cs
+18
-0
CreateCustomerCommandHandler.cs
...s/Commands/CreateCustomer/CreateCustomerCommandHandler.cs
+6
-3
PSManagement.Application.csproj
PSManagement.Application/PSManagement.Application.csproj
+29
-6
CreateProjectCommand.cs
...s/UseCases/Commands/CreateProject/CreateProjectCommand.cs
+1
-0
No files found.
PSManagement.Application/Mappers/CustomerMapperConfiguration.cs
→
PSManagement.Application/
ApplicationDTOs
Mappers/CustomerMapperConfiguration.cs
View file @
c2f1792e
File moved
PSManagement.Application/Contracts/Providers/IDateTimeProvider.cs
View file @
c2f1792e
...
...
@@ -10,4 +10,5 @@ namespace PSManagement.Application.Contracts.Providers
{
public
DateTime
UtcNow
{
get
;
}
}
}
PSManagement.Application/Contracts/Providers/IDepartmentsProvider.cs
0 → 100644
View file @
c2f1792e
using
PSManagement.Domain.Employees.Entities
;
using
System.Collections.Generic
;
namespace
PSManagement.Application.Contracts.Providers
{
public
interface
IDepartmentsProvider
{
public
ICollection
<
Department
>
FetchDepartments
();
}
}
PSManagement.Application/Contracts/Providers/IEmployeesProvider.cs
0 → 100644
View file @
c2f1792e
using
PSManagement.Domain.Employees.Entities
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.Contracts.Providers
{
public
interface
IEmployeesProvider
{
public
ICollection
<
Employee
>
FetchEmployees
();
}
}
PSManagement.Application/Contracts/SyncData/ISyncEmployeesService.cs
0 → 100644
View file @
c2f1792e
using
PSManagement.Application.Contracts.Providers
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.Contracts.SyncData
{
public
interface
ISyncEmployeesService
{
public
void
SyncEmployees
(
IEmployeesProvider
employeesProvider
);
}
public
interface
ISyncDepartmentsService
{
public
void
SyncEmployees
(
IEmployeesProvider
employeesProvider
);
}
}
PSManagement.Application/Customers/UseCases/Commands/CreateCustomer/CreateCustomerCommandHandler.cs
View file @
c2f1792e
...
...
@@ -5,6 +5,7 @@ using PSManagement.Domain.Customers.DomainEvents;
using
PSManagement.Domain.Customers.Repositories
;
using
PSManagement.Domain.Customers.ValueObjects
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
PSManagement.SharedKernel.Interfaces
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -17,10 +18,12 @@ namespace PSManagement.Application.Customers.UseCases.Commands.CreateCustomer
public
class
CreateCustomerCommandHandler
:
ICommandHandler
<
CreateCustomerCommand
,
Result
<
int
>>
{
private
readonly
ICustomersRepository
_customerRepository
;
public
CreateCustomerCommandHandler
(
ICustomersRepository
customerRepository
)
private
readonly
IUnitOfWork
_unitOfWork
;
public
CreateCustomerCommandHandler
(
ICustomersRepository
customerRepository
,
IUnitOfWork
unitOfWork
)
{
_customerRepository
=
customerRepository
;
_unitOfWork
=
unitOfWork
;
}
public
async
Task
<
Result
<
int
>>
Handle
(
CreateCustomerCommand
request
,
CancellationToken
cancellationToken
)
{
...
...
@@ -30,7 +33,7 @@ namespace PSManagement.Application.Customers.UseCases.Commands.CreateCustomer
customer
=
await
_customerRepository
.
AddAsync
(
customer
);
customer
.
AddDomainEvent
(
new
CutsomerCreatedEvent
(
customer
.
Id
,
customer
.
CustomerName
));
await
_unitOfWork
.
SaveChangesAsync
();
return
Result
.
Ok
(
customer
.
Id
);
}
...
...
PSManagement.Application/PSManagement.Application.csproj
View file @
c2f1792e
...
...
@@ -6,30 +6,53 @@
<ItemGroup>
<Folder Include="Behaviors\AuthorizationBehavior\" />
<Folder Include="Employees\UseCases\Commands\UpdateEmployeeWorkHours\" />
<Folder Include="Employees\UseCases\Queries\GetEmployeeWorkingHours\" />
<Folder Include="Employees\UseCases\Queries\GetEmployeeProjects\" />
<Folder Include="Employees\UseCases\Queries\GetAvailableEmployees\" />
<Folder Include="Employees\UseCases\Queries\GetEmployeeParticipations\" />
<Folder Include="FinancialSpending\UseCases\Commands\CreateFinancialSpendingItem\" />
<Folder Include="FinancialSpending\UseCases\Commands\" />
<Folder Include="FinancialSpending\UseCases\Commands\UpateFinancialSpendingItem\" />
<Folder Include="FinancialSpending\UseCases\Queries\GetFinancialSpendingByProject\" />
<Folder Include="FinancialSpending\UseCases\Queries\GetFinancialSpendingById\" />
<Folder Include="ProjectsStatus\UseCases\" />
<Folder Include="Projects\
UseCases\Commands\AddStep
\" />
<Folder Include="Projects\UseCases\Commands\Add
FinincialSpending
\" />
<Folder Include="Projects\
EventsHandlers
\" />
<Folder Include="Projects\UseCases\Commands\Add
ProjectPlan
\" />
<Folder Include="Projects\UseCases\Commands\AddParticipant\" />
<Folder Include="Projects\UseCases\Commands\ApproveProject\" />
<Folder Include="Projects\UseCases\Commands\ChangeProjectTeamLeader\" />
<Folder Include="Projects\UseCases\Commands\RemoveParticipant\" />
<Folder Include="Projects\UseCases\Commands\UpdateParticipant\" />
<Folder Include="Projects\UseCases\Commands\UpdateFinincialSpending\" />
<Folder Include="Projects\UseCases\Commands\UpdateProject\" />
<Folder Include="Projects\UseCases\Commands\AddAttachment\" />
<Folder Include="Projects\UseCases\Commands\UpdateStep\" />
<Folder Include="Projects\UseCases\Queries\ListAllProject\" />
<Folder Include="Projects\UseCases\Queries\GetProjectPlan\" />
<Folder Include="Projects\UseCases\Queries\GetProject\" />
<Folder Include="Projects\UseCases\Queries\GetProjectFinicialSpending\" />
<Folder Include="Projects\UseCases\Queries\GetParticipants\" />
<Folder Include="Reports\UseCases\" />
<Folder Include="Reports\UseCases\Queries\" />
<Folder Include="Steps\UseCases\Commands\ChangeStepWeight\" />
<Folder Include="Steps\UseCases\Commands\UpdateCompletionRatio\" />
<Folder Include="Steps\UseCases\Commands\UpdateStepRequiredWorkers\" />
<Folder Include="Steps\UseCases\Commands\RemoveStep\" />
<Folder Include="Steps\UseCases\Queries\GetStep\" />
<Folder Include="Steps\UseCases\Queries\GetStepHistory\" />
<Folder Include="Tracks\UseCaes\Commands\CreateTrack\" />
<Folder Include="Tracks\UseCaes\Commands\AddStepsTrack\" />
<Folder Include="Tracks\UseCaes\Commands\AddEmployeesTrack\" />
<Folder Include="Tracks\UseCaes\Commands\RemoveTrack\" />
<Folder Include="Tracks\UseCaes\Commands\SaveTrack\" />
<Folder Include="Tracks\UseCaes\Commands\UpdateEmployeeTrack\" />
<Folder Include="Tracks\UseCaes\Commands\UpdateStepTrack\" />
<Folder Include="Tracks\UseCaes\Commands\UpdateTrack\" />
<Folder Include="Tracks\UseCaes\Queries\
ListAll
\" />
<Folder Include="Tracks\UseCaes\Queries\GetTrack\" />
<Folder Include="Tracks\UseCaes\Queries\
GetTrackById
\" />
<Folder Include="Tracks\UseCaes\Queries\GetTrack
sByProject
\" />
<Folder Include="Tracks\UseCaes\Queries\GetPlanTrack\" />
<Folder Include="Tracks\UseCaes\Queries\GetEmployeesTrack\" />
<Folder Include="Tracks\UseCaes\Queries\GetEmployeeTrack\" />
<Folder Include="Tracks\UseCaes\Queries\GetStepTracks\" />
</ItemGroup>
<ItemGroup>
...
...
PSManagement.Application/Projects/UseCases/Commands/CreateProject/CreateProjectCommand.cs
View file @
c2f1792e
...
...
@@ -17,4 +17,5 @@ namespace PSManagement.Application.Projects.UseCases.Commands.CreateProject
int
ProjectManagerId
,
int
ProposerId
)
:
ICommand
<
Result
<
ProjectDTO
>>;
}
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