XPhone is an innovative smartphone rental platform, developed in .NET, that offers a flexible and affordable solution for individuals and companies that require cutting-edge mobile devices without the commitment of a purchase.
- .NET 8.0
- PostgreSQL
- Entity Framework
- CQRS
- GIT
To get started, you need to have Visual Studio or any other IDE that supports .NET and PostgreSQL.
- Clone the repository:
git clone <url>
- Restore NuGet packages:
dotnet restore
3.Configure your database
Update your appsettings.json
according you database configurations
4.Create migrations for database
Add-Migration "your migration name"
5.Update your database
update-database
- GetAllClients: Retrieves all clients.
GET /XPhone/Client/GetAllClients
- GetClientById: Retrieves a client by ID.
GET /XPhone/Client/GetClientById/{id}
- AddClient: Adds a new client.
POST /XPhone/Client/AddClient
- UpdateClientById: Updates a client by ID.
PUT /XPhone/Client/UpdateClientById/{id}
- DeleteClientById: Deletes a client by ID.
DELETE /XPhone/Client/DeleteClientById/{id}
- GetAllRents: Retrieves all rents.
GET /XPhone/Rent/GetAllRents
- GetRentById: Retrieves a rent by ID.
GET /XPhone/Rent/GetRentBy{id}
- AddRent: Adds a new rent.
POST /XPhone/Rent/AddRent
- UpdateRent: Updates a rent by ID.
PUT /XPhone/Rent/UpdateRent{id}
- DeleteRent: Deletes a rent by ID.
DELETE /XPhone/Rent/DeleteRent{id}
- GetAllReturns: Retrieves all returns.
GET /XPhone/Return/GetAllReturns
- GetReturn: Retrieves a return by ID.
GET /XPhone/Return/GetReturn{id}
- AddReturn: Adds a new return.
POST /XPhone/Return/AddReturn
- UpdateReturn: Updates a return by ID.
PUT /XPhone/Return/UpdateReturn{id}
- DeleteReturn: Deletes a return by ID.
DELETE /XPhone/Return/DeleteBy{id}
- GetAllSmartPhones: Retrieves all smartphones.
GET /XPhone/SmartPhone/GetAllSmartPhones
- UpdateSmartPhone: Updates a smartphone by ID.
PUT /XPhone/SmartPhone/UpdateSmartPhone{id}
- DeleteSmartPhone: Deletes a smartphone by ID.
DELETE /XPhone/SmartPhone/DeleteBy{id}
- CheckAvailability: Checks if a smartphone is available by ID.
GET /XPhone/SmartPhone/CheckIsAvailable/{id}
- GetAllStocks: Retrieves all stocks.
GET /api/Stock/GetAllStock
- GetStockById: Retrieves a stock by ID.
GET /api/Stock/GetStockById/{id}
- UpdateStock: Updates a stock by ID.
PUT /api/Stock/UpdateStock/{id}
- DeleteStock: Deletes a stock by ID.
DELETE /api/Stock/DeleteStock/{id}
- GetStockCount: Retrieves the count of items in a stock by ID.
GET /api/Stock/GetStockCount/{id}
- AddSmartPhoneToStock: Adds a smartphone to a stock by stock ID.
POST /api/Stock/AddSmartPhoneToStock/{stockId}
- CreateStock: Creates a new stock.
POST /api/Stock/CreateStock