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
ebb68b8b
Commit
ebb68b8b
authored
Aug 15, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix s.
parent
49ba44c1
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1361 additions
and
35 deletions
+1361
-35
FinancialSpending.cs
...ment.Domain/FinancialSpends/Entities/FinancialSpending.cs
+23
-0
FinancialSpendingSpecification.cs
...ialSpends/Specification/FinancialSpendingSpecification.cs
+20
-0
ProjectBuilder.cs
PSManagement.Domain/Projects/Builders/ProjectBuilder.cs
+0
-1
StepsErrors.cs
PSManagement.Domain/Projects/DomainErrors/StepsErrors.cs
+12
-0
Project.cs
PSManagement.Domain/Projects/Entities/Project.cs
+0
-1
IProjectsRepository.cs
...ement.Domain/Projects/Repositories/IProjectsRepository.cs
+2
-2
StepSpecification.cs
...gement.Domain/Projects/Specification/StepSpecification.cs
+14
-0
StepTrack.cs
PSManagement.Domain/Tracking/Entities/StepTrack.cs
+3
-0
ProjectStatus.cs
PSManagement.Domain/XProjectsStatus/Entites/ProjectStatus.cs
+0
-13
IProjectStatusRepository.cs
.../XProjectsStatus/Repositories/IProjectStatusRepository.cs
+0
-10
AppDbContext.cs
...Infrastructure.Persistence/AppDataContext/AppDbContext.cs
+3
-0
DependencyInjection.cs
...ment.Infrastructure.Persistence/DI/DependencyInjection.cs
+3
-0
ProjectEntityConfiguration.cs
...tence/EntitiesConfiguration/ProjectEntityConfiguration.cs
+1
-1
20240815101812_FixSomeIssues.Designer.cs
...tence/Migrations/20240815101812_FixSomeIssues.Designer.cs
+1158
-0
20240815101812_FixSomeIssues.cs
...re.Persistence/Migrations/20240815101812_FixSomeIssues.cs
+91
-0
AppDbContextModelSnapshot.cs
...cture.Persistence/Migrations/AppDbContextModelSnapshot.cs
+6
-4
FinancialSpendingRepository.cs
...sitories/ProjectRepository/FinancialSpendingRepository.cs
+13
-0
ProjectsRepository.cs
...ence/Repositories/ProjectRepository/ProjectsRepository.cs
+3
-2
ILoggableCommand.cs
PSManagement.SharedKernel/CQRS/Commands/ILoggableCommand.cs
+8
-0
BaseSpecification.cs
PSManagement.SharedKernel/Specification/BaseSpecification.cs
+1
-1
No files found.
PSManagement.Domain/FinancialSpends/Entities/FinancialSpending.cs
View file @
ebb68b8b
...
...
@@ -6,6 +6,29 @@ namespace PSManagement.Domain.FinancialSpends.Entities
{
public
class
FinancialSpending
:
BaseEntity
{
public
FinancialSpending
()
{
}
public
FinancialSpending
(
int
projectId
,
int
localPurchase
,
Money
externalPurchase
,
string
costType
,
string
description
,
DateTime
expectedSpendingDate
)
{
ProjectId
=
projectId
;
LocalPurchase
=
localPurchase
;
ExternalPurchase
=
externalPurchase
;
CostType
=
costType
;
Description
=
description
;
ExpectedSpendingDate
=
expectedSpendingDate
;
}
public
int
ProjectId
{
get
;
set
;
}
public
DateTime
ExpectedSpendingDate
{
get
;
set
;
}
public
string
CostType
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
...
...
PSManagement.Domain/FinancialSpends/Specification/FinancialSpendingSpecification.cs
0 → 100644
View file @
ebb68b8b
using
PSManagement.Domain.FinancialSpends.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.FinancialSpends.Specification
{
public
class
FinancialSpendingSpecification
:
BaseSpecification
<
FinancialSpending
>
{
public
FinancialSpendingSpecification
(
Expression
<
Func
<
FinancialSpending
,
bool
>>
criteria
=
null
)
:
base
(
criteria
)
{
}
}
}
PSManagement.Domain/Projects/Builders/ProjectBuilder.cs
View file @
ebb68b8b
...
...
@@ -3,7 +3,6 @@ using PSManagement.Domain.FinancialSpends.Entities;
using
PSManagement.Domain.Projects.DomainEvents
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Projects.ValueObjects
;
using
PSManagement.Domain.ProjectsStatus.Entites
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
PSManagement.Domain/Projects/DomainErrors/StepsErrors.cs
0 → 100644
View file @
ebb68b8b
using
PSManagement.SharedKernel.DomainErrors
;
namespace
PSManagement.Domain.Projects.DomainErrors
{
public
class
StepsErrors
{
public
static
DomainError
InvalidEntryError
{
get
;
}
=
new
(
"StepError.InvalidEntry."
,
"Invalid Step Data"
);
public
static
DomainError
InvalidWeightError
{
get
;
}
=
new
(
"StepError.WeightEror"
,
"the Step weight incompatible"
);
public
static
DomainError
InvalidCompletionRatioError
{
get
;
}
=
new
(
"StepError.CompleteionRatioEror"
,
"the Step Completion Ratio Entered is incompatible"
);
}
}
PSManagement.Domain/Projects/Entities/Project.cs
View file @
ebb68b8b
...
...
@@ -2,7 +2,6 @@
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.FinancialSpends.Entities
;
using
PSManagement.Domain.Projects.ValueObjects
;
using
PSManagement.Domain.ProjectsStatus.Entites
;
using
PSManagement.Domain.ProjectTypes.Entities
;
using
PSManagement.Domain.Tracking
;
using
PSManagement.SharedKernel.Aggregate
;
...
...
PSManagement.Domain/Projects/Repositories/IProjectsRepository.cs
View file @
ebb68b8b
...
...
@@ -13,10 +13,10 @@ namespace PSManagement.Domain.Projects.Repositories
{
public
interface
IProjectsRepository
:
IRepository
<
Project
>
{
public
IEnumerable
<
EmployeeParticipate
>
GetProjectParticipants
(
int
projectId
);
public
IEnumerable
<
EmployeeParticipate
>
GetProjectParticipants
(
int
projectId
,
ISpecification
<
Project
>
specification
=
null
);
public
IEnumerable
<
Step
>
GetProjectPlan
(
int
projectId
);
public
IEnumerable
<
Track
>
GetProjectTracks
(
int
projectId
);
}
}
PSManagement.Domain/Projects/Specification/StepSpecification.cs
0 → 100644
View file @
ebb68b8b
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.SharedKernel.Specification
;
using
System
;
using
System.Linq.Expressions
;
namespace
PSManagement.Domain.Projects
{
public
class
StepSpecification
:
BaseSpecification
<
Step
>
{
public
StepSpecification
(
Expression
<
Func
<
Step
,
bool
>>
criteria
=
null
)
:
base
(
criteria
)
{
}
}
}
PSManagement.Domain/Tracking/Entities/StepTrack.cs
View file @
ebb68b8b
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.SharedKernel.Entities
;
using
System
;
using
System.Collections.Generic
;
namespace
PSManagement.Domain.Tracking.Entities
...
...
@@ -10,6 +11,8 @@ namespace PSManagement.Domain.Tracking.Entities
public
Step
Step
{
get
;
set
;
}
public
int
TrackId
{
get
;
set
;
}
public
Track
Track
{
get
;
set
;
}
public
String
ExecutionState
{
get
;
set
;
}
public
int
ExecutionRatio
{
get
;
set
;
}
//public ICollection<EmployeeWork> EmployeeWorks { get; set; }
public
StepTrack
()
...
...
PSManagement.Domain/XProjectsStatus/Entites/ProjectStatus.cs
deleted
100644 → 0
View file @
49ba44c1
using
PSManagement.SharedKernel.Entities
;
namespace
PSManagement.Domain.ProjectsStatus.Entites
{
public
class
ProjectStatus
:
BaseEntity
{
public
string
Name
{
get
;
set
;
}
public
string
Details
{
get
;
set
;
}
public
string
Code
{
get
;
set
;
}
}
}
PSManagement.Domain/XProjectsStatus/Repositories/IProjectStatusRepository.cs
deleted
100644 → 0
View file @
49ba44c1
using
PSManagement.Domain.ProjectsStatus.Entites
;
using
PSManagement.SharedKernel.Repositories
;
namespace
PSManagement.Domain.ProjectsStatus.Repositories
{
public
interface
IProjectStatusRepository
:
IRepository
<
ProjectStatus
>
{
}
}
PSManagement.Infrastructure.Persistence/AppDataContext/AppDbContext.cs
View file @
ebb68b8b
using
Microsoft.EntityFrameworkCore
;
using
PSManagement.Domain.Customers.Entities
;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.FinancialSpends.Entities
;
using
PSManagement.Domain.Identity.Entities
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Reports.Entities
;
...
...
@@ -27,6 +28,8 @@ namespace PSManagement.Infrastructure.Persistence
public
DbSet
<
Employee
>
Employees
{
get
;
set
;
}
public
DbSet
<
Department
>
Departments
{
get
;
set
;
}
public
DbSet
<
Project
>
Projects
{
get
;
set
;
}
public
DbSet
<
FinancialSpending
>
FinancialSpendings
{
get
;
set
;
}
public
DbSet
<
Step
>
Steps
{
get
;
set
;
}
public
DbSet
<
Track
>
Tracks
{
get
;
set
;
}
...
...
PSManagement.Infrastructure.Persistence/DI/DependencyInjection.cs
View file @
ebb68b8b
...
...
@@ -3,6 +3,8 @@ using Microsoft.Extensions.Configuration;
using
Microsoft.Extensions.DependencyInjection
;
using
PSManagement.Domain.Customers.Repositories
;
using
PSManagement.Domain.Employees.Repositories
;
using
PSManagement.Domain.FinancialSpends.Entities
;
using
PSManagement.Domain.FinincialSpending.Repositories
;
using
PSManagement.Domain.Identity.Repositories
;
using
PSManagement.Domain.Projects.Builders
;
using
PSManagement.Domain.Projects.Repositories
;
...
...
@@ -33,6 +35,7 @@ namespace PSManagement.Infrastructure.Persistence.DI
services
.
AddScoped
<
IRolesRepository
,
RolesRepository
>();
services
.
AddScoped
<
IEmployeesRepository
,
EmployeesRespository
>();
services
.
AddScoped
<
IStepsRepository
,
StepsRepository
>();
services
.
AddScoped
<
IFinancialSpendingRepository
,
FinancialSpendingRepository
>();
services
.
AddScoped
<
ProjectBuilder
>();
...
...
PSManagement.Infrastructure.Persistence/EntitiesConfiguration/ProjectEntityConfiguration.cs
View file @
ebb68b8b
...
...
@@ -66,7 +66,7 @@ namespace PSManagement.Infrastructure.Persistence.EntitiesConfiguration
builder
.
Property
(
p
=>
p
.
CurrentState
).
HasDefaultValue
(
"Proposed"
);
builder
.
HasMany
(
e
=>
e
.
Attachments
).
WithOne
().
HasForeignKey
(
e
=>
e
.
ProjectId
);
builder
.
HasMany
(
e
=>
e
.
FinancialSpending
);
builder
.
HasMany
(
e
=>
e
.
FinancialSpending
)
.
WithOne
().
HasForeignKey
(
e
=>
e
.
ProjectId
)
;
builder
.
HasMany
(
e
=>
e
.
Tracks
).
WithOne
(
e
=>
e
.
Project
).
HasForeignKey
(
e
=>
e
.
ProjectId
);
}
...
...
PSManagement.Infrastructure.Persistence/Migrations/20240815101812_FixSomeIssues.Designer.cs
0 → 100644
View file @
ebb68b8b
This diff is collapsed.
Click to expand it.
PSManagement.Infrastructure.Persistence/Migrations/20240815101812_FixSomeIssues.cs
0 → 100644
View file @
ebb68b8b
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
public
partial
class
FixSomeIssues
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropForeignKey
(
name
:
"FK_FinancialSpending_Projects_ProjectId"
,
table
:
"FinancialSpending"
);
migrationBuilder
.
DropPrimaryKey
(
name
:
"PK_FinancialSpending"
,
table
:
"FinancialSpending"
);
migrationBuilder
.
RenameTable
(
name
:
"FinancialSpending"
,
newName
:
"FinancialSpendings"
);
migrationBuilder
.
RenameIndex
(
name
:
"IX_FinancialSpending_ProjectId"
,
table
:
"FinancialSpendings"
,
newName
:
"IX_FinancialSpendings_ProjectId"
);
migrationBuilder
.
AlterColumn
<
int
>(
name
:
"ProjectId"
,
table
:
"FinancialSpendings"
,
type
:
"int"
,
nullable
:
false
,
defaultValue
:
0
,
oldClrType
:
typeof
(
int
),
oldType
:
"int"
,
oldNullable
:
true
);
migrationBuilder
.
AddPrimaryKey
(
name
:
"PK_FinancialSpendings"
,
table
:
"FinancialSpendings"
,
column
:
"Id"
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_FinancialSpendings_Projects_ProjectId"
,
table
:
"FinancialSpendings"
,
column
:
"ProjectId"
,
principalTable
:
"Projects"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Cascade
);
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropForeignKey
(
name
:
"FK_FinancialSpendings_Projects_ProjectId"
,
table
:
"FinancialSpendings"
);
migrationBuilder
.
DropPrimaryKey
(
name
:
"PK_FinancialSpendings"
,
table
:
"FinancialSpendings"
);
migrationBuilder
.
RenameTable
(
name
:
"FinancialSpendings"
,
newName
:
"FinancialSpending"
);
migrationBuilder
.
RenameIndex
(
name
:
"IX_FinancialSpendings_ProjectId"
,
table
:
"FinancialSpending"
,
newName
:
"IX_FinancialSpending_ProjectId"
);
migrationBuilder
.
AlterColumn
<
int
>(
name
:
"ProjectId"
,
table
:
"FinancialSpending"
,
type
:
"int"
,
nullable
:
true
,
oldClrType
:
typeof
(
int
),
oldType
:
"int"
);
migrationBuilder
.
AddPrimaryKey
(
name
:
"PK_FinancialSpending"
,
table
:
"FinancialSpending"
,
column
:
"Id"
);
migrationBuilder
.
AddForeignKey
(
name
:
"FK_FinancialSpending_Projects_ProjectId"
,
table
:
"FinancialSpending"
,
column
:
"ProjectId"
,
principalTable
:
"Projects"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Restrict
);
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/AppDbContextModelSnapshot.cs
View file @
ebb68b8b
...
...
@@ -130,14 +130,14 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
b
.
Property
<
int
>(
"LocalPurchase"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
?
>(
"ProjectId"
)
b
.
Property
<
int
>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"FinancialSpending"
);
b
.
ToTable
(
"FinancialSpending
s
"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Entities.Permission"
,
b
=>
...
...
@@ -721,7 +721,9 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
null
)
.
WithMany
(
"FinancialSpending"
)
.
HasForeignKey
(
"ProjectId"
);
.
HasForeignKey
(
"ProjectId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
OwnsOne
(
"PSManagement.SharedKernel.ValueObjects.Money"
,
"ExternalPurchase"
,
b1
=>
{
...
...
@@ -742,7 +744,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
b1
.
HasKey
(
"FinancialSpendingId"
);
b1
.
ToTable
(
"FinancialSpending"
);
b1
.
ToTable
(
"FinancialSpending
s
"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"FinancialSpendingId"
);
...
...
PSManagement.Infrastructure.Persistence/Repositories/ProjectRepository/FinancialSpendingRepository.cs
0 → 100644
View file @
ebb68b8b
using
PSManagement.Domain.FinancialSpends.Entities
;
using
PSManagement.Domain.FinincialSpending.Repositories
;
using
PSManagement.Infrastructure.Persistence.Repositories.Base
;
namespace
PSManagement.Infrastructure.Persistence.Repositories.ProjectRepository
{
public
class
FinancialSpendingRepository
:
BaseRepository
<
FinancialSpending
>,
IFinancialSpendingRepository
{
public
FinancialSpendingRepository
(
AppDbContext
context
)
:
base
(
context
)
{
}
}
}
PSManagement.Infrastructure.Persistence/Repositories/ProjectRepository/ProjectsRepository.cs
View file @
ebb68b8b
...
...
@@ -19,10 +19,11 @@ namespace PSManagement.Infrastructure.Persistence.Repositories.ProjectRepository
{
}
public
IEnumerable
<
EmployeeParticipate
>
GetProjectParticipants
(
int
projectId
)
public
IEnumerable
<
EmployeeParticipate
>
GetProjectParticipants
(
int
projectId
,
ISpecification
<
Project
>
specification
)
{
return
_dbContext
.
Projects
.
Where
(
p
=>
p
.
Id
==
projectId
).
FirstOrDefault
()?
.
EmployeeParticipates
.
AsEnumerable
();
return
ApplySpecification
(
specification
).
Where
(
p
=>
p
.
Id
==
projectId
).
FirstOrDefault
()
.
EmployeeParticipates
.
AsEnumerable
();
}
...
...
PSManagement.SharedKernel/CQRS/Commands/ILoggableCommand.cs
0 → 100644
View file @
ebb68b8b
using
MediatR
;
namespace
PSManagement.SharedKernel.CQRS.Command
{
public
interface
ILoggableCommand
<
out
TResponse
>
:
ICommand
<
TResponse
>
{
}
}
PSManagement.SharedKernel/Specification/BaseSpecification.cs
View file @
ebb68b8b
...
...
@@ -15,7 +15,7 @@ namespace PSManagement.SharedKernel.Specification
}
public
Expression
<
Func
<
T
,
bool
>>
Criteria
{
get
;
set
;
}
public
List
<
Expression
<
Func
<
T
,
object
>>>
Includes
{
get
;
}
=
new
List
<
Expression
<
Func
<
T
,
object
>>>();
public
List
<
string
>
IncludeStrings
{
get
;
}
=
new
List
<
string
>();
public
List
<
string
>
IncludeStrings
{
get
;
set
;
}
=
new
List
<
string
>();
public
Expression
<
Func
<
T
,
object
>>
OrderBy
{
get
;
private
set
;
}
public
Expression
<
Func
<
T
,
object
>>
OrderByDescending
{
get
;
private
set
;
}
...
...
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