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
7403cb9a
Commit
7403cb9a
authored
Aug 26, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix overflow loop
parent
b68de4f1
Changes
20
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
2754 additions
and
66 deletions
+2754
-66
FinanialSpendingDTOMapperConfiguration.cs
...rsConfiguration/FinanialSpendingDTOMapperConfiguration.cs
+33
-0
MapperConfiguration.cs
...on/ApplicationMappersConfiguration/MapperConfiguration.cs
+2
-27
PSManagement.Application.csproj
PSManagement.Application/PSManagement.Application.csproj
+0
-4
EmployeeParticipateDTO.cs
...ent.Application/Projects/Common/EmployeeParticipateDTO.cs
+1
-0
ParticipationChangeDTO.cs
...ent.Application/Projects/Common/ParticipationChangeDTO.cs
+19
-0
ChangeRegisterationOnParticipationChangedEventHandler.cs
.../ChangeRegisterationOnParticipationChangedEventHandler.cs
+0
-2
NotifieParticipantOnParticipationChangedEventHandler.cs
...s/NotifieParticipantOnParticipationChangedEventHandler.cs
+2
-0
GetParticipationChangeHistoryQuery.cs
...pationChangeHistory/GetParticipationChangeHistoryQuery.cs
+13
-0
GetParticipationChangeHistoryQueryHandler.cs
...hangeHistory/GetParticipationChangeHistoryQueryHandler.cs
+38
-0
ProjectDetailsResponse.cs
...ent.Contracts/Projects/Response/ProjectDetailsResponse.cs
+1
-1
ProjectResponse.cs
PSManagement.Contracts/Projects/Response/ProjectResponse.cs
+20
-2
ProjectEntityConfiguration.cs
...tence/EntitiesConfiguration/ProjectEntityConfiguration.cs
+8
-8
StepEntityConfiguration.cs
...sistence/EntitiesConfiguration/StepEntityConfiguration.cs
+1
-0
20240826112513_AddParticipationHistory1.Designer.cs
...tions/20240826112513_AddParticipationHistory1.Designer.cs
+1260
-0
20240826112513_AddParticipationHistory1.cs
...nce/Migrations/20240826112513_AddParticipationHistory1.cs
+51
-0
20240826115310_AddParticipationHistory2.Designer.cs
...tions/20240826115310_AddParticipationHistory2.Designer.cs
+1261
-0
20240826115310_AddParticipationHistory2.cs
...nce/Migrations/20240826115310_AddParticipationHistory2.cs
+23
-0
AppDbContextModelSnapshot.cs
...cture.Persistence/Migrations/AppDbContextModelSnapshot.cs
+8
-9
AuthenticationController.cs
...on/Controllers/Authentication/AuthenticationController.cs
+2
-13
ProjectsController.cs
...t.Presentation/Controllers/Projects/ProjectsController.cs
+11
-0
No files found.
PSManagement.Application/ApplicationMappersConfiguration/FinanialSpendingDTOMapperConfiguration.cs
0 → 100644
View file @
7403cb9a
using
AutoMapper
;
using
PSManagement.Application.FinancialSpends.Common
;
using
PSManagement.Application.FinancialSpends.UseCases.Commands.CreateFinancialSpendItem
;
using
PSManagement.Domain.FinancialSpends.Entities
;
namespace
PSManagement.Application.Mappers
{
public
class
FinanialSpendingDTOMapperConfiguration
:
Profile
{
public
FinanialSpendingDTOMapperConfiguration
()
{
CreateMap
<
FinancialSpendingDTO
,
FinancialSpending
>().
ReverseMap
();
CreateMap
<
CreateFinancialSpendItemCommand
,
FinancialSpending
>()
.
ForMember
(
d
=>
d
.
Id
,
op
=>
op
.
Ignore
())
.
ForMember
(
d
=>
d
.
Events
,
op
=>
op
.
Ignore
())
.
ConstructUsing
(
src
=>
new
FinancialSpending
(
src
.
ProjectId
,
src
.
LocalPurchase
,
src
.
ExternalPurchase
,
src
.
CostType
,
src
.
Description
,
src
.
ExpectedSpendingDate
))
;
}
}
}
PSManagement.Application/ApplicationMappersConfiguration/MapperConfiguration.cs
View file @
7403cb9a
...
...
@@ -2,8 +2,6 @@
using
PSManagement.Application.Contracts.Authentication
;
using
PSManagement.Application.Customers.Common
;
using
PSManagement.Application.Employees.Common
;
using
PSManagement.Application.FinancialSpends.Common
;
using
PSManagement.Application.FinancialSpends.UseCases.Commands.CreateFinancialSpendItem
;
using
PSManagement.Application.Projects.Common
;
using
PSManagement.Application.Projects.UseCases.Commands.CompleteProgressProject
;
using
PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
;
...
...
@@ -16,7 +14,6 @@ using PSManagement.Application.Tracks.UseCaes.Commands.CreateTrack;
using
PSManagement.Domain.Customers.Entities
;
using
PSManagement.Domain.Customers.ValueObjects
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.FinancialSpends.Entities
;
using
PSManagement.Domain.Identity.Entities
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.ValueObjects
;
...
...
@@ -91,32 +88,10 @@ namespace PSManagement.Application.Mappers
CreateMap
<
CreateNewTypeCommand
,
ProjectType
>();
CreateMap
<
UpdateTypeCommand
,
ProjectType
>();
CreateMap
<
CompleteProjectCommand
,
ProjectCompletion
>();
}
}
public
class
FinanialSpendingDTOMapperConfiguration
:
Profile
{
CreateMap
<
ParticipationChange
,
ParticipationChangeDTO
>().
ReverseMap
();
public
FinanialSpendingDTOMapperConfiguration
()
{
CreateMap
<
FinancialSpendingDTO
,
FinancialSpending
>().
ReverseMap
();
CreateMap
<
CreateFinancialSpendItemCommand
,
FinancialSpending
>()
.
ForMember
(
d
=>
d
.
Id
,
op
=>
op
.
Ignore
())
.
ForMember
(
d
=>
d
.
Events
,
op
=>
op
.
Ignore
())
.
ConstructUsing
(
src
=>
new
FinancialSpending
(
src
.
ProjectId
,
src
.
LocalPurchase
,
src
.
ExternalPurchase
,
src
.
CostType
,
src
.
Description
,
src
.
ExpectedSpendingDate
))
;
CreateMap
<
CompleteProjectCommand
,
ProjectCompletion
>();
}
}
...
...
PSManagement.Application/PSManagement.Application.csproj
View file @
7403cb9a
...
...
@@ -24,8 +24,4 @@
<ProjectReference Include="..\PSManagement.SharedKernel\PSManagement.SharedKernel.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Projects\UseCases\Queries\GetParticipationChangeHistory\" />
</ItemGroup>
</Project>
PSManagement.Application/Projects/Common/EmployeeParticipateDTO.cs
View file @
7403cb9a
...
...
@@ -12,4 +12,5 @@ namespace PSManagement.Application.Projects.Common
public
int
PartialTimeRatio
{
get
;
set
;
}
public
string
Role
{
get
;
set
;
}
}
}
\ No newline at end of file
PSManagement.Application/Projects/Common/ParticipationChangeDTO.cs
0 → 100644
View file @
7403cb9a
using
System
;
namespace
PSManagement.Application.Projects.Common
{
public
class
ParticipationChangeDTO
{
public
int
EmployeeId
{
get
;
set
;
}
public
int
ProjectId
{
get
;
set
;
}
public
int
PartialTimeBefore
{
get
;
set
;
}
public
int
PartialTimeAfter
{
get
;
set
;
}
public
string
RoleBefore
{
get
;
set
;
}
public
string
RoleAfter
{
get
;
set
;
}
public
DateTime
ChangeDate
{
get
;
set
;
}
}
}
\ No newline at end of file
PSManagement.Application/Projects/EventsHandlers/ChangeRegisterationOnParticipationChangedEventHandler.cs
View file @
7403cb9a
...
...
@@ -35,8 +35,6 @@ namespace PSManagement.Application.Projects.EventsHandlers
});
await
_unitOfWork
.
SaveChangesAsync
();
}
}
...
...
PSManagement.Application/Projects/EventsHandlers/NotifieParticipantOnParticipationChangedEventHandler.cs
View file @
7403cb9a
using
PSManagement.Application.Contracts.Email
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.Employees.Repositories
;
using
PSManagement.Domain.Employees.Specification
;
using
PSManagement.Domain.Projects.DomainEvents
;
using
PSManagement.SharedKernel.DomainEvents
;
using
PSManagement.SharedKernel.Specification
;
...
...
@@ -19,6 +20,7 @@ namespace PSManagement.Application.Projects.EventsHandlers
{
_emailService
=
emailService
;
_employeeRepository
=
employeeRepository
;
_specification
=
new
EmployeesSpecification
();
}
public
async
Task
Handle
(
ParticipationChangedEvent
notification
,
CancellationToken
cancellationToken
)
...
...
PSManagement.Application/Projects/UseCases/Queries/GetParticipationChangeHistory/GetParticipationChangeHistoryQuery.cs
0 → 100644
View file @
7403cb9a
using
Ardalis.Result
;
using
PSManagement.Application.Projects.Common
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
PSManagement.SharedKernel.Specification
;
using
System.Collections.Generic
;
namespace
PSManagement.Application.Projects.UseCases.Queries.GetParticipationChangeHistory
{
public
record
GetParticipationChangeHistoryQuery
(
int
ProjectId
)
:
IQuery
<
Result
<
IEnumerable
<
ParticipationChangeDTO
>>>;
}
PSManagement.Application/Projects/UseCases/Queries/GetParticipationChangeHistory/GetParticipationChangeHistoryQueryHandler.cs
0 → 100644
View file @
7403cb9a
using
Ardalis.Result
;
using
AutoMapper
;
using
PSManagement.Application.Projects.Common
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
PSManagement.SharedKernel.Repositories
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.Projects.UseCases.Queries.GetParticipationChangeHistory
{
public
class
GetParticipationChangeHistoryQueryHandler
:
IQueryHandler
<
GetParticipationChangeHistoryQuery
,
Result
<
IEnumerable
<
ParticipationChangeDTO
>>>
{
private
readonly
IRepository
<
ParticipationChange
>
_repository
;
private
readonly
IMapper
_mapper
;
public
GetParticipationChangeHistoryQueryHandler
(
IMapper
mapper
,
IRepository
<
ParticipationChange
>
repository
)
{
_mapper
=
mapper
;
_repository
=
repository
;
}
public
async
Task
<
Result
<
IEnumerable
<
ParticipationChangeDTO
>>>
Handle
(
GetParticipationChangeHistoryQuery
request
,
CancellationToken
cancellationToken
)
{
var
result
=
await
_repository
.
ListAsync
();
result
=
result
.
Where
(
e
=>
e
.
ProjectId
==
request
.
ProjectId
);
return
Result
.
Success
(
_mapper
.
Map
<
IEnumerable
<
ParticipationChangeDTO
>>(
result
));
}
}
}
PSManagement.Contracts/Projects/Response/ProjectDetailsResponse.cs
View file @
7403cb9a
...
...
@@ -15,7 +15,7 @@ namespace PSManagement.Contracts.Projects.Response
public
ProjectClassification
ProjectClassification
{
get
;
set
;
}
public
EmployeeResponse
TeamLeader
{
get
;
set
;
}
public
EmployeeResponse
ProjectManager
{
get
;
set
;
}
public
Department
Executer
{
get
;
set
;
}
public
Department
Response
Executer
{
get
;
set
;
}
public
CustomerResponse
Proposer
{
get
;
set
;
}
...
...
PSManagement.Contracts/Projects/Response/ProjectResponse.cs
View file @
7403cb9a
using
PSManagement.Contracts.Customers.Responses
;
using
PSManagement.Application.Projects.Common
;
using
PSManagement.Contracts.Customers.Responses
;
using
PSManagement.Contracts.ProjectsTypes.Request
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.ValueObjects
;
using
System
;
using
System.Collections.Generic
;
namespace
PSManagement.Contracts.Projects.Response
...
...
@@ -28,7 +30,7 @@ namespace PSManagement.Contracts.Projects.Response
public
int
ProposerId
{
get
;
private
set
;
}
public
CustomerResponse
Proposer
{
get
;
set
;
}
public
ICollection
<
StepResponse
>
Steps
{
get
;
set
;
}
public
ICollection
<
Attachment
>
Attachments
{
get
;
set
;
}
public
ICollection
<
Attachment
Reponse
>
Attachments
{
get
;
set
;
}
public
FinancialFund
FinancialFund
{
get
;
set
;
}
public
ICollection
<
FinancialSpendingResponse
>
FinancialSpending
{
get
;
set
;
}
...
...
@@ -36,4 +38,20 @@ namespace PSManagement.Contracts.Projects.Response
public
ICollection
<
EmployeeParticipateResponse
>
EmployeeParticipates
{
get
;
set
;
}
}
public
class
ParticipationChange
{
public
int
EmployeeId
{
get
;
set
;
}
public
int
ProjectId
{
get
;
set
;
}
public
int
PartialTimeBefore
{
get
;
set
;
}
public
int
PartialTimeAfter
{
get
;
set
;
}
public
string
RoleBefore
{
get
;
set
;
}
public
string
RoleAfter
{
get
;
set
;
}
public
DateTime
ChangeDate
{
get
;
set
;
}
}
}
PSManagement.Infrastructure.Persistence/EntitiesConfiguration/ProjectEntityConfiguration.cs
View file @
7403cb9a
...
...
@@ -100,17 +100,17 @@ namespace PSManagement.Infrastructure.Persistence.EntitiesConfiguration
}
public
class
p
articipationChangesConfiguration
:
IEntityTypeConfiguration
<
ParticipationChange
>
public
class
P
articipationChangesConfiguration
:
IEntityTypeConfiguration
<
ParticipationChange
>
{
public
void
Configure
(
EntityTypeBuilder
<
ParticipationChange
>
builder
)
{
builder
.
HasOne
(
e
=>
e
.
Employee
)
.
WithOne
();
builder
.
HasOne
(
e
=>
e
.
Project
)
.
WithOne
()
;
//
builder
// .HasO
(e => e.Employee)
// .WithMany
();
//
builder
//
.HasOne(e => e.Project)
//
.WithOne()
//
;
}
}
...
...
PSManagement.Infrastructure.Persistence/EntitiesConfiguration/StepEntityConfiguration.cs
View file @
7403cb9a
...
...
@@ -18,6 +18,7 @@ namespace PSManagement.Infrastructure.Persistence.EntitiesConfiguration
p
.
Property
(
e
=>
e
.
StepName
).
HasColumnName
(
"StepName"
);
p
.
Property
(
e
=>
e
.
StartDate
).
HasColumnName
(
"StartDate"
);
p
.
Property
(
e
=>
e
.
Duration
).
HasColumnName
(
"Duration"
);
p
.
Property
(
e
=>
e
.
NumberOfWorker
).
HasColumnName
(
"NumberOfWorker"
);
}
);
...
...
PSManagement.Infrastructure.Persistence/Migrations/20240826112513_AddParticipationHistory1.Designer.cs
0 → 100644
View file @
7403cb9a
This diff is collapsed.
Click to expand it.
PSManagement.Infrastructure.Persistence/Migrations/20240826112513_AddParticipationHistory1.cs
0 → 100644
View file @
7403cb9a
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
public
partial
class
AddParticipationHistory1
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropIndex
(
name
:
"IX_ParticipationChanges_EmployeeId"
,
table
:
"ParticipationChanges"
);
migrationBuilder
.
DropIndex
(
name
:
"IX_ParticipationChanges_ProjectId"
,
table
:
"ParticipationChanges"
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_ParticipationChanges_EmployeeId"
,
table
:
"ParticipationChanges"
,
column
:
"EmployeeId"
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_ParticipationChanges_ProjectId"
,
table
:
"ParticipationChanges"
,
column
:
"ProjectId"
);
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropIndex
(
name
:
"IX_ParticipationChanges_EmployeeId"
,
table
:
"ParticipationChanges"
);
migrationBuilder
.
DropIndex
(
name
:
"IX_ParticipationChanges_ProjectId"
,
table
:
"ParticipationChanges"
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_ParticipationChanges_EmployeeId"
,
table
:
"ParticipationChanges"
,
column
:
"EmployeeId"
,
unique
:
true
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_ParticipationChanges_ProjectId"
,
table
:
"ParticipationChanges"
,
column
:
"ProjectId"
,
unique
:
true
);
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/20240826115310_AddParticipationHistory2.Designer.cs
0 → 100644
View file @
7403cb9a
This diff is collapsed.
Click to expand it.
PSManagement.Infrastructure.Persistence/Migrations/20240826115310_AddParticipationHistory2.cs
0 → 100644
View file @
7403cb9a
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
public
partial
class
AddParticipationHistory2
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
RenameColumn
(
name
:
"StepInfo_NumberOfWorker"
,
table
:
"Steps"
,
newName
:
"NumberOfWorker"
);
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
RenameColumn
(
name
:
"NumberOfWorker"
,
table
:
"Steps"
,
newName
:
"StepInfo_NumberOfWorker"
);
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/AppDbContextModelSnapshot.cs
View file @
7403cb9a
...
...
@@ -329,11 +329,9 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"EmployeeId"
)
.
IsUnique
();
b
.
HasIndex
(
"EmployeeId"
);
b
.
HasIndex
(
"ProjectId"
)
.
IsUnique
();
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"ParticipationChanges"
);
});
...
...
@@ -776,14 +774,14 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.ParticipationChange"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"Employee"
)
.
With
One
()
.
HasForeignKey
(
"
PSManagement.Domain.Projects.Entities.ParticipationChange"
,
"
EmployeeId"
)
.
With
Many
()
.
HasForeignKey
(
"EmployeeId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
"Project"
)
.
With
One
()
.
HasForeignKey
(
"P
SManagement.Domain.Projects.Entities.ParticipationChange"
,
"P
rojectId"
)
.
With
Many
()
.
HasForeignKey
(
"ProjectId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
...
...
@@ -1013,7 +1011,8 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
.
HasColumnName
(
"Duration"
);
b1
.
Property
<
int
>(
"NumberOfWorker"
)
.
HasColumnType
(
"int"
);
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"NumberOfWorker"
);
b1
.
Property
<
DateTime
>(
"StartDate"
)
.
HasColumnType
(
"datetime2"
)
...
...
PSManagement.Presentation/Controllers/Authentication/AuthenticationController.cs
View file @
7403cb9a
...
...
@@ -40,19 +40,8 @@ namespace PSManagement.Presentation.Controllers.Authentication
registerRequest
.
Email
,
registerRequest
.
Password
);
if
(
result
.
IsSuccess
)
{
AuthenticationResponse
response
=
new
(
result
.
Value
.
EmployeeId
,
result
.
Value
.
FirstName
,
result
.
Value
.
LastName
,
result
.
Value
.
Email
,
result
.
Value
.
Roles
,
result
.
Value
.
Token
);
return
Ok
(
response
);
}
return
HandleResult
(
_mapper
.
Map
<
Result
<
AuthenticationResponse
>>(
result
));
return
Problem
(
title
:
"An Errorr Occured "
,
detail
:
""
,
statusCode
:
400
);
}
}
...
...
PSManagement.Presentation/Controllers/Projects/ProjectsController.cs
View file @
7403cb9a
...
...
@@ -24,6 +24,7 @@ using PSManagement.Application.Contracts.Providers;
using
PSManagement.Application.Projects.UseCases.Commands.CancelProject
;
using
PSManagement.Application.Projects.UseCases.Commands.ChangeProjectManager
;
using
PSManagement.Presentation.Controllers.ApiBase
;
using
PSManagement.Application.Projects.UseCases.Queries.GetParticipationChangeHistory
;
namespace
PSManagement.Presentation.Controllers.Projects
{
...
...
@@ -57,6 +58,16 @@ namespace PSManagement.Presentation.Controllers.Projects
return
HandleResult
(
result
);
}
[
HttpGet
(
"ParticipationChangeHistory"
)]
public
async
Task
<
IActionResult
>
GetPartiipationChangesHistory
(
int
id
)
{
var
query
=
new
GetParticipationChangeHistoryQuery
(
id
);
var
result
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
_mapper
.
Map
<
Result
<
IEnumerable
<
ParticipationChange
>>>(
result
));
}
[
HttpGet
(
"ByFilter"
)]
public
async
Task
<
IActionResult
>
GetByFilter
([
FromQuery
]
GetProjectsByFilterRequest
request
)
...
...
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