###### tags: `Back-end`,`Restful API`,`ASP.NET CORE`,`Aon`,`Capstone Project`
# Week 06 - Capstone Project - Client Functionalities
## Task 06
### Registeration Changes
**CR1 - Registeration has to steps**:
1. Expose new endpoint to receive phone number only:
- When the user first initiates registration by submitting their phone number, create a temporary User record with just the phone number.
- OTP Verification Step: Once the OTP is verified, update the flag on the User record. This confirms that the user has access to the phone number they provided and is a step towards securing the registration flow.
2. Complete Profile After Verification: After OTP verification, the user provides their full profile details (e.g., full name and password) through the registration completion endpoint. At this stage:
- Update the existing User record with their full name and securely hashed password.
- Mark the user as fully registered in your system.

**CR2 - View Profile**:
`api/mobile/v1/users/{Id}/profile`
* Input is Id of the user that we want to visit
* Response should include the following details:
* Id
* Name
* Company Name
* Phone Number
* Email
* About(This should be added as new column)
* Project History: List of project
* Each Project should have:
- Id, Name
- Start and End Date(after freelancer complete it)
- Description of the project

### Client Endpoint - Post Project
**CR3 - View Profile**:
- Post Project:
Inputs:
- Title( Max 512, required)
- Description( nullable, Max 1024)
- QualificationName (string, allow values only as shown in the screenshots)
- Duration (days, int)
- Budget (decimal, Min 0)
- PriceType: `PerHour`, `Fixed`
#### Project Entity Update
- Add `freelancerId` as FK to project model.
- Add `Status` (default is `Available`), `Closed` when freelancer will be assigned later.
### Client Endpoint - List all projects as feed page for client
**CR4 - View Profile**:
Load all the available projects, below should be implemnented:
- Search functionality
- Pagination
- Filteration
endpoint:
`api/mobile/v1/projects/feed?pageSize=x&pageNumber=y&search_query=ss&
qual=Front-end,Back-end,UIUX`
Project details should have:
- Title, Descrption, Status, Budget, Image, Duration,
- Qualifications, Dates
- Prices
- Creation Time property should be appended the response to represent as "1 hour ago"
### Upload image with Post Project (Bonus)
**CR5 - View Profile**:
* Search for:
* "How to upload an image file in .NET Core 8 REST API"
* "Handling file uploads with IFormFile in ASP.NET Core 8"
* "Save image to server in ASP.NET Core"
* Key Steps to Research:
* Create an API endpoint that accepts an image file as a POST request.
* Use IFormFile to handle the uploaded image.
* Save the file to the server (e.g., in a directory within the project).
* Store file metadata in the database: Look for examples that include saving the image file’s path or name as a reference in a database record associated with a project or user.
* Additional Tips:
* Search for handling file validation (e.g., format, size) and returning the image path or URL as part of the API response.