/XPhone

XPhone is an innovative smartphone rental web platform, developed in .NET, the main goal is to manage smartphone rental through end point and requisitions

Primary LanguageC#

XPhone

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.

Technologies

  • .NET 8.0
  • PostgreSQL
  • Entity Framework
  • CQRS
  • GIT

Getting Started

To get started, you need to have Visual Studio or any other IDE that supports .NET and PostgreSQL.

Installation

  1. Clone the repository:
    git clone <url>
  2. 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

Endpoints

ClientController

  • 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}

RentController

  • 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}

ReturnController

  • 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}

SmartPhoneController

  • 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}

StockController

  • 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

Contributing

Contributions are welcome! Feel free to open issues and pull requests.

License

This project is licensed under the MIT License.