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
bf203fbc
Commit
bf203fbc
authored
Aug 25, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refator some entities
parent
4f8f60d1
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
516 additions
and
97 deletions
+516
-97
MapperConfiguration.cs
...on/ApplicationMappersConfiguration/MapperConfiguration.cs
+41
-17
DependencyInjection.cs
...n/DependencyInjectionConfiguration/DependencyInjection.cs
+20
-4
EmployeeDTO.cs
PSManagement.Application/Employees/Common/EmployeeDTO.cs
+4
-0
GetAvailableEmployeesQuery.cs
...eries/GetAvailableEmployees/GetAvailableEmployeesQuery.cs
+2
-0
GetDepartmentsQuery.cs
...es/UseCases/Queries/GetDepartments/GetDepartmentsQuery.cs
+12
-0
GetDepartmentsQueryHandler.cs
...ases/Queries/GetDepartments/GetDepartmentsQueryHandler.cs
+33
-0
PSManagement.Application.csproj
PSManagement.Application/PSManagement.Application.csproj
+0
-6
ProjectDTO.cs
PSManagement.Application/Projects/Common/ProjectDTO.cs
+1
-0
ChangeEmployeeParticipationCommand.cs
...ployeeParticipation/ChangeEmployeeParticipationCommand.cs
+13
-0
ChangeEmployeeParticipationCommandHandler.cs
...articipation/ChangeEmployeeParticipationCommandHandler.cs
+63
-0
CreateProjectCommand.cs
...s/UseCases/Commands/CreateProject/CreateProjectCommand.cs
+2
-1
CreateProjectCommandHandler.cs
...ses/Commands/CreateProject/CreateProjectCommandHandler.cs
+16
-12
CreateProjectResult.cs
...ts/UseCases/Commands/CreateProject/CreateProjectResult.cs
+0
-14
GetProjectByIdQueryHandler.cs
...ases/Queries/GetProjectById/GetProjectByIdQueryHandler.cs
+2
-0
CreateNewTypeCommandHandler.cs
...ses/Commands/CreateNewType/CreateNewTypeCommandHandler.cs
+2
-1
UpdateTypeCommandHandler.cs
.../UseCases/Commands/UpdateType/UpdateTypeCommandHandler.cs
+6
-5
GetProjectsTypesQueryHandler.cs
.../Queries/GetProjectsTypes/GetProjectsTypesQueryHandler.cs
+1
-1
GetTypeByIdQueryHandler.cs
...s/UseCases/Queries/GetTypeById/GetTypeByIdQueryHandler.cs
+2
-2
GetTracksByProjectQuery.cs
...aes/Queries/GetTracksByProject/GetTracksByProjectQuery.cs
+2
-0
GetUnCompletedTracksQuery.cs
...Queries/GetUncompletedTracks/GetUnCompletedTracksQuery.cs
+12
-0
GetUnCompletedTracksQueryHandler.cs
.../GetUncompletedTracks/GetUnCompletedTracksQueryHandler.cs
+43
-0
EmployeeResponse.cs
...nagement.Contracts/Employees/Response/EmployeeResponse.cs
+5
-0
ChangeEmployeeParticipationRequest.cs
...s/Projects/Requests/ChangeEmployeeParticipationRequest.cs
+9
-0
CompleteProjectRequest.cs
...ent.Contracts/Projects/Requests/CompleteProjectRequest.cs
+11
-0
CreateProjectRequest.cs
...ement.Contracts/Projects/Requests/CreateProjectRequest.cs
+2
-1
ProjectCompletionResponse.cs
....Contracts/Projects/Response/ProjectCompletionResponse.cs
+14
-0
ProjectResponse.cs
PSManagement.Contracts/Projects/Response/ProjectResponse.cs
+5
-3
CreateNewTypeRequest.cs
...t.Contracts/ProjectsTypes/Request/CreateNewTypeRequest.cs
+16
-0
UpdateTypeRequest.cs
...ment.Contracts/ProjectsTypes/Request/UpdateTypeRequest.cs
+10
-0
ProjectTypeResponse.cs
...t.Contracts/ProjectsTypes/Response/ProjectTypeResponse.cs
+10
-0
Customer.cs
PSManagement.Domain/Customers/Entities/Customer.cs
+18
-8
Employee.cs
PSManagement.Domain/Employees/Entities/Employee.cs
+11
-2
FinancialSpending.cs
...ment.Domain/FinancialSpends/Entities/FinancialSpending.cs
+9
-9
ProjectBuilder.cs
PSManagement.Domain/Projects/Builders/ProjectBuilder.cs
+3
-1
ParticipationChanged.cs
...ment.Domain/Projects/DomainEvents/ParticipationChanged.cs
+15
-0
Attachment.cs
PSManagement.Domain/Projects/Entities/Attachment.cs
+3
-0
EmployeeParticipate.cs
PSManagement.Domain/Projects/Entities/EmployeeParticipate.cs
+3
-0
Project.cs
PSManagement.Domain/Projects/Entities/Project.cs
+77
-5
Step.cs
PSManagement.Domain/Projects/Entities/Step.cs
+5
-2
IProjectTypesRepository.cs
...t.Domain/Projects/Repositories/IProjectTypesRepository.cs
+0
-1
Track.cs
PSManagement.Domain/Tracking/Entities/Track.cs
+13
-2
No files found.
PSManagement.Application/Application
DTOsMappers
/MapperConfiguration.cs
→
PSManagement.Application/Application
MappersConfiguration
/MapperConfiguration.cs
View file @
bf203fbc
...
...
@@ -5,6 +5,8 @@ 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
;
using
PSManagement.Application.Tracks.Common
;
using
PSManagement.Application.Tracks.UseCaes.Commands.AddEmployeeTrack
;
using
PSManagement.Application.Tracks.UseCaes.Commands.AddStepTrack
;
...
...
@@ -41,12 +43,6 @@ namespace PSManagement.Application.Mappers
.
ForMember
(
e
=>
e
.
Email
,
op
=>
op
.
MapFrom
(
e
=>
e
.
User
.
Email
))
;
CreateMap
<
EmployeeParticipate
,
EmployeeParticipateDTO
>()
.
ForMember
(
d
=>
d
.
ProjectInfo
,
opt
=>
opt
.
MapFrom
(
s
=>
s
.
Project
.
ProjectInfo
))
.
ForMember
(
d
=>
d
.
Employee
,
op
=>
op
.
MapFrom
(
e
=>
e
.
Employee
))
;
CreateMap
<
StepTrack
,
StepTrackDTO
>()
.
ForMember
(
d
=>
d
.
StepInfo
,
opt
=>
opt
.
MapFrom
(
s
=>
s
.
Step
.
StepInfo
))
.
ForMember
(
d
=>
d
.
TrackInfo
,
op
=>
op
.
MapFrom
(
e
=>
e
.
Track
.
TrackInfo
))
...
...
@@ -54,30 +50,60 @@ namespace PSManagement.Application.Mappers
CreateMap
<
EmployeeTrack
,
EmployeeTrackDTO
>()
.
ForMember
(
d
=>
d
.
TrackInfo
,
op
=>
op
.
MapFrom
(
e
=>
e
.
Track
.
TrackInfo
))
;
CreateMap
<
Project
,
ProjectInfo
>()
.
ConvertUsing
(
project
=>
project
.
ProjectInfo
);
CreateMap
<
Track
,
TrackDTO
>()
.
ForMember
(
e
=>
e
.
ProjectInfo
,
op
=>
op
.
MapFrom
(
s
=>
s
.
Project
.
ProjectInfo
))
;
CreateMap
<
CreateTrackCommand
,
Track
>().
ReverseMap
();
CreateMap
<
AddEmployeeTrackCommand
,
EmployeeTrack
>().
ReverseMap
();
CreateMap
<
AddStepTrackCommand
,
StepTrack
>()
.
ForMember
(
e
=>
e
.
OldExecutionRatio
,
op
=>
op
.
Ignore
());
CreateMap
<
FinancialSpendingDTO
,
FinancialSpending
>().
ReverseMap
();
CreateMap
<
Role
,
RoleDTO
>().
ReverseMap
();
}
}
public
class
ProjectDTOMapperConfiguration
:
Profile
{
public
ProjectDTOMapperConfiguration
()
{
CreateMap
<
Project
,
ProjectDTO
>().
ReverseMap
();
CreateMap
<
Project
,
ProjectDetailsDTO
>().
ReverseMap
();
CreateMap
<
Project
,
ProjectInfo
>()
.
ConvertUsing
(
project
=>
project
.
ProjectInfo
);
CreateMap
<
CreateFinancialSpendItemCommand
,
FinancialSpending
>
()
.
ForMember
(
d
=>
d
.
Id
,
op
=>
op
.
Ignore
())
.
ForMember
(
d
=>
d
.
Events
,
op
=>
op
.
Ignore
())
CreateMap
<
EmployeeParticipate
,
EmployeeParticipateDTO
>()
.
ForMember
(
d
=>
d
.
ProjectInfo
,
opt
=>
opt
.
MapFrom
(
s
=>
s
.
Project
.
ProjectInfo
))
.
ForMember
(
d
=>
d
.
Employee
,
op
=>
op
.
MapFrom
(
e
=>
e
.
Employee
))
;
CreateMap
<
CreateNewTypeCommand
,
ProjectType
>();
CreateMap
<
UpdateTypeCommand
,
ProjectType
>();
CreateMap
<
CompleteProjectCommand
,
ProjectCompletion
>();
}
}
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
,
...
...
@@ -88,8 +114,6 @@ namespace PSManagement.Application.Mappers
))
;
CreateMap
<
Role
,
RoleDTO
>().
ReverseMap
();
}
}
...
...
PSManagement.Application/D
I
/DependencyInjection.cs
→
PSManagement.Application/D
ependencyInjectionConfiguration
/DependencyInjection.cs
View file @
bf203fbc
...
...
@@ -16,21 +16,37 @@ namespace PSManagement.Application.DI
{
public
static
IServiceCollection
AddApplication
(
this
IServiceCollection
services
)
{
//services.AddMediatR();
services
.
AddMyMediatR
()
.
AddMappers
();
return
services
;
}
private
static
IServiceCollection
AddMyMediatR
(
this
IServiceCollection
services
)
{
services
.
AddMediatR
(
typeof
(
DependencyInjection
).
Assembly
);
// Register the pipeline behaviors explicitly
services
.
AddTransient
(
typeof
(
IPipelineBehavior
<,>),
typeof
(
ValidationBehavior
<,>));
services
.
AddTransient
(
typeof
(
IPipelineBehavior
<,>),
typeof
(
LoggingBehavior
<,>));
// Register FluentValidation validators
services
.
AddValidatorsFromAssembly
(
Assembly
.
GetExecutingAssembly
());
return
services
;
}
private
static
IServiceCollection
AddMappers
(
this
IServiceCollection
services
)
{
services
.
AddAutoMapper
(
cfg
=>
{
cfg
.
AddProfile
<
MapperConfiguration
>();
cfg
.
AddProfile
<
ProjectDTOMapperConfiguration
>();
cfg
.
AddProfile
<
FinanialSpendingDTOMapperConfiguration
>();
});
return
services
;
}
...
...
PSManagement.Application/Employees/Common/EmployeeDTO.cs
View file @
bf203fbc
...
...
@@ -20,4 +20,8 @@ namespace PSManagement.Application.Employees.Common
public
Availability
Availability
{
get
;
set
;
}
}
public
class
DepartmentDTO
{
public
int
Id
{
get
;
set
;
}
public
String
Name
{
get
;
set
;
}
}
}
PSManagement.Application/Employees/UseCases/Queries/GetAvailableEmployees/GetAvailableEmployeesQuery.cs
View file @
bf203fbc
...
...
@@ -12,4 +12,6 @@ namespace PSManagement.Application.Employees.UseCases.Queries.GetAvailableEmploy
public
record
GetAvailableEmployeesQuery
(
int
?
PageNumber
,
int
?
PageSize
)
:
IQuery
<
Result
<
IEnumerable
<
EmployeeDTO
>>>;
}
PSManagement.Application/Employees/UseCases/Queries/GetDepartments/GetDepartmentsQuery.cs
0 → 100644
View file @
bf203fbc
using
Ardalis.Result
;
using
PSManagement.Application.Employees.Common
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
System.Collections.Generic
;
namespace
PSManagement.Application.Employees.UseCases.Queries.GetDepartments
{
public
record
GetDepartmentsQuery
(
)
:
IQuery
<
Result
<
IEnumerable
<
DepartmentDTO
>>>;
}
PSManagement.Application/Employees/UseCases/Queries/GetDepartments/GetDepartmentsQueryHandler.cs
0 → 100644
View file @
bf203fbc
using
Ardalis.Result
;
using
AutoMapper
;
using
PSManagement.Application.Employees.Common
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
PSManagement.SharedKernel.Repositories
;
using
System.Collections.Generic
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.Employees.UseCases.Queries.GetDepartments
{
public
class
GetDepartmentsQueryHandler
:
IQueryHandler
<
GetDepartmentsQuery
,
Result
<
IEnumerable
<
DepartmentDTO
>>>
{
private
readonly
IRepository
<
Department
>
_deparmentsRepository
;
private
readonly
IMapper
_mapper
;
public
GetDepartmentsQueryHandler
(
IMapper
mapper
,
IRepository
<
Department
>
deparmentsRepository
)
{
_mapper
=
mapper
;
_deparmentsRepository
=
deparmentsRepository
;
}
public
async
Task
<
Result
<
IEnumerable
<
DepartmentDTO
>>>
Handle
(
GetDepartmentsQuery
request
,
CancellationToken
cancellationToken
)
{
var
result
=
await
_deparmentsRepository
.
ListAsync
();
return
Result
.
Success
(
_mapper
.
Map
<
IEnumerable
<
DepartmentDTO
>>(
result
));
}
}
}
PSManagement.Application/PSManagement.Application.csproj
View file @
bf203fbc
...
...
@@ -5,12 +5,6 @@
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>
<ItemGroup>
<Folder Include="Behaviors\AuthorizationBehavior\" />
<Folder Include="Projects\UseCases\Commands\ChangeParticiptionInfo\" />
<Folder Include="Tracks\UseCaes\Queries\GetUncompletedTracks\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="7.0.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="5.0.1" />
...
...
PSManagement.Application/Projects/Common/ProjectDTO.cs
View file @
bf203fbc
...
...
@@ -17,6 +17,7 @@ namespace PSManagement.Application.Projects.Common
public
ProjectClassification
ProjectClassification
{
get
;
set
;
}
public
ProjectInfo
ProjectInfo
{
get
;
set
;
}
public
ProjectTypeDTO
ProjectType
{
get
;
set
;
}
public
int
ProjectTypeId
{
get
;
set
;
}
public
string
CurrentState
{
get
;
set
;
}
public
Aggreement
ProjectAggreement
{
get
;
set
;
}
public
int
TeamLeaderId
{
get
;
set
;
}
...
...
PSManagement.Application/Projects/UseCases/Commands/ChangeEmployeeParticipation/ChangeEmployeeParticipationCommand.cs
0 → 100644
View file @
bf203fbc
using
Ardalis.Result
;
using
PSManagement.SharedKernel.CQRS.Command
;
namespace
PSManagement.Application.Projects.UseCases.Commands.ChangeProjectManager
{
public
record
ChangeEmployeeParticipationCommand
(
int
ParticipantId
,
int
ProjectId
,
int
PartialTimeRation
,
string
Role
)
:
ICommand
<
Result
>;
}
PSManagement.Application/Projects/UseCases/Commands/ChangeEmployeeParticipation/ChangeEmployeeParticipationCommandHandler.cs
0 → 100644
View file @
bf203fbc
using
Ardalis.Result
;
using
PSManagement.Domain.Employees.Repositories
;
using
PSManagement.Domain.Projects
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
PSManagement.SharedKernel.Interfaces
;
using
PSManagement.SharedKernel.Specification
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.Projects.UseCases.Commands.ChangeProjectManager
{
public
class
ChangeEmployeeParticipationCommandHandler
:
ICommandHandler
<
ChangeEmployeeParticipationCommand
,
Result
>
{
private
readonly
IProjectsRepository
_projectsRepository
;
private
readonly
BaseSpecification
<
Project
>
_specification
;
private
readonly
IUnitOfWork
_unitOfWork
;
public
ChangeEmployeeParticipationCommandHandler
(
IProjectsRepository
projectsRepository
,
IUnitOfWork
unitOfWork
,
IEmployeesRepository
employeesRepository
)
{
_projectsRepository
=
projectsRepository
;
_unitOfWork
=
unitOfWork
;
_specification
=
new
ProjectSpecification
();
}
public
async
Task
<
Result
>
Handle
(
ChangeEmployeeParticipationCommand
request
,
CancellationToken
cancellationToken
)
{
_specification
.
AddInclude
(
e
=>
e
.
EmployeeParticipates
);
Project
project
=
await
_projectsRepository
.
GetByIdAsync
(
request
.
ProjectId
,
_specification
);
if
(
project
is
null
)
{
return
Result
.
Invalid
(
ProjectsErrors
.
InvalidEntryError
);
}
else
{
if
(!
project
.
HasParticipant
(
request
.
ParticipantId
))
{
return
Result
.
Invalid
(
ProjectsErrors
.
ParticipantUnExistError
);
}
project
.
ChangeParticipant
(
request
.
ParticipantId
,
request
.
PartialTimeRation
,
request
.
Role
);
await
_unitOfWork
.
SaveChangesAsync
();
return
Result
.
Success
();
}
}
}
}
PSManagement.Application/Projects/UseCases/Commands/CreateProject/CreateProjectCommand.cs
View file @
bf203fbc
...
...
@@ -18,6 +18,7 @@ namespace PSManagement.Application.Projects.UseCases.Commands.CreateProject
int
TeamLeaderId
,
int
ProjectManagerId
,
int
ProposerId
,
int
ExecuterId
int
ExecuterId
,
int
ProjectTypeId
)
:
ILoggableCommand
<
Result
<
int
>>;
}
PSManagement.Application/Projects/UseCases/Commands/CreateProject/CreateProjectCommandHandler.cs
View file @
bf203fbc
using
Ardalis.Result
;
using
PSManagement.Application.Projects.Common
;
using
PSManagement.Domain.Projects.Builders
;
using
PSManagement.Domain.Projects.DomainErrors
;
using
PSManagement.Domain.Projects.DomainEvents
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
...
...
@@ -14,6 +15,7 @@ namespace PSManagement.Application.Projects.UseCases.Commands.CreateProject
public
class
CreateProjectCommandHandler
:
ICommandHandler
<
CreateProjectCommand
,
Result
<
int
>>
{
private
readonly
IProjectsRepository
_projectsRepository
;
private
readonly
IProjectTypesRepository
_projectTypesRepository
;
private
readonly
ProjectBuilder
_projectBuilder
;
private
readonly
IUnitOfWork
_unitOfWork
;
...
...
@@ -21,15 +23,23 @@ namespace PSManagement.Application.Projects.UseCases.Commands.CreateProject
public
CreateProjectCommandHandler
(
IProjectsRepository
projectsRepository
,
ProjectBuilder
projectBuilder
,
IUnitOfWork
unitOfWork
)
IUnitOfWork
unitOfWork
,
IProjectTypesRepository
projectTypesRepository
)
{
_projectsRepository
=
projectsRepository
;
_projectBuilder
=
projectBuilder
;
_unitOfWork
=
unitOfWork
;
_projectTypesRepository
=
projectTypesRepository
;
}
public
async
Task
<
Result
<
int
>>
Handle
(
CreateProjectCommand
request
,
CancellationToken
cancellationToken
)
{
var
type
=
await
_projectTypesRepository
.
GetByIdAsync
(
request
.
ProjectTypeId
);
if
(
type
is
null
)
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
}
Project
project
=
_projectBuilder
.
WithProjectAggreement
(
request
.
ProjectAggreement
)
.
WithProjectInfo
(
request
.
ProjectInfo
)
...
...
@@ -41,23 +51,17 @@ namespace PSManagement.Application.Projects.UseCases.Commands.CreateProject
.
WithProposer
(
request
.
ProposerId
)
.
WithClassification
(
request
.
ProjectClassification
)
.
Build
();
project
.
ProjectTypeId
=
request
.
ProjectTypeId
;
project
.
Propose
();
project
=
await
_projectsRepository
.
AddAsync
(
project
);
CreateProjectResult
response
=
new
(
project
.
Id
,
project
.
ProposalInfo
,
project
.
ProjectInfo
,
project
.
ProjectAggreement
,
project
.
TeamLeaderId
,
project
.
ProjectManagerId
,
project
.
ExecuterId
);
project
.
AddDomainEvent
(
new
ProjectCreatedEvent
(
project
.
Id
,
project
.
TeamLeaderId
,
project
.
ProjectManagerId
));
await
_unitOfWork
.
SaveChangesAsync
();
return
Result
.
Success
(
response
.
Project
Id
);
return
Result
.
Success
(
project
.
Id
);
}
}
...
...
PSManagement.Application/Projects/UseCases/Commands/CreateProject/CreateProjectResult.cs
deleted
100644 → 0
View file @
4f8f60d1
using
PSManagement.Domain.Projects.ValueObjects
;
namespace
PSManagement.Application.Projects.UseCases.Commands.CreateProject
{
public
record
CreateProjectResult
(
int
ProjectId
,
ProposalInfo
ProposalInfo
,
ProjectInfo
ProjectInfo
,
Aggreement
ProjectAggrement
,
int
TeamLeaderId
,
int
ProjectManagerId
,
int
ExecuterId
);
}
PSManagement.Application/Projects/UseCases/Queries/GetProjectById/GetProjectByIdQueryHandler.cs
View file @
bf203fbc
...
...
@@ -37,6 +37,8 @@ namespace PSManagement.Application.Projects.UseCases.Queries.GetProject
_specification
.
Includes
.
Add
(
p
=>
p
.
Executer
);
_specification
.
Includes
.
Add
(
p
=>
p
.
Proposer
);
_specification
.
Includes
.
Add
(
p
=>
p
.
ProjectType
);
var
project
=
await
_projectRepository
.
GetByIdAsync
(
request
.
ProjectId
,
_specification
);
...
...
PSManagement.Application/ProjectsTypes/UseCases/Commands/CreateNewType/CreateNewTypeCommandHandler.cs
View file @
bf203fbc
...
...
@@ -4,6 +4,7 @@ using PSManagement.Domain.Projects.DomainErrors;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading.Tasks
;
...
...
@@ -26,7 +27,7 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
{
var
result
=
await
_projectTypesRepository
.
GetByTypeName
(
request
.
TypeName
);
if
(
result
is
not
null
)
if
(
result
.
Count
()
!=
0
)
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidName
);
}
...
...
PSManagement.Application/ProjectsTypes/UseCases/Commands/UpdateType/UpdateTypeCommandHandler.cs
View file @
bf203fbc
...
...
@@ -4,6 +4,7 @@ using PSManagement.Domain.Projects.DomainErrors;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.Repositories
;
using
PSManagement.SharedKernel.CQRS.Command
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading.Tasks
;
...
...
@@ -24,12 +25,12 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Commands.CreateNewType
public
async
Task
<
Result
>
Handle
(
UpdateTypeCommand
request
,
CancellationToken
cancellationToken
)
{
var
result
=
await
_projectTypesRepository
.
GetByTypeName
(
request
.
TypeName
);
//
var result = await _projectTypesRepository.GetByTypeName(request.TypeName);
if
(
result
is
not
null
)
{
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
}
//if (result is null || result.Count()==0
)
//
{
//
return Result.Invalid(PrjectTypesErrors.InvalidEntryError);
//
}
var
projectType
=
await
_projectTypesRepository
.
UpdateAsync
(
_mapper
.
Map
<
ProjectType
>(
request
));
...
...
PSManagement.Application/ProjectsTypes/UseCases/Queries/GetProjectsTypes/GetProjectsTypesQueryHandler.cs
View file @
bf203fbc
...
...
@@ -34,7 +34,7 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Queries.GetProjectsTyp
result
=
new
List
<
ProjectType
>();
}
return
Result
.
Success
(
_mapper
.
Map
<
Result
<
IEnumerable
<
ProjectTypeDTO
>
>>(
result
));
;
return
Result
.
Success
(
_mapper
.
Map
<
IEnumerable
<
ProjectTypeDTO
>>(
result
));
;
}
}
}
PSManagement.Application/ProjectsTypes/UseCases/Queries/GetTypeById/GetTypeByIdQueryHandler.cs
View file @
bf203fbc
...
...
@@ -23,7 +23,7 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Queries.GetTypeById
_mapper
=
mapper
;
}
public
async
Task
<
Result
<
ProjectTypeDTO
>>
Handle
(
Get
ProjectsTypes
Query
request
,
CancellationToken
cancellationToken
)
public
async
Task
<
Result
<
ProjectTypeDTO
>>
Handle
(
Get
TypeById
Query
request
,
CancellationToken
cancellationToken
)
{
var
result
=
await
_projectTypesRepository
.
ListAsync
();
...
...
@@ -33,7 +33,7 @@ namespace PSManagement.Application.ProjectsTypes.UseCases.Queries.GetTypeById
return
Result
.
Invalid
(
PrjectTypesErrors
.
InvalidEntryError
);
}
return
Result
.
Success
(
_mapper
.
Map
<
Result
<
ProjectTypeDTO
>
>(
result
));
;
return
Result
.
Success
(
_mapper
.
Map
<
ProjectTypeDTO
>(
result
));
;
}
}
}
PSManagement.Application/Tracks/UseCaes/Queries/GetTracksByProject/GetTracksByProjectQuery.cs
View file @
bf203fbc
...
...
@@ -14,4 +14,6 @@ namespace PSManagement.Application.Tracks.UseCaes.Queries.GetTracksByProject
int
?
PageSize
)
:
IQuery
<
Result
<
IEnumerable
<
TrackDTO
>>>;
}
PSManagement.Application/Tracks/UseCaes/Queries/GetUncompletedTracks/GetUnCompletedTracksQuery.cs
0 → 100644
View file @
bf203fbc
using
Ardalis.Result
;
using
PSManagement.Application.Tracks.Common
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
System.Collections.Generic
;
namespace
PSManagement.Application.Tracks.UseCaes.Queries.GetUncompletedTracks
{
public
record
GetUnCompletedTracksQuery
(
)
:
IQuery
<
Result
<
IEnumerable
<
TrackDTO
>>>;
}
PSManagement.Application/Tracks/UseCaes/Queries/GetUncompletedTracks/GetUnCompletedTracksQueryHandler.cs
0 → 100644
View file @
bf203fbc
using
Ardalis.Result
;
using
AutoMapper
;
using
PSManagement.Application.Tracks.Common
;
using
PSManagement.Domain.Steps.Repositories
;
using
PSManagement.Domain.Tracking
;
using
PSManagement.Domain.Tracking.Specification
;
using
PSManagement.SharedKernel.CQRS.Query
;
using
PSManagement.SharedKernel.Specification
;
using
System.Collections.Generic
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
PSManagement.Application.Tracks.UseCaes.Queries.GetUncompletedTracks
{
public
class
GetUnCompletedTracksQueryHandler
:
IQueryHandler
<
GetUnCompletedTracksQuery
,
Result
<
IEnumerable
<
TrackDTO
>>>
{
private
readonly
ITracksRepository
_tracksRepository
;
private
readonly
IMapper
_mapper
;
private
readonly
BaseSpecification
<
Track
>
_specification
;
public
GetUnCompletedTracksQueryHandler
(
IMapper
mapper
,
ITracksRepository
tracksRepository
)
{
_mapper
=
mapper
;
_tracksRepository
=
tracksRepository
;
_specification
=
new
TrackSpecification
();
}
public
async
Task
<
Result
<
IEnumerable
<
TrackDTO
>>>
Handle
(
GetUnCompletedTracksQuery
request
,
CancellationToken
cancellationToken
)
{
_specification
.
Criteria
=
c
=>
c
.
TrackInfo
.
IsCompleted
==
false
;
var
tracks
=
await
_tracksRepository
.
ListAsync
(
_specification
);
return
Result
.
Success
(
_mapper
.
Map
<
IEnumerable
<
TrackDTO
>>(
tracks
));
}
}
}
PSManagement.Contracts/Employees/Response/EmployeeResponse.cs
View file @
bf203fbc
...
...
@@ -13,4 +13,9 @@ namespace PSManagement.Contracts.Projects.Response
public
Availability
Availability
{
get
;
set
;
}
public
WorkInfo
WorkInfo
{
get
;
set
;
}
}
public
record
DepartmentResponse
(
int
Id
,
string
Name
);
}
\ No newline at end of file
PSManagement.Contracts/Projects/Requests/ChangeEmployeeParticipationRequest.cs
0 → 100644
View file @
bf203fbc
namespace
PSManagement.Contracts.Projects.Requests
{
public
record
ChangeEmployeeParticipationRequest
(
int
ParticipantId
,
int
ProjectId
,
int
PartialTimeRation
,
string
Role
);
}
PSManagement.Contracts/Projects/Requests/CompleteProjectRequest.cs
0 → 100644
View file @
bf203fbc
using
System
;
namespace
PSManagement.Contracts.Projects.Requests
{
public
record
CompleteProjectRequest
(
int
ProjectId
,
DateTime
CompletionDate
,
String
CustomerNotes
,
int
CustomerRate
);
}
PSManagement.Contracts/Projects/Requests/CreateProjectRequest.cs
View file @
bf203fbc
...
...
@@ -15,5 +15,6 @@ namespace PSManagement.Contracts.Projects.Requests
int
TeamLeaderId
,
int
ProjectManagerId
,
int
ProposerId
,
int
ExecuterId
);
int
ExecuterId
,
int
ProjectTypeId
);
}
PSManagement.Contracts/Projects/Response/ProjectCompletionResponse.cs
0 → 100644
View file @
bf203fbc
using
System
;
namespace
PSManagement.Contracts.Projects.Response
{
public
class
ProjectCompletionResponse
{
public
int
Id
{
get
;
set
;
}
public
int
ProjectId
{
get
;
set
;
}
public
ProjectResponse
Project
{
get
;
set
;
}
public
DateTime
CompletionDate
{
get
;
set
;
}
public
String
CustomerNotes
{
get
;
set
;
}
public
int
CustomerRate
{
get
;
set
;
}
}
}
PSManagement.Contracts/Projects/Response/ProjectResponse.cs
View file @
bf203fbc
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
;
...
...
@@ -12,15 +13,17 @@ namespace PSManagement.Contracts.Projects.Response
public
ProposalInfo
ProposalInfo
{
get
;
set
;
}
public
ProjectInfo
ProjectInfo
{
get
;
set
;
}
public
string
CurrentState
{
get
;
set
;
}
public
ProjectTypeResponse
ProjectType
{
get
;
set
;
}
public
Aggreement
ProjectAggreement
{
get
;
set
;
}
public
int
TeamLeaderId
{
get
;
set
;
}
public
int
ProjecTypeId
{
get
;
set
;
}
public
ProjectClassification
ProjectClassification
{
get
;
set
;
}
public
EmployeeResponse
TeamLeader
{
get
;
set
;
}
public
int
ProjectManagerId
{
get
;
set
;
}
public
EmployeeResponse
ProjectManager
{
get
;
set
;
}
public
int
ExecuterId
{
get
;
set
;
}
public
Department
Executer
{
get
;
set
;
}
public
Department
Response
Executer
{
get
;
set
;
}
public
int
ProposerId
{
get
;
private
set
;
}
public
CustomerResponse
Proposer
{
get
;
set
;
}
...
...
@@ -33,5 +36,4 @@ namespace PSManagement.Contracts.Projects.Response
public
ICollection
<
EmployeeParticipateResponse
>
EmployeeParticipates
{
get
;
set
;
}
}
}
}
PSManagement.Contracts/ProjectsTypes/Request/CreateNewTypeRequest.cs
0 → 100644
View file @
bf203fbc
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PSManagement.Contracts.ProjectsTypes.Request
{
public
record
CreateNewTypeRequest
(
string
TypeName
,
string
Description
,
int
ExpectedEffort
);
}
PSManagement.Contracts/ProjectsTypes/Request/UpdateTypeRequest.cs
0 → 100644
View file @
bf203fbc
namespace
PSManagement.Contracts.ProjectsTypes.Request
{
public
record
UpdateTypeRequest
(
int
Id
,
string
TypeName
,
string
Description
,
int
ExpectedEffort
);
}
PSManagement.Contracts/ProjectsTypes/Response/ProjectTypeResponse.cs
0 → 100644
View file @
bf203fbc
namespace
PSManagement.Contracts.ProjectsTypes.Request
{
public
record
ProjectTypeResponse
(
int
Id
,
string
TypeName
,
string
Description
,
int
ExpectedEffort
);
}
PSManagement.Domain/Customers/Entities/Customer.cs
View file @
bf203fbc
...
...
@@ -14,9 +14,26 @@ namespace PSManagement.Domain.Customers.Entities
public
string
CustomerName
{
get
;
set
;
}
public
Address
Address
{
get
;
set
;
}
public
string
Email
{
get
;
set
;
}
#
region
Association
public
ICollection
<
ContactInfo
>
ContactInfo
{
get
;
private
set
;
}
public
ICollection
<
Project
>
Projects
{
get
;
private
set
;
}
#
endregion
Association
#
region
Encapsulation
public
void
AddContactInfo
(
ContactInfo
contactInfo
)
{
if
(
ContactInfo
is
null
)
{
ContactInfo
=
new
List
<
ContactInfo
>();
}
ContactInfo
.
Add
(
contactInfo
);
}
#
endregion
Encapsulation
#
region
Constructors
public
Customer
()
{
...
...
@@ -29,15 +46,8 @@ namespace PSManagement.Domain.Customers.Entities
Email
=
email
;
}
public
void
AddContactInfo
(
ContactInfo
contactInfo
)
{
if
(
ContactInfo
is
null
)
{
ContactInfo
=
new
List
<
ContactInfo
>();
}
ContactInfo
.
Add
(
contactInfo
);
#
endregion
Construtors
}
}
}
PSManagement.Domain/Employees/Entities/Employee.cs
View file @
bf203fbc
...
...
@@ -22,13 +22,19 @@ namespace PSManagement.Domain.Employees.Entities
public
Department
Department
{
get
;
set
;
}
public
PersonalInfo
PersonalInfo
{
get
;
set
;
}
public
WorkInfo
WorkInfo
{
get
;
set
;
}
public
Availability
Availability
{
get
;
set
;
}
#
region
Asscociation
public
ICollection
<
Project
>
Projects
{
get
;
set
;
}
public
ICollection
<
EmployeeTrack
>
EmployeeTracks
{
get
;
set
;
}
public
Availability
Availability
{
get
;
set
;
}
public
ICollection
<
EmployeeParticipate
>
EmployeeParticipates
{
get
;
set
;
}
#
endregion
Asscociation
#
region
Constructors
public
Employee
()
{
...
...
@@ -39,9 +45,12 @@ namespace PSManagement.Domain.Employees.Entities
PersonalInfo
=
personalInfo
;
HIASTId
=
hiastId
;
}
#
endregion
Constructors
public
void
UpdateWorkHours
(
int
workingHour
)
{
int
currentWorkHours
=
Availability
.
CurrentWorkingHours
;
// change the employee working hours
...
...
PSManagement.Domain/FinancialSpends/Entities/FinancialSpending.cs
View file @
bf203fbc
...
...
@@ -6,7 +6,14 @@ namespace PSManagement.Domain.FinancialSpends.Entities
{
public
class
FinancialSpending
:
BaseEntity
{
public
int
ProjectId
{
get
;
set
;
}
public
DateTime
ExpectedSpendingDate
{
get
;
set
;
}
public
string
CostType
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
public
int
LocalPurchase
{
get
;
set
;
}
public
Money
ExternalPurchase
{
get
;
set
;
}
#
region
Constructors
public
FinancialSpending
()
{
...
...
@@ -27,14 +34,7 @@ namespace PSManagement.Domain.FinancialSpends.Entities
Description
=
description
;
ExpectedSpendingDate
=
expectedSpendingDate
;
}
public
int
ProjectId
{
get
;
set
;
}
public
DateTime
ExpectedSpendingDate
{
get
;
set
;
}
public
string
CostType
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
public
int
LocalPurchase
{
get
;
set
;
}
public
Money
ExternalPurchase
{
get
;
set
;
}
#
endregion
Constructors
}
...
...
PSManagement.Domain/Projects/Builders/ProjectBuilder.cs
View file @
bf203fbc
...
...
@@ -11,6 +11,9 @@ using System.Threading.Tasks;
namespace
PSManagement.Domain.Projects.Builders
{
// this class repsponsible for crate and instance of the project
// we use this class to give and uniform interface to the other layer to get
// instance as it like
public
class
ProjectBuilder
{
private
ProposalInfo
_proposalInfo
;
...
...
@@ -18,7 +21,6 @@ namespace PSManagement.Domain.Projects.Builders
private
FinancialFund
_financialFund
;
private
Aggreement
_projectAggreement
;
private
ProjectType
_projectType
;
// information about who lead and execute the project
private
int
_teamLeaderId
;
private
int
_projectManagerId
;
private
int
_executerId
;
...
...
PSManagement.Domain/Projects/DomainEvents/ParticipationChanged.cs
0 → 100644
View file @
bf203fbc
using
PSManagement.SharedKernel.Events
;
using
System
;
namespace
PSManagement.Domain.Projects.DomainEvents
{
public
record
ParticipationChanged
(
int
ParticipantId
,
int
PartialTimeRatioBefore
,
int
PartialTimeRatioAfter
,
string
RoleBefore
,
string
RoleAfter
,
int
ProjectId
,
DateTime
DateTime
)
:
IDomainEvent
;
}
PSManagement.Domain/Projects/Entities/Attachment.cs
View file @
bf203fbc
...
...
@@ -8,6 +8,8 @@ namespace PSManagement.Domain.Projects.Entities
public
string
AttachmentUrl
{
get
;
set
;
}
public
string
AttachmentName
{
get
;
set
;
}
public
string
AttachmentDescription
{
get
;
set
;
}
#
region
Constructors
public
Attachment
(
string
attachmentUrl
,
string
attachmentName
,
string
attachmentDescription
,
int
projectId
)
{
AttachmentUrl
=
attachmentUrl
;
...
...
@@ -15,6 +17,7 @@ namespace PSManagement.Domain.Projects.Entities
AttachmentDescription
=
attachmentDescription
;
ProjectId
=
projectId
;
}
#
endregion
Constructors
}
}
PSManagement.Domain/Projects/Entities/EmployeeParticipate.cs
View file @
bf203fbc
...
...
@@ -12,6 +12,8 @@ namespace PSManagement.Domain.Projects.Entities
public
Project
Project
{
get
;
set
;
}
public
int
PartialTimeRatio
{
get
;
set
;
}
public
string
Role
{
get
;
set
;
}
#
region
Constructors
public
EmployeeParticipate
(
int
employeeId
,
int
projectId
,
string
role
,
int
partialTimeRatio
)
{
EmployeeId
=
employeeId
;
...
...
@@ -23,5 +25,6 @@ namespace PSManagement.Domain.Projects.Entities
{
}
#
endregion
Constuctors
}
}
PSManagement.Domain/Projects/Entities/Project.cs
View file @
bf203fbc
...
...
@@ -20,16 +20,46 @@ namespace PSManagement.Domain.Projects.Entities
{
// information about the project itself
#
region
Project
informations
// the proposal information
// -- hide the details of the proposing in a value object
// -- conatain the proposing book and date
public
ProposalInfo
ProposalInfo
{
get
;
set
;
}
// the value object project info
// -- hide the subjective info of the project
// -- conatin code ,name , start and expect end date
public
ProjectInfo
ProjectInfo
{
get
;
set
;
}
// the aggremenet information value object
// -- hide the details of the aggrement in a value object
// -- conatain the aggrement book and date
public
Aggreement
ProjectAggreement
{
get
;
set
;
}
// the type of the project
public
int
ProjectTypeId
{
get
;
set
;
}
public
ProjectType
ProjectType
{
get
;
set
;
}
public
ProjectCompletion
ProjectCompletion
{
get
;
set
;
}
// the classiccation information of the project
public
ProjectClassification
ProjectClassification
{
get
;
set
;
}
#
endregion
Project
informations
// the completion information of the project
#
region
Completion
// -- its an associated entity contain the details of the completion of the project
public
ProjectCompletion
ProjectCompletion
{
get
;
set
;
}
#
endregion
Completion
// the current state (phase) of the project
// its control the behavior of the project
#
region
Project
State
public
string
CurrentState
{
get
;
private
set
;
}
// Persisted in the database
...
...
@@ -63,24 +93,37 @@ namespace PSManagement.Domain.Projects.Entities
public
Employee
ProjectManager
{
get
;
set
;
}
public
int
ExecuterId
{
get
;
set
;
}
public
Department
Executer
{
get
;
set
;
}
#
endregion
Project
Management
Iformations
// the financial inforamtion
#
region
Financial
fund
and
plan
public
FinancialFund
FinancialFund
{
get
;
set
;
}
public
ICollection
<
FinancialSpending
>
FinancialSpending
{
get
;
set
;
}
#
endregion
Project
Management
Iformations
#
endregion
Financial
fund
and
plan
// the proposer of the project
#
region
Project
Proposer
public
int
ProposerId
{
get
;
private
set
;
}
public
Customer
Proposer
{
get
;
set
;
}
//
#
endregion
Project
Proposer
// the steps and paticipand and attachment
#
region
Execution
Plaining
public
ICollection
<
Step
>
Steps
{
get
;
set
;
}
public
ICollection
<
Employee
>
Participants
{
get
;
set
;
}
public
ICollection
<
Attachment
>
Attachments
{
get
;
set
;
}
#
endregion
Execution
Plaining
#
region
Association
public
ICollection
<
EmployeeParticipate
>
EmployeeParticipates
{
get
;
set
;
}
public
ICollection
<
Track
>
Tracks
{
get
;
set
;
}
#
endregion
Association
#
region
Encapsulating
the
collection
operations
...
...
@@ -119,6 +162,11 @@ namespace PSManagement.Domain.Projects.Entities
#
endregion
Encapsulating
the
collection
operations
// the transition of the project state
// each handler (stated transition) move the project state form one ot other
// its hide the actual behavior
#
region
State
Transitions
public
Result
Complete
(
ProjectCompletion
projectCompletion
)
...
...
@@ -153,6 +201,12 @@ namespace PSManagement.Domain.Projects.Entities
}
#
endregion
State
Transitions
// validating data
// this methods help to hide the buissness rules
// and encapsulate it
#
region
Busines
rules
validators
public
bool
VailedSteps
()
{
int
weightSum
=
0
;
...
...
@@ -162,10 +216,27 @@ namespace PSManagement.Domain.Projects.Entities
return
weightSum
==
100
;
}
public
void
ChangeParticipant
(
int
participantId
,
int
partialTimeRation
,
string
role
)
{
var
participate
=
EmployeeParticipates
.
Where
(
e
=>
e
.
EmployeeId
==
participantId
).
FirstOrDefault
();
AddDomainEvent
(
new
ParticipationChanged
(
participantId
,
participate
.
PartialTimeRatio
,
partialTimeRation
,
role
,
participate
.
Role
,
Id
,
DateTime
.
Now
));
participate
.
Role
=
role
;
participate
.
PartialTimeRatio
=
partialTimeRation
;
}
public
bool
HasParticipant
(
int
participantId
)
{
return
EmployeeParticipates
.
Where
(
e
=>
e
.
EmployeeId
==
participantId
).
FirstOrDefault
()
is
not
null
;
}
#
endregion
Busines
rules
validators
// the constructor
// thsi is mainly use by the builder of the project
#
region
constructors
public
Project
(
...
...
@@ -206,7 +277,7 @@ namespace PSManagement.Domain.Projects.Entities
#
endregion
constructors
// the methds responsible for extract the state when load the object for Data Store
#
region
state
extracting
from
state
name
public
void
SetStateFromString
(
string
stateName
)
{
...
...
@@ -232,6 +303,7 @@ namespace PSManagement.Domain.Projects.Entities
}
}
#
endregion
state
extracting
from
state
name
}
}
PSManagement.Domain/Projects/Entities/Step.cs
View file @
bf203fbc
...
...
@@ -15,14 +15,15 @@ namespace PSManagement.Domain.Projects.Entities
{
public
StepInfo
StepInfo
{
get
;
set
;
}
// this field can be calculated from the track
// but we use it for performance matter
public
int
CurrentCompletionRatio
{
get
;
set
;
}
public
int
Weight
{
get
;
set
;
}
public
int
ProjectId
{
get
;
set
;
}
public
Project
Project
{
get
;
set
;
}
public
ICollection
<
StepTrack
>
StepTracks
{
get
;
set
;
}
#
region
Constructors
public
Step
()
{
...
...
@@ -35,6 +36,8 @@ namespace PSManagement.Domain.Projects.Entities
ProjectId
=
projectId
;
Weight
=
weight
;
}
#
endregion
Constructors
}
}
PSManagement.Domain/Projects/Repositories/IProjectTypesRepository.cs
View file @
bf203fbc
...
...
@@ -8,7 +8,6 @@ namespace PSManagement.Domain.Projects.Repositories
{
public
interface
IProjectTypesRepository
:
IRepository
<
ProjectType
>
{
public
Task
<
IEnumerable
<
Project
>>
GetProjectsByTypeName
(
string
typeName
,
ISpecification
<
ProjectType
>
specification
=
null
);
public
Task
<
IEnumerable
<
ProjectType
>>
GetByTypeName
(
string
typeName
,
ISpecification
<
ProjectType
>
specification
=
null
);
}
...
...
PSManagement.Domain/Tracking/Entities/Track.cs
View file @
bf203fbc
...
...
@@ -18,15 +18,26 @@ namespace PSManagement.Domain.Tracking
public
TrackInfo
TrackInfo
{
get
;
set
;
}
public
String
Notes
{
get
;
set
;
}
public
int
ProjectId
{
get
;
set
;
}
public
Project
Project
{
get
;
set
;
}
public
Project
Project
{
get
;
set
;
}
public
ICollection
<
StepTrack
>
StepTracks
{
get
;
set
;
}
public
ICollection
<
Employee
>
TrackedEmployees
{
get
;
set
;
}
public
ICollection
<
EmployeeTrack
>
EmployeeTracks
{
get
;
set
;
}
#
region
Association
public
ICollection
<
Employee
>
TrackedEmployees
{
get
;
set
;
}
#
endregion
Association
#
region
Constructors
public
Track
()
{
}
#
endregion
Constructors
// this method hide the publishing of the domain events
public
void
Complete
(
DateTime
completionDate
)
{
TrackInfo
=
new
(
TrackInfo
.
TrackDate
,
true
,
TrackInfo
.
StatusDescription
);
...
...
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