Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
PSManagementUI
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
PSManagementUI
Commits
e81337ba
Commit
e81337ba
authored
Aug 22, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add project serivce
parent
93f2c422
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
265 additions
and
1 deletion
+265
-1
addAttachmentRequest.ts
.../models/requests/project-requests/addAttachmentRequest.ts
+6
-0
addParticipantRequest.ts
...models/requests/project-requests/addParticipantRequest.ts
+8
-0
addProjectStepRequest.ts
...models/requests/project-requests/addProjectStepRequest.ts
+10
-0
cancelProjectRequest.ts
.../models/requests/project-requests/cancelProjectRequest.ts
+7
-0
changeProjectManagerRequest.ts
.../requests/project-requests/changeProjectManagerRequest.ts
+5
-0
changeProjectTeamLeaderRequest.ts
...quests/project-requests/changeProjectTeamLeaderRequest.ts
+4
-0
createProjectRequest.ts
.../models/requests/project-requests/createProjectRequest.ts
+0
-0
getProjectAttachmentsRequest.ts
...requests/project-requests/getProjectAttachmentsRequest.ts
+5
-0
getProjectsByProjectManagerRequest.ts
...ts/project-requests/getProjectsByProjectManagerRequest.ts
+5
-0
rePlanProjectRequest.ts
.../models/requests/project-requests/rePlanProjectRequest.ts
+3
-0
removeParticipant.ts
...cts/models/requests/project-requests/removeParticipant.ts
+4
-0
changeStepWeightRequest.ts
.../models/requests/step-requests/changeStepWeightRequest.ts
+7
-0
getStepTrackHistoryRequest.ts
...dels/requests/step-requests/getStepTrackHistoryRequest.ts
+5
-0
getStepsByProjectRequest.ts
...models/requests/step-requests/getStepsByProjectRequest.ts
+6
-0
updateCompletionRatioRequest.ts
...ls/requests/step-requests/updateCompletionRatioRequest.ts
+5
-0
Attachment.ts
src/app/projects/models/responses/Attachment.ts
+6
-0
project.ts
src/app/projects/models/responses/project.ts
+0
-1
project.service.ts
src/app/projects/services/project.service.ts
+179
-0
No files found.
src/app/projects/models/requests/project-requests/addAttachmentRequest.ts
0 → 100644
View file @
e81337ba
export
interface
AddAttachmentRequest
{
projectId
:
number
;
attachmentDescription
:
string
;
attachmentName
:
string
;
file
:
File
;
}
src/app/projects/models/requests/project-requests/addParticipantRequest.ts
0 → 100644
View file @
e81337ba
export
interface
AddParticipantRequest
{
projectId
:
number
;
participantId
:
number
;
partialTimeRatio
:
number
;
role
:
string
;
}
src/app/projects/models/requests/project-requests/addProjectStepRequest.ts
0 → 100644
View file @
e81337ba
import
{
StepInfo
}
from
"../../valueObjects/StepInfo"
;
export
class
AddProjectStepRequest
{
projectId
:
number
;
stepInfo
:
StepInfo
;
currentCompletionRatio
:
number
;
weight
:
number
;
}
src/app/projects/models/requests/project-requests/cancelProjectRequest.ts
0 → 100644
View file @
e81337ba
export
interface
CancelProjectRequest
{
employeeId
:
number
projectId
:
number
}
src/app/projects/models/requests/project-requests/changeProjectManagerRequest.ts
0 → 100644
View file @
e81337ba
export
interface
ChangeProjectManagerRequest
{
employeeId
:
number
;
projectId
:
number
;
}
src/app/projects/models/requests/project-requests/changeProjectTeamLeaderRequest.ts
0 → 100644
View file @
e81337ba
export
interface
ChangeProjectTeamLeaderRequest
{
employeeId
:
number
;
projectId
:
number
;
}
src/app/projects/models/requests/createProjectRequest.ts
→
src/app/projects/models/requests/
project-requests/
createProjectRequest.ts
View file @
e81337ba
File moved
src/app/projects/models/requests/project-requests/getProjectAttachmentsRequest.ts
0 → 100644
View file @
e81337ba
export
interface
GetProjectAttachmentsRequest
{
projectId
:
number
;
pageNumber
:
number
|
null
;
pageSize
:
number
|
null
;
}
src/app/projects/models/requests/project-requests/getProjectsByProjectManagerRequest.ts
0 → 100644
View file @
e81337ba
export
interface
GetProjectsByProjectManagerRequest
{
projectMangerId
:
number
;
pageNumber
:
number
|
null
;
pageSize
:
number
|
null
;
}
src/app/projects/models/requests/project-requests/rePlanProjectRequest.ts
0 → 100644
View file @
e81337ba
export
interface
RePlanProjectRequest
{
projectId
:
number
;
}
src/app/projects/models/requests/project-requests/removeParticipant.ts
0 → 100644
View file @
e81337ba
export
interface
RemoveParticipantRequest
{
ParticipantId
:
number
;
projectId
:
number
;
}
src/app/projects/models/requests/step-requests/changeStepWeightRequest.ts
0 → 100644
View file @
e81337ba
export
interface
ChangeStepWeightRequest
{
stepId
:
number
weight
:
number
}
src/app/projects/models/requests/step-requests/getStepTrackHistoryRequest.ts
0 → 100644
View file @
e81337ba
export
class
GetStepTrackHistoryRequest
{
stepId
:
number
;
pageSize
:
number
|
null
;
pageNumber
:
number
|
null
;
}
src/app/projects/models/requests/step-requests/getStepsByProjectRequest.ts
0 → 100644
View file @
e81337ba
export
class
GetStepsByProjectRequest
{
projectId
:
number
;
pageSize
:
number
|
null
;
pageNumber
:
number
|
null
;
}
src/app/projects/models/requests/step-requests/updateCompletionRatioRequest.ts
0 → 100644
View file @
e81337ba
export
class
UpdateCompletionRatioRequest
{
stepId
:
number
;
completionRatio
:
number
;
}
src/app/projects/models/responses/Attachment.ts
0 → 100644
View file @
e81337ba
export
interface
Attachment
{
projectId
:
number
;
attachmentUrl
:
string
;
attachmentDescription
:
string
;
attachmentName
:
string
;
}
src/app/projects/models/responses/project.ts
View file @
e81337ba
...
...
@@ -8,7 +8,6 @@ import { ProposalInfo } from "../valueObjects/proposalInfo"
import
{
ProjectClassification
}
from
"../valueObjects/ProjectClassification"
import
{
Department
}
from
"./Department"
import
{
Step
}
from
"./Step"
export
class
Project
{
id
:
number
...
...
src/app/projects/services/project.service.ts
View file @
e81337ba
...
...
@@ -4,6 +4,18 @@ import { ConfigurationService } from '../../core/services/configuration/configur
import
{
Project
}
from
'../models/responses/project'
;
import
{
Result
}
from
'../../core/models/result'
;
import
{
Observable
}
from
'rxjs'
;
import
{
GetProjectsByProjectManagerRequest
}
from
'../models/requests/project-requests/GetProjectsByProjectManagerRequest'
;
import
{
EmployeeParticipate
}
from
'../../employees/models/responses/employeeParticipate'
;
import
{
ChangeProjectTeamLeaderRequest
}
from
'../models/requests/project-requests/ChangeProjectTeamLeaderRequest'
;
import
{
ChangeProjectManagerRequest
}
from
'../models/requests/project-requests/ChangeProjectManagerRequest'
;
import
{
AddProjectStepRequest
}
from
'../models/requests/project-requests/AddProjectStepRequest'
;
import
{
RemoveParticipantRequest
}
from
'../models/requests/project-requests/RemoveParticipant'
;
import
{
AddParticipantRequest
}
from
'../models/requests/project-requests/AddParticipantRequest'
;
import
{
CancelProjectRequest
}
from
'../models/requests/project-requests/CancelProjectRequest'
;
import
{
RePlanProjectRequest
}
from
'../models/requests/project-requests/RePlanProjectRequest'
;
import
{
CreateProjectRequest
}
from
'../models/requests/project-requests/createProjectRequest'
;
import
{
AddAttachmentRequest
}
from
'../models/requests/project-requests/AddAttachmentRequest'
;
import
{
Attachment
}
from
'../models/responses/Attachment'
;
@
Injectable
({
providedIn
:
'root'
...
...
@@ -12,14 +24,181 @@ export class ProjectService {
constructor
(
private
http
:
HttpClient
,
private
config
:
ConfigurationService
)
{
}
//#region queries
// the filters options are
// -- department name
// -- first name
// -- project manager
// -- team leader
// --
public
getByFilter
():
Observable
<
Project
[]
>
{
return
this
.
http
.
get
<
Project
[]
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/ByFilter"
);
}
public
getAll
(
pageSize
:
number
|
null
,
pageNumber
:
number
|
null
):
Observable
<
Project
[]
>
{
let
pagination
=
this
.
getPagination
(
pageSize
,
pageNumber
);
return
this
.
http
.
get
<
Project
[]
>
(
this
.
config
.
getServerUrl
()
+
"/Projects"
+
pagination
);
}
// this method reponsible for geting the specificed projet by its id
//
public
getProjectById
(
id
:
number
):
Observable
<
Project
>
{
return
this
.
http
.
get
<
Project
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/"
+
id
);
}
// this method retreive the projects by its manager
public
getByProjectManger
(
request
:
GetProjectsByProjectManagerRequest
):
Observable
<
Project
[]
>
{
let
pagination
=
this
.
getPagination
(
request
.
pageSize
,
request
.
pageNumber
);
return
this
.
http
.
get
<
Project
[]
>
(
`
${
this
.
config
.
getServerUrl
()}
/Projects/ByProjectManager/?projectManagerId=
${
request
.
projectMangerId
}${
pagination
}
`
);
}
//#endregion queries
//#region planning managment
//tihs method responsible for hanging the team leader
//
public
changeTeamLeader
(
request
:
ChangeProjectTeamLeaderRequest
):
Observable
<
void
>
{
return
this
.
http
.
post
<
void
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/ChangeProjectTeamLeader"
,
request
);
}
//tihs method responsible for changing the project manager
//
public
changeProjectManager
(
request
:
ChangeProjectManagerRequest
):
Observable
<
void
>
{
return
this
.
http
.
post
<
void
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/ChangeProjectManager"
,
request
);
}
//tihs method responsible for add a new step to the project
//
public
addStepToProject
(
request
:
AddProjectStepRequest
):
Observable
<
number
>
{
return
this
.
http
.
post
<
number
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/AddProjetStep"
,
request
);
}
//#endregion planning managment
//#region participants managment
// this method responsible for get the participants of a project
//
public
getParticipants
(
projectId
:
number
):
Observable
<
EmployeeParticipate
[]
>
{
return
this
.
http
.
get
<
EmployeeParticipate
[]
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/GetParticipants/"
+
projectId
);
}
//tihs method responsible for remove a participant of the project
//
public
removeParticipant
(
request
:
RemoveParticipantRequest
):
Observable
<
void
>
{
return
this
.
http
.
post
<
void
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/RemoveParticipant"
,
request
);
}
//tihs method responsible for adda new participant to the project
//
public
addParticipant
(
request
:
AddParticipantRequest
):
Observable
<
void
>
{
return
this
.
http
.
post
<
void
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/AddParticipant"
,
request
);
}
//#endregion participants managment
//#region state management
//tihs method responsible for change the state of the project from in plan to in progresss
//
public
approveProject
(
projectId
:
number
):
Observable
<
void
>
{
return
this
.
http
.
post
<
void
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/ApproveProject"
,{
projectId
});
}
//tihs method responsible for cancel the project
//
public
cancelProject
(
request
:
CancelProjectRequest
):
Observable
<
void
>
{
return
this
.
http
.
post
<
void
>
(
`
${
this
.
config
.
getServerUrl
()}
/Projects/CancelProject/
${
request
.
projectId
}
`
,
request
);
}
//tihs method responsible for changing the state of the project from in progress to in plan
//
public
rePlanProject
(
request
:
RePlanProjectRequest
):
Observable
<
void
>
{
return
this
.
http
.
post
<
void
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/RePlanProject"
,
request
);
}
//tihs method responsible for changing the state of the project to completed
//
public
completeProject
(
projectId
:
number
):
Observable
<
void
>
{
return
this
.
http
.
post
<
void
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/CompleteProject/"
+
projectId
,{});
}
//tihs method responsible for creating a new project
//
public
createProject
(
request
:
CreateProjectRequest
):
Observable
<
Project
>
{
return
this
.
http
.
post
<
Project
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/"
,
request
);
}
//#endregion state management
//#region attachments
//tihs method responsible for adding an atachment to the project
//
public
addAttachment
(
request
:
AddAttachmentRequest
):
Observable
<
number
>
{
return
this
.
http
.
post
<
number
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/AddAttachment"
,
request
);
}
//tihs method responsible for getting the attachments of a project
//
public
getAttachment
(
projectId
:
number
):
Observable
<
Attachment
[]
>
{
return
this
.
http
.
get
<
Attachment
[]
>
(
this
.
config
.
getServerUrl
()
+
"/Projects/Attachmetns/"
+
projectId
);
}
//#endregion attachments
//#region pagination convert
private
getPagination
(
pageSize
:
number
|
null
,
pageNumber
:
number
|
null
){
if
(
pageNumber
==
null
||
pageSize
==
null
){
return
""
;
}
else
{
return
`&pageSize=
${
pageSize
}
&PageNumber=
${
pageNumber
}
`
;
}
}
//#endregion pagination convert
}
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