/PriceNegotiationAPI

💲 Web API platform for price negotiations between customers and employees of an online store.

Primary LanguageC#

PriceNegotiationAPI

This web application serves as a platform for price negotiations between customers and employees of an online store. Customers can propose a price for a product, and employees have the ability to accept or reject the proposal. Built using CLEAN architecture and containerized using Docker for ease of use.

Technologies

  • .NET 7
  • MSSQL Server
  • Dapper
  • MediatR
  • Xunit
  • Fluent Validations
  • Serilog
  • Clean Architecture

Architecture

The application follows the principles of Clean Architecture, emphasizing separation of concerns and maintainability. It's organized into distinct layers:

image

Layers:

  • Presentation Layer: Responsible for handling API requests and responses.
  • Infrastructure Layer: Manages external concerns like database access, adhering to interfaces defined in the Domain layer.
  • Application Layer: Contains the business logic, including negotiation processes and product catalog management.
  • Domain Layer: Holds the core business entities and logic, ensuring independence from external concerns.

Database Overview

The application utilizes MSSQL Server Docker image for data storage. The database schema comprises tables for product catalog, negotiation details, and any necessary additional entities.

image

API Endpoints

Products Endpoint:

image

Negotiation Endpoint:

image

User Endpoint:

image

Launch Instructions

To run the application locally:

  1. Clone the repository.

  2. Create and run a container using docker-compose located in my project.

  3. Set up the MSSQL Server database using command below:

    docker exec -it pricenegotiationdb /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Password123 -i /sql-scripts/init-script.sql

  4. Access the API endpoints through a tool like Postman or via your browser.

(default port is set to 5000 so you can access swagger by going to: localhost:5000/swagger)