Commit 1f3c879a authored by hasan.bahjat's avatar hasan.bahjat 💬

update readme and add assets

parent dc02b920
This source diff could not be displayed because it is too large. You can view the blob instead.
# ProjectsController Documentation
## Overview
`ProjectsController` is an API controller in the `PSManagement.Presentation.Controllers.Projects` namespace. This controller is responsible for managing and interacting with project-related functionalities through various endpoints. It leverages the MediatR library for handling commands and queries and uses AutoMapper for object mapping. The controller also integrates with the `ICurrentUserProvider` to access user-specific information for certain operations.
## Routes and Methods
### Queries
1. **Get All Projects**
- **Endpoint:** `GET /api/projects`
- **Description:** Retrieves a list of all projects based on provided filters.
- **Parameters:**
- `ListAllProjectsRequest` - Query parameters to filter the list of projects.
- **Returns:** `IActionResult` - A list of `ProjectDetailsResponse` objects.
2. **Get Project By ID**
- **Endpoint:** `GET /api/projects/{id}`
- **Description:** Retrieves details of a specific project by its ID.
- **Parameters:**
- `id` - The unique identifier of the project.
- **Returns:** `IActionResult` - `ProjectResponse` object.
3. **Get Project Completion**
- **Endpoint:** `GET /api/projects/Completion/{id}`
- **Description:** Retrieves the completion status of a project by its ID.
- **Parameters:**
- `id` - The unique identifier of the project.
- **Returns:** `IActionResult` - `ProjectCompletionResponse` object.
4. **Get Participation Change History**
- **Endpoint:** `GET /api/projects/ParticipationChangeHistory/{id}`
- **Description:** Retrieves the history of participation changes for a project.
- **Parameters:**
- `id` - The unique identifier of the project.
- **Returns:** `IActionResult` - A list of `ParticipationChange` objects.
5. **Get Projects By Filter**
- **Endpoint:** `GET /api/projects/ByFilter`
- **Description:** Retrieves projects based on specified filters.
- **Parameters:**
- `GetProjectsByFilterRequest` - Query parameters for filtering projects.
- **Returns:** `IActionResult` - A list of `ProjectDetailsResponse` objects.
6. **Get Projects By Project Manager**
- **Endpoint:** `GET /api/projects/ByProjectManager`
- **Description:** Retrieves projects managed by a specific project manager.
- **Parameters:**
- `GetProjectsByProjectManagerRequest` - Query parameters for filtering projects by project manager.
- **Returns:** `IActionResult` - A list of `ProjectDetailsResponse` objects.
### Project Management
1. **Change Team Leader**
- **Endpoint:** `PUT /api/projects/ChangeTeamLeader`
- **Description:** Updates the team leader for a specific project.
- **Parameters:**
- `ChangeProjectTeamLeaderRequest` - Request body containing the new team leader details.
- **Returns:** `IActionResult` - Result of the operation.
2. **Change Project Manager**
- **Endpoint:** `PUT /api/projects/ChangeProjectManager`
- **Description:** Updates the project manager for a specific project.
- **Parameters:**
- `ChangeProjectManagerRequest` - Request body containing the new project manager details.
- **Returns:** `IActionResult` - Result of the operation.
### Step Management
1. **Add Project Step**
- **Endpoint:** `POST /api/projects/AddProjectStep`
- **Description:** Adds a new step to a project.
- **Parameters:**
- `AddProjectStepRequest` - Request body containing the step details.
- **Returns:** `IActionResult` - Result of the operation.
### Project State Operations
1. **Approve Project**
- **Endpoint:** `POST /api/projects/ApproveProject`
- **Description:** Approves a project.
- **Parameters:**
- `ApproveProjectRequest` - Request body containing the project approval details.
- **Returns:** `IActionResult` - Result of the operation.
2. **Cancel Project**
- **Endpoint:** `POST /api/projects/CancelProject/{id}`
- **Description:** Cancels a project by its ID.
- **Parameters:**
- `id` - The unique identifier of the project.
- **Returns:** `IActionResult` - Result of the operation.
3. **Complete Project**
- **Endpoint:** `POST /api/projects/CompleteProject`
- **Description:** Marks a project as complete.
- **Parameters:**
- `CompleteProjectRequest` - Request body containing the project completion details.
- **Returns:** `IActionResult` - Result of the operation.
### Participation Management
1. **Get Completion Contributions**
- **Endpoint:** `GET /api/projects/CompletionContributions/{id}`
- **Description:** Retrieves the contribution of employees towards the completion of a project.
- **Parameters:**
- `id` - The unique identifier of the project.
- **Returns:** `IActionResult` - A list of `EmployeeContributionResponse` objects.
2. **Get Participants**
- **Endpoint:** `GET /api/projects/GetParticipants/{id}`
- **Description:** Retrieves the list of participants in a project.
- **Parameters:**
- `id` - The unique identifier of the project.
- **Returns:** `IActionResult` - A list of `EmployeeParticipateResponse` objects.
3. **Add Participant**
- **Endpoint:** `POST /api/projects/AddParticipant`
- **Description:** Adds a participant to a project.
- **Parameters:**
- `AddParticipantRequest` - Request body containing the participant details.
- **Returns:** `IActionResult` - Result of the operation.
4. **Remove Participant**
- **Endpoint:** `POST /api/projects/RemoveParticipant`
- **Description:** Removes a participant from a project.
- **Parameters:**
- `RemoveParticipantRequest` - Request body containing the participant details.
- **Returns:** `IActionResult` - Result of the operation.
5. **Change Participation**
- **Endpoint:** `POST /api/projects/ChangeParticipation`
- **Description:** Changes the participation details of an employee in a project.
- **Parameters:**
- `ChangeEmployeeParticipationRequest` - Request body containing the updated participation details.
- **Returns:** `IActionResult` - Result of the operation.
### Propose
1. **Create Project**
- **Endpoint:** `POST /api/projects`
- **Description:** Proposes and creates a new project.
- **Parameters:**
- `CreateProjectRequest` - Request body containing the project details.
- **Returns:** `IActionResult` - The created `ProjectDetailsResponse` object if successful.
### Attachments Management
1. **Add Attachment**
- **Endpoint:** `POST /api/projects/AddAttachment`
- **Description:** Adds an attachment to a project.
- **Parameters:**
- `AddAttachmentRequest` - Request body containing the attachment details.
- **Returns:** `IActionResult` - Result of the operation.
2. **Remove Attachment**
- **Endpoint:** `POST /api/projects/RemoveAttachment`
- **Description:** Removes an attachment from a project.
- **Parameters:**
- `RemoveAttachmentRequest` - Request body containing the attachment details.
- **Returns:** `IActionResult` - Result of the operation.
3. **Get Attachments**
- **Endpoint:** `GET /api/projects/Attachments`
- **Description:** Retrieves a list of attachments for a project.
- **Parameters:**
- `GetProjectAttachmentsRequest` - Query parameters to filter attachments.
- **Returns:** `IActionResult` - A list of `AttachmentResponse` objects.
4. **Get File By URL**
- **Endpoint:** `GET /api/projects/Attachment`
- **Description:** Retrieves a specific attachment by its URL.
- **Parameters:**
- `GetFileByUrlRequest` - Query parameters containing the URL of the file.
- **Returns:** `IActionResult` - `FileAttachmentResponse` object.
## Dependencies
- **IMediator**: For sending commands and queries.
- **IMapper**: For mapping between request/response DTOs and domain models.
- **ICurrentUserProvider**: For accessing the current user's information.
## Authorization
Some endpoints are restricted to users with specific roles, such as `RolesNames.SCIENTIFIC_DEPUTY`. Ensure proper authorization is implemented to restrict access as needed.
## Error Handling
The controller uses a `HandleResult` method to standardize error handling and result processing, ensuring consistent response formatting across the API.
\ No newline at end of file
# TracksController API Documentation
## Overview
The `TracksController` is responsible for managing and interacting with track entities within the system. It leverages the CQRS (Command Query Responsibility Segregation) pattern and MediatR to handle commands and queries related to track operations. The controller is designed to handle CRUD operations, including track creation, updates, completions, and removals, as well as managing steps and employees associated with tracks.
## Routes
### Base Route
All endpoints are prefixed with `/api/tracks`.
## Queries
### Get Track by ID
**`GET /api/tracks/{id}`**
Retrieves a track by its unique identifier.
**Parameters:**
- `id` (int): The unique identifier of the track.
**Responses:**
- `200 OK`: Returns a `TrackResponse` object if the track is found.
- `404 Not Found`: If the track with the specified ID does not exist.
---
### Get Steps of a Track
**`GET /api/tracks/GetStepsTrack/{id}`**
Fetches all steps associated with a specific track.
**Parameters:**
- `id` (int): The unique identifier of the track.
**Responses:**
- `200 OK`: Returns an array of `StepTrackResponse` objects.
- `404 Not Found`: If no steps are found for the specified track ID.
---
### Get Tracks by Filter
**`GET /api/tracks/ByFilter`**
Retrieves tracks that match specified filter criteria.
**Parameters:**
- Query parameters as defined in `GetTracksByFilterRequest`.
**Responses:**
- `200 OK`: Returns an array of `TrackResponse` objects.
---
### Get Uncompleted Tracks
**`GET /api/tracks/UnCompleted`**
Fetches all tracks that are not yet completed.
**Responses:**
- `200 OK`: Returns an array of `TrackResponse` objects.
---
### Get Employees Track
**`GET /api/tracks/GetEmployeesTrack/{id}`**
Retrieves all employees associated with a specific track.
**Parameters:**
- `id` (int): The unique identifier of the track.
**Responses:**
- `200 OK`: Returns an array of `EmployeeTrackResponse` objects.
---
### Get Tracks by Project
**`GET /api/tracks/GetTracksByProject`**
Retrieves tracks associated with a specific project.
**Parameters:**
- Query parameters as defined in `GetTracksByProjectRequest`.
**Responses:**
- `200 OK`: Returns an array of `TrackResponse` objects.
## Commands
### Add Step to Track
**`POST /api/tracks/AddStepTrack`**
Adds a new step to an existing track.
**Request Body:**
- `AddStepTrackRequest` object.
**Responses:**
- `200 OK`: Returns the ID of the newly added step.
- `400 Bad Request`: If the request is invalid.
---
### Update Step Track
**`PUT /api/tracks/UpdateStepTrack`**
Updates details of an existing step in a track.
**Request Body:**
- `UpdateStepTrackRequest` object.
**Responses:**
- `200 OK`: If the update is successful.
- `404 Not Found`: If the step to update does not exist.
---
### Add Employee to Track
**`POST /api/tracks/AddEmployeeTrack`**
Assigns a new employee to a track.
**Request Body:**
- `AddEmployeeTrackRequest` object.
**Responses:**
- `200 OK`: Returns the ID of the newly added employee track.
- `400 Bad Request`: If the request is invalid.
---
### Update Employee Work Track
**`PUT /api/tracks/UpdateEmployeeWorkTrack`**
Updates the work track details for an employee.
**Request Body:**
- `UpdateEmployeeWorkTrackRequest` object.
**Responses:**
- `200 OK`: If the update is successful.
- `404 Not Found`: If the employee track to update does not exist.
---
### Complete Track
**`POST /api/tracks/CompleteTrack`**
Marks a track as completed.
**Request Body:**
- `CompleteTrackRequest` object.
**Responses:**
- `200 OK`: If the track is successfully marked as completed.
- `404 Not Found`: If the track to complete does not exist.
---
### Remove Track
**`POST /api/tracks/RemoveTrack`**
Removes a track from the system.
**Request Body:**
- `RemoveTrackRequest` object.
**Responses:**
- `200 OK`: If the track is successfully removed.
- `404 Not Found`: If the track to remove does not exist.
---
### Create Track
**`POST /api/tracks`**
Creates a new track.
**Request Body:**
- `CreateTrackRequest` object.
**Responses:**
- `201 Created`: Returns the details of the newly created track.
- `400 Bad Request`: If the request is invalid.
---
## Summary
The `TracksController` provides a comprehensive API for managing tracks and their associated steps and employees. The use of MediatR facilitates command and query separation, ensuring a clean and maintainable architecture. The controller responds with appropriate HTTP status codes and leverages AutoMapper for efficient mapping between request/response models and domain models.
<mxfile host="Electron" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.5 Chrome/126.0.6478.183 Electron/31.3.0 Safari/537.36" version="24.7.5">
<diagram name="Page-1" id="pxZM56T5qr4s6v4I3YPr">
<mxGraphModel dx="880" dy="1632" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="19ftUH5I5akyaUji4UlI-1" value="Project&amp;nbsp;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
<mxGeometry x="305" y="140" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-2" value="Propoing Informatin" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="130" y="320" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-4" value="Financial Fund" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="120" y="460" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-6" value="Project Classification" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="420" y="450" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-7" value="Current State" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="280" y="450" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-8" value="Project Information" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="540" y="320" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-9" value="Aggreement Informatin" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="590" y="450" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-10" value="Project Completion" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="120" y="230" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-14" value="Team Leader" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="580" y="140" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-15" value="Manager" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="600" y="50" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-18" value="" style="group" vertex="1" connectable="0" parent="1">
<mxGeometry x="30" y="130" width="130" height="70" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-12" value="Participatns" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="19ftUH5I5akyaUji4UlI-18">
<mxGeometry width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-17" value="Participatns" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="19ftUH5I5akyaUji4UlI-18">
<mxGeometry x="10" y="10" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-19" value="" style="group" vertex="1" connectable="0" parent="1">
<mxGeometry x="550" y="220" width="130" height="70" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-13" value="Attachements" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="19ftUH5I5akyaUji4UlI-19">
<mxGeometry width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-16" value="Attachements" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="19ftUH5I5akyaUji4UlI-19">
<mxGeometry x="10" y="10" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-20" value="Proposer" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="160" y="-40" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-21" value="Executer" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="35" y="50" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-22" value="Type" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="450" y="-35" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-25" value="" style="group" vertex="1" connectable="0" parent="1">
<mxGeometry x="300" y="-50" width="130" height="70" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-23" value="Type" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="19ftUH5I5akyaUji4UlI-25">
<mxGeometry width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-24" value="Plan" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="19ftUH5I5akyaUji4UlI-25">
<mxGeometry x="10" y="10" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-27" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-22">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="370" y="70" as="sourcePoint" />
<mxPoint x="475" y="50" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="80" />
<mxPoint x="510" y="80" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-28" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-15">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="370" y="140" as="sourcePoint" />
<mxPoint x="470" y="35" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="80" />
<mxPoint x="640" y="80" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-29" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-14">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="380" y="150" as="sourcePoint" />
<mxPoint x="578" y="35" as="targetPoint" />
<Array as="points" />
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-30" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-24">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="390" y="160" as="sourcePoint" />
<mxPoint x="588" y="45" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="60" />
<mxPoint x="365" y="60" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-31" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-20">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="370" y="140" as="sourcePoint" />
<mxPoint x="598" y="55" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-32" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-21">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="370" y="150" as="sourcePoint" />
<mxPoint x="195" y="30" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="80" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-34" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-17">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="330" y="160" as="sourcePoint" />
<mxPoint x="205" y="40" as="targetPoint" />
<Array as="points" />
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-35" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-10">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="395" y="170" as="sourcePoint" />
<mxPoint x="215" y="50" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="250" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-36" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-16">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="319" y="189" as="sourcePoint" />
<mxPoint x="200" y="240" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="250" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-37" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-2">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="380" y="210" as="sourcePoint" />
<mxPoint x="200" y="370" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="350" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-38" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-4">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="339" y="209" as="sourcePoint" />
<mxPoint x="220" y="260" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="410" />
<mxPoint x="190" y="410" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-39" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;entryX=0.417;entryY=0.083;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-7">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="349" y="219" as="sourcePoint" />
<mxPoint x="230" y="270" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="410" />
<mxPoint x="330" y="410" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-40" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-6">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="359" y="229" as="sourcePoint" />
<mxPoint x="240" y="280" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="410" />
<mxPoint x="480" y="410" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-41" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-9">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="369" y="239" as="sourcePoint" />
<mxPoint x="250" y="290" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="410" />
<mxPoint x="650" y="410" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-42" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="19ftUH5I5akyaUji4UlI-1" target="19ftUH5I5akyaUji4UlI-8">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="365" y="180" as="sourcePoint" />
<mxPoint x="570" y="350" as="targetPoint" />
<Array as="points">
<mxPoint x="365" y="350" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-44" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="730" y="400" as="sourcePoint" />
<mxPoint x="830" y="400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="19ftUH5I5akyaUji4UlI-45" value="A Has a Property of type B" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="19ftUH5I5akyaUji4UlI-44">
<mxGeometry x="0.0857" y="7" relative="1" as="geometry">
<mxPoint x="-8" y="-13" as="offset" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
<mxfile host="Electron" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.5 Chrome/126.0.6478.183 Electron/31.3.0 Safari/537.36" version="24.7.5">
<diagram name="Page-1" id="f3Wo72-jtDwKTm8DwNJu">
<mxGraphModel dx="880" dy="532" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="f8_vu8pNupcugpScGw-L-1" value="&lt;font style=&quot;font-size: 10px;&quot;&gt;ParticipationChange Event&lt;/font&gt;" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="250" y="230" width="100" height="100" as="geometry" />
</mxCell>
<mxCell id="f8_vu8pNupcugpScGw-L-2" value="" style="endArrow=classic;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="370" y="280" as="sourcePoint" />
<mxPoint x="470" y="280" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="f8_vu8pNupcugpScGw-L-3" value="Via Medator" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="370" y="250" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="f8_vu8pNupcugpScGw-L-4" value="&lt;font style=&quot;font-size: 10px;&quot;&gt;Employee&amp;nbsp;&lt;/font&gt;&lt;div&gt;&lt;font style=&quot;font-size: 10px;&quot;&gt;Notification Handler&lt;/font&gt;&lt;/div&gt;" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="540" y="310" width="100" height="100" as="geometry" />
</mxCell>
<mxCell id="f8_vu8pNupcugpScGw-L-5" value="&lt;span style=&quot;font-size: 10px;&quot;&gt;History Registeration Handler&lt;/span&gt;" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="540" y="160" width="100" height="100" as="geometry" />
</mxCell>
<mxCell id="f8_vu8pNupcugpScGw-L-6" value="" style="curved=1;endArrow=classic;html=1;rounded=0;" parent="1" target="f8_vu8pNupcugpScGw-L-5" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="480" y="270" as="sourcePoint" />
<mxPoint x="530" y="220" as="targetPoint" />
<Array as="points">
<mxPoint x="530" y="270" />
<mxPoint x="480" y="200" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="f8_vu8pNupcugpScGw-L-7" value="" style="curved=1;endArrow=classic;html=1;rounded=0;" parent="1" target="f8_vu8pNupcugpScGw-L-4" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="470" y="290" as="sourcePoint" />
<mxPoint x="470" y="380" as="targetPoint" />
<Array as="points">
<mxPoint x="490" y="300" />
<mxPoint x="500" y="320" />
<mxPoint x="470" y="369" />
</Array>
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
<mxfile host="Electron" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.5 Chrome/126.0.6478.183 Electron/31.3.0 Safari/537.36" version="24.7.5">
<diagram name="Page-1" id="rR7Wujlv1Vq21LcIZhgL">
<mxGraphModel dx="1730" dy="532" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="CZc0TbBlQpc3luU0NFZk-1" value="Application Layer" style="html=1;dropTarget=0;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="330" y="250" width="180" height="90" as="geometry" />
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-2" value="" style="shape=module;jettyWidth=8;jettyHeight=4;" vertex="1" parent="CZc0TbBlQpc3luU0NFZk-1">
<mxGeometry x="1" width="20" height="20" relative="1" as="geometry">
<mxPoint x="-27" y="7" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-3" value="Infratstructure Layer" style="html=1;dropTarget=0;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="480" y="110" width="180" height="90" as="geometry" />
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-4" value="" style="shape=module;jettyWidth=8;jettyHeight=4;" vertex="1" parent="CZc0TbBlQpc3luU0NFZk-3">
<mxGeometry x="1" width="20" height="20" relative="1" as="geometry">
<mxPoint x="-27" y="7" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-5" value="Domain Layer" style="html=1;dropTarget=0;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="335" y="370" width="180" height="90" as="geometry" />
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-6" value="" style="shape=module;jettyWidth=8;jettyHeight=4;" vertex="1" parent="CZc0TbBlQpc3luU0NFZk-5">
<mxGeometry x="1" width="20" height="20" relative="1" as="geometry">
<mxPoint x="-27" y="7" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-7" value="Presentation Layer" style="html=1;dropTarget=0;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="220" y="110" width="180" height="90" as="geometry" />
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-8" value="" style="shape=module;jettyWidth=8;jettyHeight=4;" vertex="1" parent="CZc0TbBlQpc3luU0NFZk-7">
<mxGeometry x="1" width="20" height="20" relative="1" as="geometry">
<mxPoint x="-27" y="7" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-11" value="Frontend Server" style="html=1;dropTarget=0;whiteSpace=wrap;" vertex="1" parent="1">
<mxGeometry x="-100" y="110" width="180" height="90" as="geometry" />
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-12" value="" style="shape=module;jettyWidth=8;jettyHeight=4;" vertex="1" parent="CZc0TbBlQpc3luU0NFZk-11">
<mxGeometry x="1" width="20" height="20" relative="1" as="geometry">
<mxPoint x="-27" y="7" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-13" value="Reuqest" style="html=1;verticalAlign=bottom;endArrow=block;curved=0;rounded=0;" edge="1" parent="1">
<mxGeometry width="80" relative="1" as="geometry">
<mxPoint x="100" y="140" as="sourcePoint" />
<mxPoint x="180" y="140" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-15" value="Response" style="html=1;verticalAlign=bottom;endArrow=block;curved=0;rounded=0;" edge="1" parent="1">
<mxGeometry width="80" relative="1" as="geometry">
<mxPoint x="180" y="170" as="sourcePoint" />
<mxPoint x="100" y="170" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-19" value="Domain" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
<mxGeometry x="335" y="820" width="150" height="150" as="geometry" />
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-20" value="" style="endArrow=open;endSize=12;dashed=1;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="160" relative="1" as="geometry">
<mxPoint x="410" y="130" as="sourcePoint" />
<mxPoint x="460" y="130" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="CZc0TbBlQpc3luU0NFZk-21" value="dispatch" style="html=1;verticalAlign=bottom;endArrow=block;curved=0;rounded=0;" edge="1" parent="1">
<mxGeometry width="80" relative="1" as="geometry">
<mxPoint x="370" y="220" as="sourcePoint" />
<mxPoint x="380" y="240" as="targetPoint" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
...@@ -65,7 +65,7 @@ By adhering to this layered architecture, ASP.NET Core applications can achieve: ...@@ -65,7 +65,7 @@ By adhering to this layered architecture, ASP.NET Core applications can achieve:
- **Separation of Concerns**: Each layer has a clear responsibility, making the system easier to understand and maintain. - **Separation of Concerns**: Each layer has a clear responsibility, making the system easier to understand and maintain.
- **Testability**: Core business logic is isolated from infrastructure concerns, allowing for easier unit testing. - **Testability**: Core business logic is isolated from infrastructure concerns, allowing for easier unit testing.
- **Flexibility**: Changes in one layer (e.g., switching from SQL Server to MongoDB) have minimal impact on other layers. - **Flexibility**: Changes in one layer (e.g., switching from SQL Server to MongoDB) have minimal impact on other layers.
![alt text](DFDSF.PNG) ![alt text](PSManagement.PSManagement.Assets/DFDSF.PNG)
### **Domain-Driven Design (DDD) in ASP.NET Core** ### **Domain-Driven Design (DDD) in ASP.NET Core**
...@@ -106,12 +106,12 @@ By applying these methodologies in ASP.NET Core, developers can build applicatio ...@@ -106,12 +106,12 @@ By applying these methodologies in ASP.NET Core, developers can build applicatio
___ ___
## Solution Components ## Solution Components
### General Overview ### General Overview
![alt text](assets/General.drawio.svg) ![alt text](PSManagement.Assets/General.drawio.svg)
### Soltuion Architecture ### Soltuion Architecture
the solution to achive the requirement has 8 projects the solution to achive the requirement has 8 projects
and one prpject for teting the architecture as shown below in the figure and one prpject for teting the architecture as shown below in the figure
![alt text](<assets/Screenshot 2024-08-31 111558.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-31 111558.png>)
the source code are as the follow : the source code are as the follow :
1. Domain Layer achoved by domain project 1. Domain Layer achoved by domain project
...@@ -127,7 +127,7 @@ As its defined by " a concept from Domain-Driven Design (DDD) that refers to a p ...@@ -127,7 +127,7 @@ As its defined by " a concept from Domain-Driven Design (DDD) that refers to a p
in our solution we use it to put our absttraction in its. in our solution we use it to put our absttraction in its.
this figure show it this figure show it
![alt text](<assets/Screenshot 2024-08-29 221715.png>) ![alt text](</PSManagement.Assets/Screenshot 2024-08-29 221715.png>)
its contain the following folders its contain the following folders
...@@ -167,14 +167,14 @@ so in the domain layer we have 7 folders one for each domain and we have a folde ...@@ -167,14 +167,14 @@ so in the domain layer we have 7 folders one for each domain and we have a folde
as shown in the figure below : as shown in the figure below :
![alt text](<assets/Screenshot 2024-08-29 212124.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-29 212124.png>)
and as we say we have a similar archs in each folder becuse of the design principles and as we say we have a similar archs in each folder becuse of the design principles
so the figure below show this arch in each domain: so the figure below show this arch in each domain:
![alt text](<assets/Screenshot 2024-08-29 204830.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-29 204830.png>)
so in each folder (mean a Domain we have the follwing folder ) so in each folder (mean a Domain we have the follwing folder )
...@@ -228,7 +228,7 @@ this layer and as shown in the figure below have to main parts : ...@@ -228,7 +228,7 @@ this layer and as shown in the figure below have to main parts :
this abstraction ahcived by contracts fro this operation (Interfaces) this abstraction ahcived by contracts fro this operation (Interfaces)
![alt text](<assets/Screenshot 2024-08-29 182735.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-29 182735.png>)
### Use Cases Encapsulation ### Use Cases Encapsulation
in this layer we use the follwoing patternse : in this layer we use the follwoing patternse :
...@@ -263,19 +263,19 @@ and each domain consist of the folwoing architecture: ...@@ -263,19 +263,19 @@ and each domain consist of the folwoing architecture:
as shown in figure below as shown in figure below
![alt text](<assets/Screenshot 2024-08-29 182927.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-29 182927.png>)
__ __
the figure below show how we implement the CQRS the figure below show how we implement the CQRS
![alt text](<assets/Screenshot 2024-08-29 183327.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-29 183327.png>)
events handlers Ex. events handlers Ex.
![alt text](<assets/Screenshot 2024-08-29 183414.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-29 183414.png>)
__ __
**Note** **Note**
...@@ -314,7 +314,7 @@ this folder contain interfaces for the follwoing servise : ...@@ -314,7 +314,7 @@ this folder contain interfaces for the follwoing servise :
the figure below show this folders the figure below show this folders
![alt text](<assets/Screenshot 2024-08-29 182850.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-29 182850.png>)
___ ___
...@@ -327,9 +327,9 @@ and the second for implement the contracts in the application layer and it shoul ...@@ -327,9 +327,9 @@ and the second for implement the contracts in the application layer and it shoul
as shown in the figure below as shown in the figure below
![alt text](<assets/Screenshot 2024-08-29 232828.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-29 232828.png>)
![alt text](<assets/Screenshot 2024-08-29 232900.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-29 232900.png>)
the service layer conatin a real implementation for the integration of the employee data the service layer conatin a real implementation for the integration of the employee data
and contain only dummy implementation of bringing the data. and contain only dummy implementation of bringing the data.
...@@ -362,14 +362,14 @@ the presentaion layer contain three projects ...@@ -362,14 +362,14 @@ the presentaion layer contain three projects
contracts project contracts project
![alt text](assets/imageerdf.png) ![alt text](PSManagement.Assets/imageerdf.png)
Presentation proejct Presentation proejct
![alt text](assets/imageeer.png) ![alt text](PSManagement.Assets/imageeer.png)
API Dependency Config in its project API Dependency Config in its project
![alt text](assets/image.png) ![alt text](PSManagement.Assets/image.png)
...@@ -401,18 +401,18 @@ Naming convention tests ensure that commands and queries are named descriptively ...@@ -401,18 +401,18 @@ Naming convention tests ensure that commands and queries are named descriptively
## for dependency test (layer test) ## for dependency test (layer test)
we do the test that shown in the image and its success we do the test that shown in the image and its success
![alt text](<assets/Screenshot 2024-08-31 090622.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-31 090622.png>)
and we do test for tme naming convention inapplcation and we do test for tme naming convention inapplcation
like all command should have suffix command like all command should have suffix command
and the same for event query and its handlers and the same for event query and its handlers
![alt text](<assets/Screenshot 2024-08-31 090506.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-31 090506.png>)
and a test for the doamin layer naming convention for events and repositories. and a test for the doamin layer naming convention for events and repositories.
![alt text](<assets/Screenshot 2024-08-31 090540.png>) ![alt text](<PSManagement.Assets/Screenshot 2024-08-31 090540.png>)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment