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
e12a00a8
Commit
e12a00a8
authored
Aug 24, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tracking naming issue
parent
a2769352
Changes
37
Show whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
1406 additions
and
37 deletions
+1406
-37
CustomersController.cs
...nagement.Api/Controllers/Customers/CustomersController.cs
+3
-3
FinancialSpendsController.cs
.../Controllers/FinancialSpends/FinancialSpendsController.cs
+2
-2
ProjectsController.cs
PSManagement.Api/Controllers/Projects/ProjectsController.cs
+3
-3
StepsController.cs
PSManagement.Api/Controllers/Steps/StepsController.cs
+3
-3
TracksController.cs
PSManagement.Api/Controllers/Tracks/TracksController.cs
+4
-2
CustomerMapperConfiguration.cs
PSManagement.Api/Mappers/CustomerMapperConfiguration.cs
+5
-1
MapperConfiguration.cs
...Application/ApplicationDTOsMappers/MapperConfiguration.cs
+6
-2
EmployeeDTO.cs
PSManagement.Application/Employees/Common/EmployeeDTO.cs
+2
-0
GetAvailableEmployeesQueryHandler.cs
...etAvailableEmployees/GetAvailableEmployeesQueryHandler.cs
+1
-1
GetEmployeeByIdQueryHandler.cs
...es/Queries/GetEmployeeById/GetEmployeeByIdQueryHandler.cs
+2
-0
GetEmployeeParticipationQueryHandler.cs
...yeeParticipations/GetEmployeeParticipationQueryHandler.cs
+2
-1
GetEmployeeTrackHistoryQueryHandler.cs
...ployeeTrackHistory/GetEmployeeTrackHistoryQueryHandler.cs
+3
-1
GetEmployeesByFilterQuery.cs
...Queries/GetEmployeesByFilter/GetEmployeesByFilterQuery.cs
+1
-0
GetEmployeesByFilterQueryHandler.cs
.../GetEmployeesByFilter/GetEmployeesByFilterQueryHandler.cs
+5
-0
AddProjectStepCommandHandler.cs
...s/Commands/AddProjectStep/AddProjectStepCommandHandler.cs
+1
-1
GetProjectByIdQueryHandler.cs
...ases/Queries/GetProjectById/GetProjectByIdQueryHandler.cs
+2
-2
EmployeeTrackDTO.cs
PSManagement.Application/Tracks/Common/EmployeeTrackDTO.cs
+2
-0
TrackDTO.cs
PSManagement.Application/Tracks/Common/TrackDTO.cs
+2
-1
AddEmployeeTrackCommandHandler.cs
...mmands/AddEmployeeTrack/AddEmployeeTrackCommandHandler.cs
+4
-2
AddStepTrackCommand.cs
...acks/UseCaes/Commands/AddStepTrack/AddStepTrackCommand.cs
+0
-1
UpdateEmployeeWorkTrackCommandHandler.cs
...mployeeWorkTrack/UpdateEmployeeWorkTrackCommandHandler.cs
+1
-1
GetTracksByProjectQueryHandler.cs
...ries/GetTracksByProject/GetTracksByProjectQueryHandler.cs
+2
-1
GetEmployeesByFilterRequest.cs
...ntracts/Employees/Requests/GetEmployeesByFilterRequest.cs
+1
-0
EmployeeParticipateResponse.cs
...ntracts/Employees/Response/EmployeeParticipateResponse.cs
+3
-0
EmployeeResponse.cs
...nagement.Contracts/Employees/Response/EmployeeResponse.cs
+1
-0
GetProjectsByProjectManagerRequest.cs
...s/Projects/Requests/GetProjectsByProjectManagerRequest.cs
+1
-1
ProjectDetailsResponse.cs
...ent.Contracts/Projects/Response/ProjectDetailsResponse.cs
+1
-0
ProjectResponse.cs
PSManagement.Contracts/Projects/Response/ProjectResponse.cs
+1
-0
AddStepTrackRequest.cs
...nagement.Contracts/Tracks/Requests/AddStepTrackRequest.cs
+0
-1
EmployeeTrackResponse.cs
...gement.Contracts/Tracks/Response/EmployeeTrackResponse.cs
+2
-0
TrackResponse.cs
PSManagement.Contracts/Tracks/Response/TrackResponse.cs
+4
-1
Step.cs
PSManagement.Domain/Projects/Entities/Step.cs
+2
-1
EmployeeTrack.cs
PSManagement.Domain/Tracking/Entities/EmployeeTrack.cs
+1
-1
TrackEntityConfiguration.cs
...istence/EntitiesConfiguration/TrackEntityConfiguration.cs
+1
-1
20240824174450_FixTrackNaming.Designer.cs
...ence/Migrations/20240824174450_FixTrackNaming.Designer.cs
+1272
-0
20240824174450_FixTrackNaming.cs
...e.Persistence/Migrations/20240824174450_FixTrackNaming.cs
+57
-0
AppDbContextModelSnapshot.cs
...cture.Persistence/Migrations/AppDbContextModelSnapshot.cs
+3
-3
No files found.
PSManagement.Api/Controllers/Customers/CustomersController.cs
View file @
e12a00a8
...
@@ -81,10 +81,10 @@ namespace PSManagement.Api.Controllers.Customers
...
@@ -81,10 +81,10 @@ namespace PSManagement.Api.Controllers.Customers
}
}
[
HttpDelete
]
[
HttpDelete
(
"{id}"
)
]
public
async
Task
<
IActionResult
>
Delete
(
DeleteCustomerRequest
request
)
public
async
Task
<
IActionResult
>
Delete
(
int
id
)
{
{
var
command
=
_mapper
.
Map
<
DeleteCustomerCommand
>(
request
);
var
command
=
new
DeleteCustomerCommand
(
id
);
var
result
=
await
_sender
.
Send
(
command
);
var
result
=
await
_sender
.
Send
(
command
);
...
...
PSManagement.Api/Controllers/FinancialSpends/FinancialSpendsController.cs
View file @
e12a00a8
...
@@ -66,7 +66,7 @@ namespace PSManagement.Api.Controllers.FinancialSpends
...
@@ -66,7 +66,7 @@ namespace PSManagement.Api.Controllers.FinancialSpends
return
HandleResult
(
_mapper
.
Map
<
Result
<
FinancialSpendingResponse
>>(
result
));
;
return
HandleResult
(
_mapper
.
Map
<
Result
<
FinancialSpendingResponse
>>(
result
));
;
}
}
[
HttpGet
(
"
Get
ByProject"
)]
[
HttpGet
(
"ByProject"
)]
public
async
Task
<
IActionResult
>
GetByProject
([
FromQuery
]
GetFinancialSpendItemByProjecRequest
request
)
public
async
Task
<
IActionResult
>
GetByProject
([
FromQuery
]
GetFinancialSpendItemByProjecRequest
request
)
{
{
var
query
=
_mapper
.
Map
<
GetFinancialSpendItemByProjectQuery
>(
request
);
var
query
=
_mapper
.
Map
<
GetFinancialSpendItemByProjectQuery
>(
request
);
...
@@ -77,7 +77,7 @@ namespace PSManagement.Api.Controllers.FinancialSpends
...
@@ -77,7 +77,7 @@ namespace PSManagement.Api.Controllers.FinancialSpends
}
}
[
HttpDelete
(
"{id}"
)]
[
HttpDelete
(
"{id}"
)]
public
async
Task
<
IActionResult
>
Delete
(
RemoveFinancialSpendItemRequest
request
,[
FromRoute
]
int
id
)
public
async
Task
<
IActionResult
>
Delete
(
[
FromQuery
]
RemoveFinancialSpendItemRequest
request
,[
FromRoute
]
int
id
)
{
{
if
(
id
!=
request
.
Id
)
{
if
(
id
!=
request
.
Id
)
{
Result
.
Conflict
();
Result
.
Conflict
();
...
...
PSManagement.Api/Controllers/Projects/ProjectsController.cs
View file @
e12a00a8
...
@@ -52,7 +52,7 @@ namespace PSManagement.Api.Controllers.Projects
...
@@ -52,7 +52,7 @@ namespace PSManagement.Api.Controllers.Projects
{
{
var
query
=
_mapper
.
Map
<
ListAllProjectsQuery
>(
request
);
var
query
=
_mapper
.
Map
<
ListAllProjectsQuery
>(
request
);
var
result
=
_mapper
.
Map
<
Result
<
IEnumerable
<
ProjectResponse
>>>(
await
_sender
.
Send
(
query
));
var
result
=
_mapper
.
Map
<
Result
<
IEnumerable
<
Project
Details
Response
>>>(
await
_sender
.
Send
(
query
));
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
...
@@ -65,7 +65,7 @@ namespace PSManagement.Api.Controllers.Projects
...
@@ -65,7 +65,7 @@ namespace PSManagement.Api.Controllers.Projects
var
result
=
await
_sender
.
Send
(
query
);
var
result
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
_mapper
.
Map
<
Result
<
IEnumerable
<
ProjectResponse
>>>(
result
));
return
HandleResult
(
_mapper
.
Map
<
Result
<
IEnumerable
<
Project
Details
Response
>>>(
result
));
}
}
[
HttpGet
(
"ByProjectManager"
)]
[
HttpGet
(
"ByProjectManager"
)]
...
@@ -75,7 +75,7 @@ namespace PSManagement.Api.Controllers.Projects
...
@@ -75,7 +75,7 @@ namespace PSManagement.Api.Controllers.Projects
var
result
=
await
_sender
.
Send
(
query
);
var
result
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
_mapper
.
Map
<
Result
<
IEnumerable
<
ProjectResponse
>>>(
result
));
return
HandleResult
(
_mapper
.
Map
<
Result
<
IEnumerable
<
Project
Details
Response
>>>(
result
));
}
}
[
HttpGet
(
"GetParticipants/{id}"
)]
[
HttpGet
(
"GetParticipants/{id}"
)]
...
...
PSManagement.Api/Controllers/Steps/StepsController.cs
View file @
e12a00a8
...
@@ -51,7 +51,7 @@ namespace PSManagement.Api.Controllers.Steps
...
@@ -51,7 +51,7 @@ namespace PSManagement.Api.Controllers.Steps
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
[
HttpPut
(
"{id}"
)]
[
HttpPut
(
"
ChangeStepWeight/
{id}"
)]
public
async
Task
<
IActionResult
>
PutChangeStepWeight
(
ChangeStepWeightRequest
request
,[
FromRoute
]
int
id
)
public
async
Task
<
IActionResult
>
PutChangeStepWeight
(
ChangeStepWeightRequest
request
,[
FromRoute
]
int
id
)
{
{
if
(
request
.
StepId
!=
id
)
{
if
(
request
.
StepId
!=
id
)
{
...
@@ -75,7 +75,7 @@ namespace PSManagement.Api.Controllers.Steps
...
@@ -75,7 +75,7 @@ namespace PSManagement.Api.Controllers.Steps
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
[
HttpPut
]
[
HttpPut
(
"ChangeCompletionRatio/{id}"
)
]
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
);
...
@@ -90,7 +90,7 @@ namespace PSManagement.Api.Controllers.Steps
...
@@ -90,7 +90,7 @@ namespace PSManagement.Api.Controllers.Steps
{
{
var
query
=
new
RemoveStepCommand
(
id
);
var
query
=
new
RemoveStepCommand
(
id
);
var
result
=
_mapper
.
Map
<
Result
>(
await
_sender
.
Send
(
query
)
);
var
result
=
await
_sender
.
Send
(
query
);
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
...
...
PSManagement.Api/Controllers/Tracks/TracksController.cs
View file @
e12a00a8
...
@@ -44,7 +44,7 @@ namespace PSManagement.Api.Controllers.Tracks
...
@@ -44,7 +44,7 @@ namespace PSManagement.Api.Controllers.Tracks
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
[
HttpGet
(
"GetStepsTrack{id}"
)]
[
HttpGet
(
"GetStepsTrack
/
{id}"
)]
public
async
Task
<
IActionResult
>
GetStepsTrack
([
FromRoute
]
int
id
)
public
async
Task
<
IActionResult
>
GetStepsTrack
([
FromRoute
]
int
id
)
{
{
var
query
=
new
GetStepsTrackQuery
(
id
);
var
query
=
new
GetStepsTrackQuery
(
id
);
...
@@ -54,7 +54,7 @@ namespace PSManagement.Api.Controllers.Tracks
...
@@ -54,7 +54,7 @@ namespace PSManagement.Api.Controllers.Tracks
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
[
HttpGet
(
"GetEmployeesTrack{id}"
)]
[
HttpGet
(
"GetEmployeesTrack
/
{id}"
)]
public
async
Task
<
IActionResult
>
GetEmployeesTrack
([
FromRoute
]
int
id
)
public
async
Task
<
IActionResult
>
GetEmployeesTrack
([
FromRoute
]
int
id
)
{
{
var
query
=
new
GetEmployeesTrackQuery
(
id
);
var
query
=
new
GetEmployeesTrackQuery
(
id
);
...
@@ -148,6 +148,8 @@ namespace PSManagement.Api.Controllers.Tracks
...
@@ -148,6 +148,8 @@ namespace PSManagement.Api.Controllers.Tracks
return
HandleResult
(
result
);
return
HandleResult
(
result
);
}
}
[
HttpPut
(
"UpdateStepTrack"
)]
[
HttpPut
(
"UpdateStepTrack"
)]
public
async
Task
<
IActionResult
>
PutStepTrack
(
UpdateStepTrackRequest
request
)
public
async
Task
<
IActionResult
>
PutStepTrack
(
UpdateStepTrackRequest
request
)
{
{
...
...
PSManagement.Api/Mappers/CustomerMapperConfiguration.cs
View file @
e12a00a8
...
@@ -59,6 +59,10 @@ namespace PSManagement.Api.Mappers
...
@@ -59,6 +59,10 @@ namespace PSManagement.Api.Mappers
CreateMap
<
ChangeProjectTeamLeaderRequest
,
ChangeProjectTeamLeaderCommand
>().
ReverseMap
();
CreateMap
<
ChangeProjectTeamLeaderRequest
,
ChangeProjectTeamLeaderCommand
>().
ReverseMap
();
CreateMap
<
RemoveParticipantRequest
,
RemoveParticipantCommand
>().
ReverseMap
();
CreateMap
<
RemoveParticipantRequest
,
RemoveParticipantCommand
>().
ReverseMap
();
CreateMap
<
ProjectDTO
,
ProjectResponse
>().
ReverseMap
();
CreateMap
<
ProjectDTO
,
ProjectResponse
>().
ReverseMap
();
CreateMap
<
GetProjectsByProjectManagerRequest
,
GetProjectsByFilterQuery
>().
ConstructUsing
(
s
=>
new
GetProjectsByFilterQuery
(
null
,
null
,
null
,
null
,
s
.
ProjectManagerId
,
null
,
null
,
null
)
);
CreateMap
<
EmployeeResponse
,
EmployeeDTO
>().
ReverseMap
();
CreateMap
<
EmployeeResponse
,
EmployeeDTO
>().
ReverseMap
();
CreateMap
<
EmployeeParticipateResponse
,
EmployeeParticipateDTO
>().
ReverseMap
();
CreateMap
<
EmployeeParticipateResponse
,
EmployeeParticipateDTO
>().
ReverseMap
();
...
...
PSManagement.Application/ApplicationDTOsMappers/MapperConfiguration.cs
View file @
e12a00a8
...
@@ -37,7 +37,9 @@ namespace PSManagement.Application.Mappers
...
@@ -37,7 +37,9 @@ namespace PSManagement.Application.Mappers
;
;
CreateMap
<
Employee
,
EmployeeDTO
>()
CreateMap
<
Employee
,
EmployeeDTO
>()
.
ForMember
(
e
=>
e
.
DepartmentName
,
op
=>
op
.
MapFrom
(
e
=>
e
.
Department
.
Name
));
.
ForMember
(
e
=>
e
.
DepartmentName
,
op
=>
op
.
MapFrom
(
e
=>
e
.
Department
.
Name
))
.
ForMember
(
e
=>
e
.
Email
,
op
=>
op
.
MapFrom
(
e
=>
e
.
User
.
Email
))
;
CreateMap
<
EmployeeParticipate
,
EmployeeParticipateDTO
>()
CreateMap
<
EmployeeParticipate
,
EmployeeParticipateDTO
>()
...
@@ -56,7 +58,9 @@ namespace PSManagement.Application.Mappers
...
@@ -56,7 +58,9 @@ namespace PSManagement.Application.Mappers
CreateMap
<
Project
,
ProjectInfo
>()
CreateMap
<
Project
,
ProjectInfo
>()
.
ConvertUsing
(
project
=>
project
.
ProjectInfo
);
.
ConvertUsing
(
project
=>
project
.
ProjectInfo
);
CreateMap
<
Track
,
TrackDTO
>();
CreateMap
<
Track
,
TrackDTO
>()
.
ForMember
(
e
=>
e
.
ProjectInfo
,
op
=>
op
.
MapFrom
(
s
=>
s
.
Project
.
ProjectInfo
))
;
CreateMap
<
CreateTrackCommand
,
Track
>().
ReverseMap
();
CreateMap
<
CreateTrackCommand
,
Track
>().
ReverseMap
();
CreateMap
<
AddEmployeeTrackCommand
,
EmployeeTrack
>().
ReverseMap
();
CreateMap
<
AddEmployeeTrackCommand
,
EmployeeTrack
>().
ReverseMap
();
...
...
PSManagement.Application/Employees/Common/EmployeeDTO.cs
View file @
e12a00a8
...
@@ -12,6 +12,8 @@ namespace PSManagement.Application.Employees.Common
...
@@ -12,6 +12,8 @@ namespace PSManagement.Application.Employees.Common
public
int
Id
{
get
;
set
;
}
public
int
Id
{
get
;
set
;
}
public
int
HIASTId
{
get
;
set
;
}
public
int
HIASTId
{
get
;
set
;
}
public
int
UserId
{
get
;
set
;
}
public
int
UserId
{
get
;
set
;
}
public
string
Email
{
get
;
set
;
}
public
String
DepartmentName
{
get
;
set
;
}
public
String
DepartmentName
{
get
;
set
;
}
public
PersonalInfo
PersonalInfo
{
get
;
set
;
}
public
PersonalInfo
PersonalInfo
{
get
;
set
;
}
public
WorkInfo
WorkInfo
{
get
;
set
;
}
public
WorkInfo
WorkInfo
{
get
;
set
;
}
...
...
PSManagement.Application/Employees/UseCases/Queries/GetAvailableEmployees/GetAvailableEmployeesQueryHandler.cs
View file @
e12a00a8
...
@@ -33,7 +33,7 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetAvailableEmploy
...
@@ -33,7 +33,7 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetAvailableEmploy
int
pageSize
=
request
.
PageSize
.
HasValue
&&
request
.
PageSize
.
Value
>
0
&&
request
.
PageSize
.
Value
<=
30
?
request
.
PageSize
.
Value
:
30
;
int
pageSize
=
request
.
PageSize
.
HasValue
&&
request
.
PageSize
.
Value
>
0
&&
request
.
PageSize
.
Value
<=
30
?
request
.
PageSize
.
Value
:
30
;
_specification
.
ApplyPaging
((
pageNumber
-
1
)
*
pageSize
,
pageSize
);
_specification
.
ApplyPaging
((
pageNumber
-
1
)
*
pageSize
,
pageSize
);
_specification
.
AddInclude
(
e
=>
e
.
Department
);
_specification
.
AddInclude
(
e
=>
e
.
Department
);
_specification
.
AddInclude
(
e
=>
e
.
User
);
return
Result
.
Success
(
_mapper
.
Map
<
IEnumerable
<
EmployeeDTO
>>(
await
_employeesRepository
.
ListAsync
(
_specification
)));
return
Result
.
Success
(
_mapper
.
Map
<
IEnumerable
<
EmployeeDTO
>>(
await
_employeesRepository
.
ListAsync
(
_specification
)));
}
}
}
}
...
...
PSManagement.Application/Employees/UseCases/Queries/GetEmployeeById/GetEmployeeByIdQueryHandler.cs
View file @
e12a00a8
...
@@ -29,6 +29,8 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeeById
...
@@ -29,6 +29,8 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeeById
public
async
Task
<
Result
<
EmployeeDTO
>>
Handle
(
GetEmployeeByIdQuery
request
,
CancellationToken
cancellationToken
)
public
async
Task
<
Result
<
EmployeeDTO
>>
Handle
(
GetEmployeeByIdQuery
request
,
CancellationToken
cancellationToken
)
{
{
_specification
.
AddInclude
(
e
=>
e
.
Department
);
_specification
.
AddInclude
(
e
=>
e
.
Department
);
_specification
.
AddInclude
(
e
=>
e
.
User
);
return
Result
.
Success
(
_mapper
.
Map
<
EmployeeDTO
>(
await
_employeesRepository
.
GetByIdAsync
(
request
.
EmployeeId
,
_specification
)));
return
Result
.
Success
(
_mapper
.
Map
<
EmployeeDTO
>(
await
_employeesRepository
.
GetByIdAsync
(
request
.
EmployeeId
,
_specification
)));
}
}
}
}
...
...
PSManagement.Application/Employees/UseCases/Queries/GetEmployeeParticipations/GetEmployeeParticipationQueryHandler.cs
View file @
e12a00a8
...
@@ -35,12 +35,13 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeeById
...
@@ -35,12 +35,13 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeeById
_specification
.
ApplyPaging
((
pageNumber
-
1
)
*
pageSize
,
pageSize
);
_specification
.
ApplyPaging
((
pageNumber
-
1
)
*
pageSize
,
pageSize
);
_specification
.
AddInclude
(
e
=>
e
.
Project
);
_specification
.
AddInclude
(
e
=>
e
.
Project
);
_specification
.
AddInclude
(
"Employee.
Department
"
);
_specification
.
AddInclude
(
"Employee.
User
"
);
_specification
.
AddInclude
(
e
=>
e
.
Employee
);
_specification
.
AddInclude
(
e
=>
e
.
Employee
);
_specification
.
AddInclude
(
e
=>
e
.
Employee
.
Department
);
_specification
.
AddInclude
(
e
=>
e
.
Employee
.
Department
);
IEnumerable
<
EmployeeParticipate
>
response
=
await
_employeesParticipateRepository
.
ListAsync
(
_specification
);
IEnumerable
<
EmployeeParticipate
>
response
=
await
_employeesParticipateRepository
.
ListAsync
(
_specification
);
response
=
response
.
Where
(
e
=>
e
.
EmployeeId
==
request
.
EmployeeId
).
ToList
();
response
=
response
.
Where
(
e
=>
e
.
EmployeeId
==
request
.
EmployeeId
).
ToList
();
...
...
PSManagement.Application/Employees/UseCases/Queries/GetEmployeeTrackHistory/GetEmployeeTrackHistoryQueryHandler.cs
View file @
e12a00a8
...
@@ -34,7 +34,9 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeeTrackHi
...
@@ -34,7 +34,9 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeeTrackHi
int
pageSize
=
request
.
PageSize
.
HasValue
&&
request
.
PageSize
.
Value
>
0
&&
request
.
PageSize
.
Value
<=
30
?
request
.
PageSize
.
Value
:
30
;
int
pageSize
=
request
.
PageSize
.
HasValue
&&
request
.
PageSize
.
Value
>
0
&&
request
.
PageSize
.
Value
<=
30
?
request
.
PageSize
.
Value
:
30
;
_specification
.
AddInclude
(
e
=>
e
.
Track
);
_specification
.
AddInclude
(
e
=>
e
.
Track
);
_specification
.
AddInclude
(
e
=>
e
.
Employee
);
_specification
.
AddInclude
(
e
=>
e
.
Employee
);
_specification
.
Criteria
=
e
=>
e
.
EmloyeeId
==
request
.
EmployeeId
&&
e
.
Track
.
ProjectId
==
request
.
ProjectId
;
_specification
.
AddInclude
(
e
=>
e
.
Employee
.
User
);
_specification
.
Criteria
=
e
=>
e
.
EmployeeId
==
request
.
EmployeeId
&&
e
.
Track
.
ProjectId
==
request
.
ProjectId
;
_specification
.
ApplyPaging
((
pageNumber
-
1
)
*
pageSize
,
pageSize
);
_specification
.
ApplyPaging
((
pageNumber
-
1
)
*
pageSize
,
pageSize
);
IEnumerable
<
EmployeeTrack
>
employeeTracks
=
await
_employeeTracksRepository
.
ListAsync
(
_specification
);
IEnumerable
<
EmployeeTrack
>
employeeTracks
=
await
_employeeTracksRepository
.
ListAsync
(
_specification
);
...
...
PSManagement.Application/Employees/UseCases/Queries/GetEmployeesByFilter/GetEmployeesByFilterQuery.cs
View file @
e12a00a8
...
@@ -8,6 +8,7 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeesByFilt
...
@@ -8,6 +8,7 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeesByFilt
public
record
GetEmployeesByFilterQuery
(
public
record
GetEmployeesByFilterQuery
(
string
EmployeeFirstName
,
string
EmployeeFirstName
,
int
?
HiastId
,
int
?
HiastId
,
string
Email
,
string
DepartmentName
,
string
DepartmentName
,
string
WorkType
,
string
WorkType
,
int
?
PageNumber
,
int
?
PageNumber
,
...
...
PSManagement.Application/Employees/UseCases/Queries/GetEmployeesByFilter/GetEmployeesByFilterQueryHandler.cs
View file @
e12a00a8
...
@@ -34,6 +34,7 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeesByFilt
...
@@ -34,6 +34,7 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeesByFilt
_specification
.
ApplyPaging
((
pageNumber
-
1
)
*
pageSize
,
pageSize
);
_specification
.
ApplyPaging
((
pageNumber
-
1
)
*
pageSize
,
pageSize
);
_specification
.
AddInclude
(
e
=>
e
.
Department
);
_specification
.
AddInclude
(
e
=>
e
.
Department
);
_specification
.
AddInclude
(
e
=>
e
.
User
);
IEnumerable
<
Employee
>
employees
=
await
_employeesRepository
.
ListAsync
(
_specification
);
IEnumerable
<
Employee
>
employees
=
await
_employeesRepository
.
ListAsync
(
_specification
);
if
(!
string
.
IsNullOrEmpty
(
request
.
DepartmentName
))
if
(!
string
.
IsNullOrEmpty
(
request
.
DepartmentName
))
...
@@ -54,6 +55,10 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeesByFilt
...
@@ -54,6 +55,10 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetEmployeesByFilt
{
{
employees
=
employees
.
Where
(
e
=>
e
.
WorkInfo
.
WorkType
.
ToLower
().
Contains
(
request
.
WorkType
.
ToLower
().
Trim
()));
employees
=
employees
.
Where
(
e
=>
e
.
WorkInfo
.
WorkType
.
ToLower
().
Contains
(
request
.
WorkType
.
ToLower
().
Trim
()));
}
}
if
(!
string
.
IsNullOrEmpty
(
request
.
Email
))
{
employees
=
employees
.
Where
(
e
=>
e
.
User
.
Email
.
ToLower
().
Contains
(
request
.
Email
.
ToLower
().
Trim
()));
}
return
Result
.
Success
(
_mapper
.
Map
<
IEnumerable
<
EmployeeDTO
>>(
employees
));
return
Result
.
Success
(
_mapper
.
Map
<
IEnumerable
<
EmployeeDTO
>>(
employees
));
}
}
...
...
PSManagement.Application/Projects/UseCases/Commands/AddProjectStep/AddProjectStepCommandHandler.cs
View file @
e12a00a8
...
@@ -40,7 +40,7 @@ namespace PSManagement.Application.Projects.UseCases.Commands.AddProjectStep
...
@@ -40,7 +40,7 @@ namespace PSManagement.Application.Projects.UseCases.Commands.AddProjectStep
}
}
else
else
{
{
Step
step
=
await
_stepsRepository
.
AddAsync
(
new
(
request
.
StepInfo
,
request
.
ProjectId
,
request
.
Weight
));
Step
step
=
await
_stepsRepository
.
AddAsync
(
new
(
request
.
StepInfo
,
request
.
ProjectId
,
request
.
CurrentCompletionRatio
,
request
.
Weight
));
await
_unitOfWork
.
SaveChangesAsync
();
await
_unitOfWork
.
SaveChangesAsync
();
...
...
PSManagement.Application/Projects/UseCases/Queries/GetProjectById/GetProjectByIdQueryHandler.cs
View file @
e12a00a8
...
@@ -31,9 +31,9 @@ namespace PSManagement.Application.Projects.UseCases.Queries.GetProject
...
@@ -31,9 +31,9 @@ namespace PSManagement.Application.Projects.UseCases.Queries.GetProject
{
{
_specification
.
Includes
.
Add
(
p
=>
p
.
EmployeeParticipates
);
_specification
.
Includes
.
Add
(
p
=>
p
.
EmployeeParticipates
);
_specification
.
Includes
.
Add
(
p
=>
p
.
FinancialSpending
);
_specification
.
Includes
.
Add
(
p
=>
p
.
FinancialSpending
);
_specification
.
Includes
.
Add
(
p
=>
p
.
ProjectManager
);
_specification
.
Includes
.
Add
(
p
=>
p
.
ProjectManager
.
Department
);
_specification
.
Includes
.
Add
(
p
=>
p
.
Attachments
);
_specification
.
Includes
.
Add
(
p
=>
p
.
Attachments
);
_specification
.
Includes
.
Add
(
p
=>
p
.
TeamLeader
);
_specification
.
Includes
.
Add
(
p
=>
p
.
TeamLeader
.
Department
);
_specification
.
Includes
.
Add
(
p
=>
p
.
Executer
);
_specification
.
Includes
.
Add
(
p
=>
p
.
Executer
);
_specification
.
Includes
.
Add
(
p
=>
p
.
Proposer
);
_specification
.
Includes
.
Add
(
p
=>
p
.
Proposer
);
...
...
PSManagement.Application/Tracks/Common/EmployeeTrackDTO.cs
View file @
e12a00a8
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Employees.Entities
;
namespace
PSManagement.Application.Tracks.Common
namespace
PSManagement.Application.Tracks.Common
{
{
...
@@ -6,6 +7,7 @@ namespace PSManagement.Application.Tracks.Common
...
@@ -6,6 +7,7 @@ namespace PSManagement.Application.Tracks.Common
{
{
public
int
Id
{
get
;
set
;
}
public
int
Id
{
get
;
set
;
}
public
int
EmloyeeId
{
get
;
set
;
}
public
int
EmloyeeId
{
get
;
set
;
}
public
Employee
Emloyee
{
get
;
set
;
}
public
int
TrackId
{
get
;
set
;
}
public
int
TrackId
{
get
;
set
;
}
public
TrackInfo
TrackInfo
{
get
;
set
;
}
public
TrackInfo
TrackInfo
{
get
;
set
;
}
public
EmployeeWorkInfo
EmployeeWorkInfo
{
get
;
set
;
}
public
EmployeeWorkInfo
EmployeeWorkInfo
{
get
;
set
;
}
...
...
PSManagement.Application/Tracks/Common/TrackDTO.cs
View file @
e12a00a8
using
PSManagement.Application.Employees.Common
;
using
PSManagement.Application.Employees.Common
;
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Projects.ValueObjects
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
...
@@ -14,6 +15,6 @@ namespace PSManagement.Application.Tracks.Common
...
@@ -14,6 +15,6 @@ namespace PSManagement.Application.Tracks.Common
public
TrackInfo
TrackInfo
{
get
;
set
;
}
public
TrackInfo
TrackInfo
{
get
;
set
;
}
public
String
Notes
{
get
;
set
;
}
public
String
Notes
{
get
;
set
;
}
public
int
ProjectId
{
get
;
set
;
}
public
int
ProjectId
{
get
;
set
;
}
public
ProjectInfo
ProjectInfo
{
get
;
set
;}
}
}
}
}
PSManagement.Application/Tracks/UseCaes/Commands/AddEmployeeTrack/AddEmployeeTrackCommandHandler.cs
View file @
e12a00a8
...
@@ -11,6 +11,7 @@ using PSManagement.SharedKernel.Specification;
...
@@ -11,6 +11,7 @@ using PSManagement.SharedKernel.Specification;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Linq
;
using
System.Linq
;
using
System
;
namespace
PSManagement.Application.Tracks.UseCaes.Commands.AddEmployeeTrack
namespace
PSManagement.Application.Tracks.UseCaes.Commands.AddEmployeeTrack
{
{
...
@@ -53,12 +54,13 @@ namespace PSManagement.Application.Tracks.UseCaes.Commands.AddEmployeeTrack
...
@@ -53,12 +54,13 @@ namespace PSManagement.Application.Tracks.UseCaes.Commands.AddEmployeeTrack
return
Result
.
Invalid
(
TracksErrors
.
TrackCompletedUpdateError
);
return
Result
.
Invalid
(
TracksErrors
.
TrackCompletedUpdateError
);
}
}
if
(
track
.
EmployeeTracks
.
Any
(
e
=>
e
.
EmloyeeId
==
request
.
EmployeeId
))
{
if
(
track
.
EmployeeTracks
.
Any
(
e
=>
e
.
Em
p
loyeeId
==
request
.
EmployeeId
))
{
return
Result
.
Invalid
(
TracksErrors
.
ParticipantTrackExistError
);
return
Result
.
Invalid
(
TracksErrors
.
ParticipantTrackExistError
);
}
}
var
r
=
_mapper
.
Map
<
EmployeeTrack
>(
request
);
//Console.WriteLine(r.EmloyeeId);
EmployeeTrack
employeeTrack
=
await
_employeeTracksRepository
.
AddAsync
(
_mapper
.
Map
<
EmployeeTrack
>(
request
));
EmployeeTrack
employeeTrack
=
await
_employeeTracksRepository
.
AddAsync
(
_mapper
.
Map
<
EmployeeTrack
>(
request
));
await
_unitOfWork
.
SaveChangesAsync
();
await
_unitOfWork
.
SaveChangesAsync
();
...
...
PSManagement.Application/Tracks/UseCaes/Commands/AddStepTrack/AddStepTrackCommand.cs
View file @
e12a00a8
...
@@ -8,7 +8,6 @@ namespace PSManagement.Application.Tracks.UseCaes.Commands.AddStepTrack
...
@@ -8,7 +8,6 @@ namespace PSManagement.Application.Tracks.UseCaes.Commands.AddStepTrack
int
StepId
,
int
StepId
,
int
TrackId
,
int
TrackId
,
string
ExecutionState
,
string
ExecutionState
,
DateTime
TrackDate
,
int
TrackExecutionRatio
int
TrackExecutionRatio
)
:
ICommand
<
Result
<
int
>>;
)
:
ICommand
<
Result
<
int
>>;
}
}
\ No newline at end of file
PSManagement.Application/Tracks/UseCaes/Commands/UpdateEmployeeWorkTrack/UpdateEmployeeWorkTrackCommandHandler.cs
View file @
e12a00a8
...
@@ -47,7 +47,7 @@ namespace PSManagement.Application.Tracks.UseCaes.Commands.UpdateEmployeeWorkTra
...
@@ -47,7 +47,7 @@ namespace PSManagement.Application.Tracks.UseCaes.Commands.UpdateEmployeeWorkTra
return
Result
.
Invalid
(
TracksErrors
.
InvalidEntryError
);
return
Result
.
Invalid
(
TracksErrors
.
InvalidEntryError
);
}
}
if
(
request
.
EmployeeId
!=
employeeTrack
.
EmloyeeId
)
if
(
request
.
EmployeeId
!=
employeeTrack
.
Em
p
loyeeId
)
{
{
return
Result
.
Invalid
(
TracksErrors
.
InvalidEntryError
);
return
Result
.
Invalid
(
TracksErrors
.
InvalidEntryError
);
...
...
PSManagement.Application/Tracks/UseCaes/Queries/GetTracksByProject/GetTracksByProjectQueryHandler.cs
View file @
e12a00a8
...
@@ -37,6 +37,7 @@ namespace PSManagement.Application.Tracks.UseCaes.Queries.GetTracksByProject
...
@@ -37,6 +37,7 @@ namespace PSManagement.Application.Tracks.UseCaes.Queries.GetTracksByProject
int
pageNumber
=
request
.
PageNumber
.
HasValue
&&
request
.
PageNumber
.
Value
>
0
?
request
.
PageNumber
.
Value
:
1
;
int
pageNumber
=
request
.
PageNumber
.
HasValue
&&
request
.
PageNumber
.
Value
>
0
?
request
.
PageNumber
.
Value
:
1
;
int
pageSize
=
request
.
PageSize
.
HasValue
&&
request
.
PageSize
.
Value
>
0
&&
request
.
PageSize
.
Value
<=
30
?
request
.
PageSize
.
Value
:
30
;
int
pageSize
=
request
.
PageSize
.
HasValue
&&
request
.
PageSize
.
Value
>
0
&&
request
.
PageSize
.
Value
<=
30
?
request
.
PageSize
.
Value
:
30
;
_specification
.
AddInclude
(
e
=>
e
.
Project
);
_specification
.
ApplyPaging
((
pageNumber
-
1
)
*
pageSize
,
pageSize
);
_specification
.
ApplyPaging
((
pageNumber
-
1
)
*
pageSize
,
pageSize
);
...
...
PSManagement.Contracts/Employees/Requests/GetEmployeesByFilterRequest.cs
View file @
e12a00a8
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
public
record
GetEmployeesByFilterRequest
(
public
record
GetEmployeesByFilterRequest
(
string
EmployeeFirstName
,
string
EmployeeFirstName
,
int
?
HiastId
,
int
?
HiastId
,
string
Email
,
string
DepartmentName
,
string
DepartmentName
,
string
WorkType
,
string
WorkType
,
int
?
PageSize
,
int
?
PageSize
,
...
...
PSManagement.Contracts/Employees/Response/EmployeeParticipateResponse.cs
View file @
e12a00a8
using
PSManagement.Application.Employees.Common
;
using
PSManagement.Application.Employees.Common
;
using
PSManagement.Domain.Projects.ValueObjects
;
namespace
PSManagement.Contracts.Projects.Response
namespace
PSManagement.Contracts.Projects.Response
{
{
...
@@ -6,6 +7,8 @@ namespace PSManagement.Contracts.Projects.Response
...
@@ -6,6 +7,8 @@ namespace PSManagement.Contracts.Projects.Response
{
{
public
int
EmployeeId
{
get
;
set
;
}
public
int
EmployeeId
{
get
;
set
;
}
public
int
ProjectId
{
get
;
set
;
}
public
int
ProjectId
{
get
;
set
;
}
public
ProjectInfo
ProjectInfo
{
get
;
set
;
}
public
EmployeeResponse
Employee
{
get
;
set
;
}
public
EmployeeResponse
Employee
{
get
;
set
;
}
public
int
PartialTimeRatio
{
get
;
set
;
}
public
int
PartialTimeRatio
{
get
;
set
;
}
public
string
Role
{
get
;
set
;
}
public
string
Role
{
get
;
set
;
}
...
...
PSManagement.Contracts/Employees/Response/EmployeeResponse.cs
View file @
e12a00a8
...
@@ -7,6 +7,7 @@ namespace PSManagement.Contracts.Projects.Response
...
@@ -7,6 +7,7 @@ namespace PSManagement.Contracts.Projects.Response
public
int
Id
{
get
;
set
;
}
public
int
Id
{
get
;
set
;
}
public
int
HIASTId
{
get
;
set
;
}
public
int
HIASTId
{
get
;
set
;
}
public
int
UserId
{
get
;
set
;
}
public
int
UserId
{
get
;
set
;
}
public
string
Email
{
get
;
set
;
}
public
string
DepartmentName
{
get
;
set
;
}
public
string
DepartmentName
{
get
;
set
;
}
public
PersonalInfo
PersonalInfo
{
get
;
set
;
}
public
PersonalInfo
PersonalInfo
{
get
;
set
;
}
public
Availability
Availability
{
get
;
set
;
}
public
Availability
Availability
{
get
;
set
;
}
...
...
PSManagement.Contracts/Projects/Requests/GetProjectsByProjectManagerRequest.cs
View file @
e12a00a8
namespace
PSManagement.Contracts.Projects.Requests
namespace
PSManagement.Contracts.Projects.Requests
{
{
public
record
GetProjectsByProjectManagerRequest
(
public
record
GetProjectsByProjectManagerRequest
(
int
ProjectManager
,
int
ProjectManager
Id
,
int
?
PageNumber
,
int
?
PageNumber
,
int
?
PageSize
int
?
PageSize
);
);
...
...
PSManagement.Contracts/Projects/Response/ProjectDetailsResponse.cs
View file @
e12a00a8
...
@@ -12,6 +12,7 @@ namespace PSManagement.Contracts.Projects.Response
...
@@ -12,6 +12,7 @@ namespace PSManagement.Contracts.Projects.Response
public
string
CurrentState
{
get
;
set
;
}
public
string
CurrentState
{
get
;
set
;
}
public
Aggreement
ProjectAggreement
{
get
;
set
;
}
public
Aggreement
ProjectAggreement
{
get
;
set
;
}
public
ProjectClassification
ProjectClassification
{
get
;
set
;
}
public
EmployeeResponse
TeamLeader
{
get
;
set
;
}
public
EmployeeResponse
TeamLeader
{
get
;
set
;
}
public
EmployeeResponse
ProjectManager
{
get
;
set
;
}
public
EmployeeResponse
ProjectManager
{
get
;
set
;
}
public
Department
Executer
{
get
;
set
;
}
public
Department
Executer
{
get
;
set
;
}
...
...
PSManagement.Contracts/Projects/Response/ProjectResponse.cs
View file @
e12a00a8
...
@@ -15,6 +15,7 @@ namespace PSManagement.Contracts.Projects.Response
...
@@ -15,6 +15,7 @@ namespace PSManagement.Contracts.Projects.Response
public
Aggreement
ProjectAggreement
{
get
;
set
;
}
public
Aggreement
ProjectAggreement
{
get
;
set
;
}
public
int
TeamLeaderId
{
get
;
set
;
}
public
int
TeamLeaderId
{
get
;
set
;
}
public
ProjectClassification
ProjectClassification
{
get
;
set
;
}
public
EmployeeResponse
TeamLeader
{
get
;
set
;
}
public
EmployeeResponse
TeamLeader
{
get
;
set
;
}
public
int
ProjectManagerId
{
get
;
set
;
}
public
int
ProjectManagerId
{
get
;
set
;
}
public
EmployeeResponse
ProjectManager
{
get
;
set
;
}
public
EmployeeResponse
ProjectManager
{
get
;
set
;
}
...
...
PSManagement.Contracts/Tracks/Requests/AddStepTrackRequest.cs
View file @
e12a00a8
...
@@ -10,7 +10,6 @@ namespace PSManagement.Contracts.Tracks.Requests
...
@@ -10,7 +10,6 @@ namespace PSManagement.Contracts.Tracks.Requests
int
StepId
,
int
StepId
,
int
TrackId
,
int
TrackId
,
string
ExecutionState
,
string
ExecutionState
,
DateTime
TrackDate
,
int
TrackExecutionRatio
int
TrackExecutionRatio
);
);
}
}
PSManagement.Contracts/Tracks/Response/EmployeeTrackResponse.cs
View file @
e12a00a8
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Employees.Entities
;
namespace
PSManagement.Contracts.Tracks.Response
namespace
PSManagement.Contracts.Tracks.Response
{
{
public
record
EmployeeTrackResponse
(
public
record
EmployeeTrackResponse
(
int
EmloyeeId
,
int
EmloyeeId
,
int
TrackId
,
int
TrackId
,
Employee
Employee
,
TrackInfo
TrackInfo
,
TrackInfo
TrackInfo
,
EmployeeWorkInfo
EmployeeWorkInfo
,
EmployeeWorkInfo
EmployeeWorkInfo
,
EmployeeWork
EmployeeWork
,
EmployeeWork
EmployeeWork
,
...
...
PSManagement.Contracts/Tracks/Response/TrackResponse.cs
View file @
e12a00a8
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Tracking.ValueObjects
;
using
PSManagement.Domain.Projects.ValueObjects
;
using
System
;
using
System
;
namespace
PSManagement.Contracts.Tracks.Response
namespace
PSManagement.Contracts.Tracks.Response
...
@@ -7,6 +9,7 @@ namespace PSManagement.Contracts.Tracks.Response
...
@@ -7,6 +9,7 @@ namespace PSManagement.Contracts.Tracks.Response
int
Id
,
int
Id
,
TrackInfo
TrackInfo
,
TrackInfo
TrackInfo
,
String
Notes
,
String
Notes
,
int
ProjectId
int
ProjectId
,
ProjectInfo
ProjectInfo
);
);
}
}
PSManagement.Domain/Projects/Entities/Step.cs
View file @
e12a00a8
...
@@ -28,8 +28,9 @@ namespace PSManagement.Domain.Projects.Entities
...
@@ -28,8 +28,9 @@ namespace PSManagement.Domain.Projects.Entities
}
}
public
Step
(
StepInfo
stepInfo
,
int
projectId
,
int
weight
)
public
Step
(
StepInfo
stepInfo
,
int
projectId
,
int
currentCompletionRatio
,
int
weight
)
{
{
CurrentCompletionRatio
=
currentCompletionRatio
;
StepInfo
=
stepInfo
;
StepInfo
=
stepInfo
;
ProjectId
=
projectId
;
ProjectId
=
projectId
;
Weight
=
weight
;
Weight
=
weight
;
...
...
PSManagement.Domain/Tracking/Entities/EmployeeTrack.cs
View file @
e12a00a8
...
@@ -6,7 +6,7 @@ namespace PSManagement.Domain.Tracking
...
@@ -6,7 +6,7 @@ namespace PSManagement.Domain.Tracking
{
{
public
class
EmployeeTrack
:
BaseEntity
public
class
EmployeeTrack
:
BaseEntity
{
{
public
int
EmloyeeId
{
get
;
set
;
}
public
int
Em
p
loyeeId
{
get
;
set
;
}
public
int
TrackId
{
get
;
set
;
}
public
int
TrackId
{
get
;
set
;
}
public
Employee
Employee
{
get
;
set
;
}
public
Employee
Employee
{
get
;
set
;
}
public
Track
Track
{
get
;
set
;
}
public
Track
Track
{
get
;
set
;
}
...
...
PSManagement.Infrastructure.Persistence/EntitiesConfiguration/TrackEntityConfiguration.cs
View file @
e12a00a8
...
@@ -50,7 +50,7 @@ namespace PSManagement.Infrastructure.Persistence.EntitiesConfiguration
...
@@ -50,7 +50,7 @@ namespace PSManagement.Infrastructure.Persistence.EntitiesConfiguration
{
{
builder
.
HasOne
(
st
=>
st
.
Employee
)
builder
.
HasOne
(
st
=>
st
.
Employee
)
.
WithMany
(
s
=>
s
.
EmployeeTracks
)
.
WithMany
(
s
=>
s
.
EmployeeTracks
)
.
HasForeignKey
(
st
=>
st
.
EmloyeeId
)
.
HasForeignKey
(
st
=>
st
.
Em
p
loyeeId
)
;
;
builder
.
OwnsOne
(
e
=>
e
.
EmployeeWorkInfo
,
p
=>
builder
.
OwnsOne
(
e
=>
e
.
EmployeeWorkInfo
,
p
=>
...
...
PSManagement.Infrastructure.Persistence/Migrations/20240824174450_FixTrackNaming.Designer.cs
0 → 100644
View file @
e12a00a8
// <auto-generated />
using
System
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Infrastructure
;
using
Microsoft.EntityFrameworkCore.Metadata
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Microsoft.EntityFrameworkCore.Storage.ValueConversion
;
using
PSManagement.Infrastructure.Persistence
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
[
DbContext
(
typeof
(
AppDbContext
))]
[
Migration
(
"20240824174450_FixTrackNaming"
)]
partial
class
FixTrackNaming
{
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
{
#pragma warning disable 612, 618
modelBuilder
.
HasAnnotation
(
"Relational:Collation"
,
"Arabic_CI_AS"
)
.
HasAnnotation
(
"Relational:MaxIdentifierLength"
,
128
)
.
HasAnnotation
(
"ProductVersion"
,
"5.0.17"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Entities.ContactInfo"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"ContactType"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"ContactValue"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
?>(
"CustomerId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"CustomerId"
);
b
.
ToTable
(
"ContactInfo"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Entities.Customer"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"CustomerName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"Email"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Customers"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Employees.Entities.Department"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Departments"
);
b
.
HasData
(
new
{
Id
=
1
,
Name
=
"قسم المعلوميات"
},
new
{
Id
=
2
,
Name
=
"قسم النظم الإلكترونية"
},
new
{
Id
=
3
,
Name
=
"قسم الميكاترونيكس"
},
new
{
Id
=
4
,
Name
=
"قسم الفيزياء"
},
new
{
Id
=
5
,
Name
=
"مديرية التطوير والخدمات البرمجية"
},
new
{
Id
=
6
,
Name
=
"شؤون الطلاب"
});
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Employees.Entities.Employee"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
>(
"DepartmentId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"HIASTId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"UserId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"DepartmentId"
);
b
.
HasIndex
(
"UserId"
)
.
IsUnique
();
b
.
ToTable
(
"Employees"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.FinancialSpends.Entities.FinancialSpending"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"CostType"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"Description"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
DateTime
>(
"ExpectedSpendingDate"
)
.
HasColumnType
(
"datetime2"
);
b
.
Property
<
int
>(
"LocalPurchase"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"FinancialSpendings"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Entities.Permission"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Permission"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Entities.Role"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Roles"
);
b
.
HasData
(
new
{
Id
=
1
,
Name
=
"Admin"
},
new
{
Id
=
2
,
Name
=
"Employee"
},
new
{
Id
=
4
,
Name
=
"Scientific-Deputy"
});
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Entities.User"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Email"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"HashedPassword"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"UserName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Users"
);
b
.
HasData
(
new
{
Id
=
2
,
Email
=
"Admin@Admin"
,
HashedPassword
=
"1234"
,
UserName
=
"Admin"
});
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Attachment"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"AttachmentDescription"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"AttachmentName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"AttachmentUrl"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"Attachment"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.EmployeeParticipate"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
>(
"EmployeeId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"PartialTimeRatio"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Role"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"EmployeeId"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"EmployeeParticipate"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Project"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"CurrentState"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"nvarchar(max)"
)
.
HasDefaultValueSql
(
"Proposed"
);
b
.
Property
<
int
?>(
"CustomerId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ExecuterId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ProjectManagerId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ProposerId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"TeamLeaderId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"CustomerId"
);
b
.
HasIndex
(
"ExecuterId"
);
b
.
HasIndex
(
"ProjectManagerId"
);
b
.
HasIndex
(
"ProposerId"
);
b
.
HasIndex
(
"TeamLeaderId"
);
b
.
ToTable
(
"Projects"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Step"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
>(
"CurrentCompletionRatio"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"Weight"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"Steps"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Answer"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"AnswerValue"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
?>(
"QuestionId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
?>(
"ReportResultId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"QuestionId"
);
b
.
HasIndex
(
"ReportResultId"
);
b
.
ToTable
(
"Answer"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Question"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"QuestionName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Question"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Report"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"ReportName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Reports"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
?>(
"ReportId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ReportId"
);
b
.
ToTable
(
"ReportResults"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Section"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
?>(
"ReportId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"SectionName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ReportId"
);
b
.
ToTable
(
"Section"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.EmployeeTrack"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
>(
"EmployeeId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Notes"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
>(
"TrackId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"EmployeeId"
);
b
.
HasIndex
(
"TrackId"
);
b
.
ToTable
(
"EmployeeTrack"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Entities.StepTrack"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"ExecutionState"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
>(
"OldExecutionRatio"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"StepId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"TrackExecutionRatio"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"TrackId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"StepId"
);
b
.
HasIndex
(
"TrackId"
);
b
.
ToTable
(
"StepTracks"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Track"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Notes"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"Tracks"
);
});
modelBuilder
.
Entity
(
"PermissionRole"
,
b
=>
{
b
.
Property
<
int
>(
"PermissionsId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"RolesId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"PermissionsId"
,
"RolesId"
);
b
.
HasIndex
(
"RolesId"
);
b
.
ToTable
(
"PermissionRole"
);
});
modelBuilder
.
Entity
(
"QuestionSection"
,
b
=>
{
b
.
Property
<
int
>(
"QuestionsId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"SectionsId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"QuestionsId"
,
"SectionsId"
);
b
.
HasIndex
(
"SectionsId"
);
b
.
ToTable
(
"QuestionSection"
);
});
modelBuilder
.
Entity
(
"UserRole"
,
b
=>
{
b
.
Property
<
int
>(
"RoleId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"UserId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"RoleId"
,
"UserId"
);
b
.
HasIndex
(
"UserId"
);
b
.
ToTable
(
"UserRole"
);
b
.
HasData
(
new
{
RoleId
=
1
,
UserId
=
1
});
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Entities.ContactInfo"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Customers.Entities.Customer"
,
null
)
.
WithMany
(
"ContactInfo"
)
.
HasForeignKey
(
"CustomerId"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Entities.Customer"
,
b
=>
{
b
.
OwnsOne
(
"PSManagement.Domain.Customers.ValueObjects.Address"
,
"Address"
,
b1
=>
{
b1
.
Property
<
int
>(
"CustomerId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"City"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"City"
);
b1
.
Property
<
string
>(
"StreetName"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"StreetName"
);
b1
.
Property
<
int
>(
"StreetNumber"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"StreetNumber"
);
b1
.
HasKey
(
"CustomerId"
);
b1
.
ToTable
(
"Customers"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"CustomerId"
);
});
b
.
Navigation
(
"Address"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Employees.Entities.Employee"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Department"
,
"Department"
)
.
WithMany
()
.
HasForeignKey
(
"DepartmentId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
);
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.User"
,
"User"
)
.
WithOne
(
"Employee"
)
.
HasForeignKey
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"UserId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
OwnsOne
(
"PSManagement.Domain.Employees.Entities.Availability"
,
"Availability"
,
b1
=>
{
b1
.
Property
<
int
>(
"EmployeeId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
int
>(
"CurrentWorkingHours"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"CurrentWorkingHours"
);
b1
.
Property
<
bool
>(
"IsAvailable"
)
.
HasColumnType
(
"bit"
)
.
HasColumnName
(
"IsAvailable"
);
b1
.
HasKey
(
"EmployeeId"
);
b1
.
ToTable
(
"Employees"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"EmployeeId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Employees.Entities.PersonalInfo"
,
"PersonalInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"EmployeeId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"FirstName"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"FirstName"
);
b1
.
Property
<
string
>(
"LastName"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"LastName"
);
b1
.
HasKey
(
"EmployeeId"
);
b1
.
ToTable
(
"Employees"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"EmployeeId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Employees.Entities.WorkInfo"
,
"WorkInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"EmployeeId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"WorkJob"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"WorkJob"
);
b1
.
Property
<
string
>(
"WorkType"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"WorkType"
);
b1
.
HasKey
(
"EmployeeId"
);
b1
.
ToTable
(
"Employees"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"EmployeeId"
);
});
b
.
Navigation
(
"Availability"
);
b
.
Navigation
(
"Department"
);
b
.
Navigation
(
"PersonalInfo"
);
b
.
Navigation
(
"User"
);
b
.
Navigation
(
"WorkInfo"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.FinancialSpends.Entities.FinancialSpending"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
null
)
.
WithMany
(
"FinancialSpending"
)
.
HasForeignKey
(
"ProjectId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
OwnsOne
(
"PSManagement.SharedKernel.ValueObjects.Money"
,
"ExternalPurchase"
,
b1
=>
{
b1
.
Property
<
int
>(
"FinancialSpendingId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
int
>(
"Ammount"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"ExternalPurchaseAmmount"
);
b1
.
Property
<
string
>(
"Currency"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"nvarchar(max)"
)
.
HasDefaultValue
(
"USD"
)
.
HasColumnName
(
"ExternalPurchaseCurrency"
);
b1
.
HasKey
(
"FinancialSpendingId"
);
b1
.
ToTable
(
"FinancialSpendings"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"FinancialSpendingId"
);
});
b
.
Navigation
(
"ExternalPurchase"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Attachment"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
null
)
.
WithMany
(
"Attachments"
)
.
HasForeignKey
(
"ProjectId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.EmployeeParticipate"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"Employee"
)
.
WithMany
(
"EmployeeParticipates"
)
.
HasForeignKey
(
"EmployeeId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
"Project"
)
.
WithMany
(
"EmployeeParticipates"
)
.
HasForeignKey
(
"ProjectId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
Navigation
(
"Employee"
);
b
.
Navigation
(
"Project"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Project"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Customers.Entities.Customer"
,
null
)
.
WithMany
(
"Projects"
)
.
HasForeignKey
(
"CustomerId"
);
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Department"
,
"Executer"
)
.
WithMany
()
.
HasForeignKey
(
"ExecuterId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"ProjectManager"
)
.
WithMany
()
.
HasForeignKey
(
"ProjectManagerId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
);
b
.
HasOne
(
"PSManagement.Domain.Customers.Entities.Customer"
,
"Proposer"
)
.
WithMany
()
.
HasForeignKey
(
"ProposerId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"TeamLeader"
)
.
WithMany
()
.
HasForeignKey
(
"TeamLeaderId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
);
b
.
OwnsOne
(
"PSManagement.Domain.Projects.ValueObjects.Aggreement"
,
"ProjectAggreement"
,
b1
=>
{
b1
.
Property
<
int
>(
"ProjectId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
DateTime
>(
"AggreementDate"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"AggreementDate"
);
b1
.
Property
<
int
>(
"AggreementNumber"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"AggreementNumber"
);
b1
.
HasKey
(
"ProjectId"
);
b1
.
ToTable
(
"Projects"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"ProjectId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Projects.ValueObjects.FinancialFund"
,
"FinancialFund"
,
b1
=>
{
b1
.
Property
<
int
>(
"ProjectId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"FinancialStatus"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"FinicialStatus"
);
b1
.
Property
<
string
>(
"Source"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"FinicialSource"
);
b1
.
HasKey
(
"ProjectId"
);
b1
.
ToTable
(
"Projects"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"ProjectId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Projects.ValueObjects.ProjectClassification"
,
"ProjectClassification"
,
b1
=>
{
b1
.
Property
<
int
>(
"ProjectId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"ProjectNature"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"ProjectNature"
);
b1
.
Property
<
string
>(
"ProjectStatus"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"ProjectStatus"
);
b1
.
Property
<
string
>(
"ProjectType"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"ProjectType"
);
b1
.
HasKey
(
"ProjectId"
);
b1
.
ToTable
(
"Projects"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"ProjectId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Projects.ValueObjects.ProjectInfo"
,
"ProjectInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"ProjectId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"Code"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"Code"
);
b1
.
Property
<
string
>(
"Description"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"Description"
);
b1
.
Property
<
DateTime
>(
"ExpectedEndDate"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"ExpectedEndDate"
);
b1
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"Name"
);
b1
.
Property
<
DateTime
>(
"StartDate"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"StartDate"
);
b1
.
HasKey
(
"ProjectId"
);
b1
.
ToTable
(
"Projects"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"ProjectId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Projects.ValueObjects.ProposalInfo"
,
"ProposalInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"ProjectId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
DateTime
>(
"ProposingBookDate"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"ProposingBookDate"
);
b1
.
Property
<
int
>(
"ProposingBookNumber"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"ProposingBookNumber"
);
b1
.
HasKey
(
"ProjectId"
);
b1
.
ToTable
(
"Projects"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"ProjectId"
);
});
b
.
Navigation
(
"Executer"
);
b
.
Navigation
(
"FinancialFund"
);
b
.
Navigation
(
"ProjectAggreement"
);
b
.
Navigation
(
"ProjectClassification"
);
b
.
Navigation
(
"ProjectInfo"
);
b
.
Navigation
(
"ProjectManager"
);
b
.
Navigation
(
"ProposalInfo"
);
b
.
Navigation
(
"Proposer"
);
b
.
Navigation
(
"TeamLeader"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Step"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
"Project"
)
.
WithMany
(
"Steps"
)
.
HasForeignKey
(
"ProjectId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
OwnsOne
(
"PSManagement.Domain.Projects.ValueObjects.StepInfo"
,
"StepInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"StepId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"Description"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"Description"
);
b1
.
Property
<
int
>(
"Duration"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"Duration"
);
b1
.
Property
<
DateTime
>(
"StartDate"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"StartDate"
);
b1
.
Property
<
string
>(
"StepName"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"StepName"
);
b1
.
HasKey
(
"StepId"
);
b1
.
ToTable
(
"Steps"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"StepId"
);
});
b
.
Navigation
(
"Project"
);
b
.
Navigation
(
"StepInfo"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Answer"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Question"
,
"Question"
)
.
WithMany
()
.
HasForeignKey
(
"QuestionId"
);
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
null
)
.
WithMany
(
"Answers"
)
.
HasForeignKey
(
"ReportResultId"
);
b
.
Navigation
(
"Question"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Report"
,
"Report"
)
.
WithMany
()
.
HasForeignKey
(
"ReportId"
);
b
.
Navigation
(
"Report"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Section"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Report"
,
"Report"
)
.
WithMany
(
"Sections"
)
.
HasForeignKey
(
"ReportId"
);
b
.
Navigation
(
"Report"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.EmployeeTrack"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"Employee"
)
.
WithMany
(
"EmployeeTracks"
)
.
HasForeignKey
(
"EmployeeId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Tracking.Track"
,
"Track"
)
.
WithMany
(
"EmployeeTracks"
)
.
HasForeignKey
(
"TrackId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
OwnsOne
(
"PSManagement.Domain.Tracking.ValueObjects.EmployeeWork"
,
"EmployeeWork"
,
b1
=>
{
b1
.
Property
<
int
>(
"EmployeeTrackId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
int
>(
"AssignedWorkingHours"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"AssignedWorkingHours"
);
b1
.
Property
<
int
>(
"ContributingRatio"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"ContributingRatio"
);
b1
.
Property
<
int
>(
"WorkedHours"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"WorkedHours"
);
b1
.
HasKey
(
"EmployeeTrackId"
);
b1
.
ToTable
(
"EmployeeTrack"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"EmployeeTrackId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Tracking.ValueObjects.EmployeeWorkInfo"
,
"EmployeeWorkInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"EmployeeTrackId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"AssignedWork"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"AssignedWork"
);
b1
.
Property
<
DateTime
>(
"AssignedWorkEnd"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"AssignedWorkEnd"
);
b1
.
Property
<
string
>(
"PerformedWork"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"PerformedWork"
);
b1
.
HasKey
(
"EmployeeTrackId"
);
b1
.
ToTable
(
"EmployeeTrack"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"EmployeeTrackId"
);
});
b
.
Navigation
(
"Employee"
);
b
.
Navigation
(
"EmployeeWork"
);
b
.
Navigation
(
"EmployeeWorkInfo"
);
b
.
Navigation
(
"Track"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Entities.StepTrack"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Step"
,
"Step"
)
.
WithMany
(
"StepTracks"
)
.
HasForeignKey
(
"StepId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Tracking.Track"
,
"Track"
)
.
WithMany
(
"StepTracks"
)
.
HasForeignKey
(
"TrackId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
)
.
IsRequired
();
b
.
Navigation
(
"Step"
);
b
.
Navigation
(
"Track"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Track"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
"Project"
)
.
WithMany
(
"Tracks"
)
.
HasForeignKey
(
"ProjectId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
)
.
IsRequired
();
b
.
OwnsOne
(
"PSManagement.Domain.Tracking.ValueObjects.TrackInfo"
,
"TrackInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"TrackId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
bool
>(
"IsCompleted"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"bit"
)
.
HasDefaultValue
(
false
)
.
HasColumnName
(
"IsCompleted"
);
b1
.
Property
<
string
>(
"StatusDescription"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"StatusDescription"
);
b1
.
Property
<
DateTime
>(
"TrackDate"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"TrackDate"
);
b1
.
HasKey
(
"TrackId"
);
b1
.
ToTable
(
"Tracks"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"TrackId"
);
});
b
.
Navigation
(
"Project"
);
b
.
Navigation
(
"TrackInfo"
);
});
modelBuilder
.
Entity
(
"PermissionRole"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.Permission"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"PermissionsId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.Role"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"RolesId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"QuestionSection"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Question"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"QuestionsId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Section"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"SectionsId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"UserRole"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.Role"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"RoleId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.User"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"UserId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Entities.Customer"
,
b
=>
{
b
.
Navigation
(
"ContactInfo"
);
b
.
Navigation
(
"Projects"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Employees.Entities.Employee"
,
b
=>
{
b
.
Navigation
(
"EmployeeParticipates"
);
b
.
Navigation
(
"EmployeeTracks"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Entities.User"
,
b
=>
{
b
.
Navigation
(
"Employee"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Project"
,
b
=>
{
b
.
Navigation
(
"Attachments"
);
b
.
Navigation
(
"EmployeeParticipates"
);
b
.
Navigation
(
"FinancialSpending"
);
b
.
Navigation
(
"Steps"
);
b
.
Navigation
(
"Tracks"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Step"
,
b
=>
{
b
.
Navigation
(
"StepTracks"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Report"
,
b
=>
{
b
.
Navigation
(
"Sections"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
b
=>
{
b
.
Navigation
(
"Answers"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Track"
,
b
=>
{
b
.
Navigation
(
"EmployeeTracks"
);
b
.
Navigation
(
"StepTracks"
);
});
#pragma warning restore 612, 618
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/20240824174450_FixTrackNaming.cs
0 → 100644
View file @
e12a00a8
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
public
partial
class
FixTrackNaming
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropForeignKey
(
name
:
"FK_EmployeeTrack_Employees_EmloyeeId"
,
table
:
"EmployeeTrack"
);
migrationBuilder
.
RenameColumn
(
name
:
"EmloyeeId"
,
table
:
"EmployeeTrack"
,
newName
:
"EmployeeId"
);
migrationBuilder
.
RenameIndex
(
name
:
"IX_EmployeeTrack_EmloyeeId"
,
table
:
"EmployeeTrack"
,
newName
:
"IX_EmployeeTrack_EmployeeId"
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_EmployeeTrack_Employees_EmployeeId"
,
table
:
"EmployeeTrack"
,
column
:
"EmployeeId"
,
principalTable
:
"Employees"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Cascade
);
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropForeignKey
(
name
:
"FK_EmployeeTrack_Employees_EmployeeId"
,
table
:
"EmployeeTrack"
);
migrationBuilder
.
RenameColumn
(
name
:
"EmployeeId"
,
table
:
"EmployeeTrack"
,
newName
:
"EmloyeeId"
);
migrationBuilder
.
RenameIndex
(
name
:
"IX_EmployeeTrack_EmployeeId"
,
table
:
"EmployeeTrack"
,
newName
:
"IX_EmployeeTrack_EmloyeeId"
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_EmployeeTrack_Employees_EmloyeeId"
,
table
:
"EmployeeTrack"
,
column
:
"EmloyeeId"
,
principalTable
:
"Employees"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Cascade
);
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/AppDbContextModelSnapshot.cs
View file @
e12a00a8
...
@@ -458,7 +458,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
...
@@ -458,7 +458,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
.
HasColumnType
(
"int"
)
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
>(
"EmloyeeId"
)
b
.
Property
<
int
>(
"Em
p
loyeeId"
)
.
HasColumnType
(
"int"
);
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Notes"
)
b
.
Property
<
string
>(
"Notes"
)
...
@@ -469,7 +469,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
...
@@ -469,7 +469,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
b
.
HasKey
(
"Id"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"EmloyeeId"
);
b
.
HasIndex
(
"Em
p
loyeeId"
);
b
.
HasIndex
(
"TrackId"
);
b
.
HasIndex
(
"TrackId"
);
...
@@ -1032,7 +1032,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
...
@@ -1032,7 +1032,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
{
{
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"Employee"
)
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"Employee"
)
.
WithMany
(
"EmployeeTracks"
)
.
WithMany
(
"EmployeeTracks"
)
.
HasForeignKey
(
"EmloyeeId"
)
.
HasForeignKey
(
"Em
p
loyeeId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
.
IsRequired
();
...
...
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