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
e7db6cc3
Commit
e7db6cc3
authored
Aug 11, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix s.
parent
5e219566
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
126 additions
and
25 deletions
+126
-25
CustomerErrors.cs
PSManagement.Domain/Customers/DomainErrors/CustomerErrors.cs
+3
-2
Customer.cs
PSManagement.Domain/Customers/Entities/Customer.cs
+7
-8
ICustomersRepository.cs
...ent.Domain/Customers/Repositories/ICustomersRepository.cs
+1
-1
EmployeesSpecification.cs
....Domain/Employees/Specification/EmployeesSpecification.cs
+20
-0
UserErrors.cs
PSManagement.Domain/Identity/DomainErrors/UserErrors.cs
+3
-2
User.cs
PSManagement.Domain/Identity/Entities/User.cs
+1
-0
IRolesRepository.cs
...nagement.Domain/Identity/Repositories/IRolesRepository.cs
+12
-0
UserSpecification.cs
...gement.Domain/Identity/Specification/UserSpecification.cs
+21
-0
ProjectBuilder.cs
PSManagement.Domain/Projects/Builders/ProjectBuilder.cs
+49
-5
ProjectsErrors.cs
PSManagement.Domain/Projects/DomainErrors/ProjectsErrors.cs
+3
-2
Project.cs
PSManagement.Domain/Projects/Entities/Project.cs
+1
-1
IProjectsRepository.cs
...ement.Domain/Projects/Repositories/IProjectsRepository.cs
+4
-2
ProposalInfo.cs
PSManagement.Domain/Projects/ValueObjects/ProposalInfo.cs
+1
-2
No files found.
PSManagement.Domain/Customers/DomainErrors/CustomerErrors.cs
View file @
e7db6cc3
using
PSManagement.SharedKernel.DomainErrors
;
using
ErrorOr
;
using
PSManagement.SharedKernel.DomainErrors
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -9,6 +10,6 @@ namespace PSManagement.Domain.Customers.DomainErrors
{
public
static
class
CustomerErrors
{
public
static
DomainError
InvalidEntryError
{
get
;
}
=
new
DomainError
(
"Invalid Customer Entry."
,
new
DomainError
(
"Invalid Customer Data"
)
);
public
static
DomainError
InvalidEntryError
{
get
;
}
=
new
(
"Customer.InvalidEntry."
,
"Invalid Customer Data"
);
}
}
PSManagement.Domain/Customers/
Aggregate
/Customer.cs
→
PSManagement.Domain/Customers/
Entities
/Customer.cs
View file @
e7db6cc3
using
PSManagement.Domain.Customers.DomainEvents
;
using
PSManagement.Domain.Customers.Entities
;
using
PSManagement.Domain.Customers.ValueObjects
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.SharedKernel.Aggregate
;
...
...
@@ -8,22 +7,22 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Linq.Expressions
;
namespace
PSManagement.Domain.Customers.
Aggregate
namespace
PSManagement.Domain.Customers.
Entities
{
public
class
Customer
:
IAggregateRoot
{
public
S
tring
CustomerName
{
get
;
set
;
}
public
s
tring
CustomerName
{
get
;
set
;
}
public
Address
Address
{
get
;
set
;
}
public
S
tring
Email
{
get
;
set
;
}
public
s
tring
Email
{
get
;
set
;
}
public
ICollection
<
ContactInfo
>
ContactInfo
{
get
;
private
set
;
}
public
ICollection
<
Project
>
Projects
{
get
;
private
set
;
}
public
Customer
()
{
}
public
Customer
(
S
tring
customerName
,
Address
address
,
string
email
)
public
Customer
(
s
tring
customerName
,
Address
address
,
string
email
)
{
CustomerName
=
customerName
;
Address
=
address
;
...
...
@@ -32,11 +31,11 @@ namespace PSManagement.Domain.Customers.Aggregate
public
void
AddContactInfo
(
ContactInfo
contactInfo
)
{
if
(
ContactInfo
is
null
)
if
(
ContactInfo
is
null
)
{
ContactInfo
=
new
List
<
ContactInfo
>();
}
ContactInfo
.
Add
(
contactInfo
);
ContactInfo
.
Add
(
contactInfo
);
}
...
...
PSManagement.Domain/Customers/Repositories/ICustomersRepository.cs
View file @
e7db6cc3
using
PSManagement.Domain.Customers.
Aggregate
;
using
PSManagement.Domain.Customers.
Entities
;
using
PSManagement.SharedKernel.Repositories
;
...
...
PSManagement.Domain/Employees/Specification/EmployeesSpecification.cs
0 → 100644
View file @
e7db6cc3
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.SharedKernel.Specification
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PSManagement.Domain.Employees.Specification
{
public
class
EmployeesSpecification
:
BaseSpecification
<
Employee
>
{
public
EmployeesSpecification
(
Expression
<
Func
<
Employee
,
bool
>>
criteria
=
null
)
:
base
(
criteria
)
{
AddInclude
(
e
=>
e
.
User
);
}
}
}
PSManagement.Domain/Identity/DomainErrors/UserErrors.cs
View file @
e7db6cc3
...
...
@@ -9,8 +9,9 @@ namespace PSManagement.Domain.Identity.DomainErrors
{
public
class
UserErrors
{
public
static
readonly
DomainError
AlreadyUserExist
=
new
(
"The User Email Already Exist."
,
new
DomainError
(
"User email is already exist"
));
public
static
readonly
DomainError
InvalidLoginAttempt
=
new
(
"The User Email or Password Are Incorrect."
,
new
DomainError
(
"invalid credentails for login"
));
public
static
readonly
DomainError
AlreadyUserExist
=
new
(
"The User Email Already Exist."
,
"User email is already exist"
);
public
static
readonly
DomainError
InvalidLoginAttempt
=
new
(
"The User Email or Password Are Incorrect."
,
"invalid credentails for login"
);
public
static
readonly
DomainError
UnExistUser
=
new
(
"The User Dosn't Exist."
,
"invalid credentails ,the provieded credential doesn't match any record"
);
}
}
PSManagement.Domain/Identity/Entities/User.cs
View file @
e7db6cc3
...
...
@@ -13,6 +13,7 @@ namespace PSManagement.Domain.Identity.Entities
public
string
HashedPassword
{
get
;
set
;
}
public
ICollection
<
Role
>
Roles
{
get
;
set
;
}
}
...
...
PSManagement.Domain/Identity/Repositories/IRolesRepository.cs
0 → 100644
View file @
e7db6cc3
using
PSManagement.Domain.Identity.Entities
;
using
PSManagement.SharedKernel.Interfaces
;
using
PSManagement.SharedKernel.Repositories
;
using
System.Threading.Tasks
;
namespace
PSManagement.Domain.Identity.Repositories
{
public
interface
IRolesRepository
:
IRepository
<
Role
>
{
public
Task
<
Role
>
GetByRoleName
(
string
roleName
,
ISpecification
<
Role
>
specification
=
null
);
}
}
PSManagement.Domain/Identity/Specification/UserSpecification.cs
0 → 100644
View file @
e7db6cc3
using
PSManagement.Domain.Identity.Entities
;
using
PSManagement.SharedKernel.Specification
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PSManagement.Domain.Identity.Specification
{
public
class
UserSpecification
:
BaseSpecification
<
User
>
{
public
UserSpecification
(
Expression
<
Func
<
User
,
bool
>>
criteria
=
null
)
:
base
(
criteria
)
{
AddInclude
(
u
=>
u
.
Roles
);
AddInclude
(
u
=>
u
.
Employee
);
}
}
}
PSManagement.Domain/Projects/Builders/ProjectBuilder.cs
View file @
e7db6cc3
...
...
@@ -15,7 +15,6 @@ namespace PSManagement.Domain.Projects.Builders
{
private
ProposalInfo
_proposalInfo
;
private
ProjectInfo
_projectInfo
;
private
ProjectStatus
_projectStatus
;
private
FinancialFund
_financialFund
;
private
Aggreement
_projectAggreement
;
...
...
@@ -26,22 +25,57 @@ namespace PSManagement.Domain.Projects.Builders
private
int
_proposerId
;
private
ICollection
<
Step
>
_steps
;
private
ICollection
<
Employee
>
_participants
;
private
ICollection
<
Employee
Participate
>
_participants
;
private
ICollection
<
Attachment
>
_attachments
;
p
ublic
ICollection
<
FinancialSpending
>
FinancialSpending
{
get
;
set
;
}
p
rivate
ICollection
<
FinancialSpending
>
_financialSpending
;
public
ProjectBuilder
WithParticipants
(
ICollection
<
EmployeeParticipate
>
participates
)
{
_participants
=
participates
;
return
this
;
}
public
ProjectBuilder
WithFinancialSpending
(
ICollection
<
FinancialSpending
>
financialSpending
)
{
_financialSpending
=
financialSpending
;
return
this
;
}
public
ProjectBuilder
WithSteps
(
ICollection
<
Step
>
steps
)
{
_steps
=
steps
;
return
this
;
}
public
ProjectBuilder
WithProposalInfo
(
ProposalInfo
proposalInfo
)
{
_proposalInfo
=
proposalInfo
;
return
this
;
}
public
ProjectBuilder
WithTeamLeader
(
int
teamLeaderId
)
{
_teamLeaderId
=
teamLeaderId
;
return
this
;
}
public
ProjectBuilder
WithProjectManager
(
int
projectManagerId
)
{
_projectManagerId
=
projectManagerId
;
return
this
;
}
public
ProjectBuilder
WithExecuter
(
int
executerId
)
{
_executerId
=
executerId
;
return
this
;
}
public
ProjectBuilder
WithProjectInfo
(
ProjectInfo
projectInfo
)
{
_projectInfo
=
projectInfo
;
return
this
;
}
public
ProjectBuilder
WithProposer
(
int
proposerId
)
{
_proposerId
=
proposerId
;
return
this
;
}
public
ProjectBuilder
WithFinancialFund
(
FinancialFund
financialFund
)
{
...
...
@@ -63,7 +97,9 @@ namespace PSManagement.Domain.Projects.Builders
public
Project
Build
()
{
Project
project
=
new
Project
(
_proposalInfo
,
_projectInfo
,
_projectAggreement
,
_proposerId
,
_teamLeaderId
,
_projectManagerId
,
_executerId
);
Project
project
=
new
(
_proposalInfo
,
_projectInfo
,
_projectAggreement
,
_proposerId
,
_teamLeaderId
,
_projectManagerId
,
_executerId
);
project
.
FinancialFund
=
_financialFund
;
if
(
_attachments
is
not
null
)
{
foreach
(
Attachment
attachment
in
_attachments
)
{
...
...
@@ -81,7 +117,15 @@ namespace PSManagement.Domain.Projects.Builders
}
}
if
(
_participants
is
not
null
)
{
foreach
(
EmployeeParticipate
participate
in
_participants
)
{
project
.
EmployeeParticipates
.
Add
(
participate
);
}
}
return
project
;
}
}
...
...
PSManagement.Domain/Projects/DomainErrors/ProjectsErrors.cs
View file @
e7db6cc3
using
PSManagement.SharedKernel.DomainErrors
;
using
ErrorOr
;
using
PSManagement.SharedKernel.DomainErrors
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -9,7 +10,7 @@ namespace PSManagement.Domain.Projects.DomainErrors
{
public
class
ProjectsErrors
{
public
static
DomainError
InvalidEntryError
{
get
;
}
=
new
DomainError
(
"Invalid Project Entry."
,
new
DomainError
(
"Invalid Project Data"
)
);
public
static
Error
InvalidEntryError
{
get
;
}
=
Error
.
Validation
(
"ProjectError.InvalidEntry."
,
"Invalid Project Data"
);
}
}
PSManagement.Domain/Projects/Entities/Project.cs
View file @
e7db6cc3
using
PSManagement.Domain.Customers.
Aggregate
;
using
PSManagement.Domain.Customers.
Entities
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.Projects.ValueObjects
;
using
PSManagement.Domain.ProjectsStatus.Entites
;
...
...
PSManagement.Domain/Projects/Repositories/IProjectsRepository.cs
View file @
e7db6cc3
using
System
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.SharedKernel.Repositories
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -6,7 +8,7 @@ using System.Threading.Tasks;
namespace
PSManagement.Domain.Projects.Repositories
{
public
interface
IProjectsRepository
public
interface
IProjectsRepository
:
IRepository
<
Project
>
{
}
...
...
PSManagement.Domain/Projects/ValueObjects/ProposalInfo.cs
View file @
e7db6cc3
using
PSManagement.Domain.Customers.Aggregate
;
using
System
;
using
System
;
namespace
PSManagement.Domain.Projects.ValueObjects
{
...
...
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