Skip to content
Nikola edited this page Jul 2, 2020 · 10 revisions

Description

This project is simulating a Property Management System (PMS) API. The system allows the Hotel managers to update the existing hotels, add new ones, add rooms to a hotel, add specific amenities to both rooms and hotels, and add an existing hotel to the chain of hotels.

The API platform is using the CQRS principle which allows the scalability, fast and precise error handling, and easy implementation to other platforms.

Every command and query are written as interfaces so the developer can easily switch different implementation without breaking the existing codebase.

Packages used:

Architecture

  • Domain class library - Holds all the entities that are related to the business logic of the application.
  • DataAccess - EntityFramework implementation of the domain entities. Code-first approach when creating a database.
  • Application - Contains application use-cases. Every application action (use-case) is an interface that needs to be implemented.
  • Implementation - Implements all the interfaces from the Application using Entity Framework.
  • API - API application that is injecting the implemented actions using service container and dependency injection.

Information

Every relation between domain entities (many to one, one to one, many to many).

Created DTO classes for client <---> server transfer.

Automapper profiles (with nested mapping).

Logging every application action to the database (logs can be searched).

Server-side validation of every entity and every use case using FluentValidation. Validating on every POST/PATCH/PUT request. Every entity GET method is searchable.

Every GET ALL method is returning a paged response which allows the user to manipulate the desired results, and see the info about the returned data (how many items per page, total count, etc...). This was achieved using an extension method to generate a Paged response object in order for the code to be DRY.

Email is being sent after the creation of the new user (although email credentials are not set due to the public repository).

Global exception handler that is catching the exceptions and sending the users a nicer error message.

Database

db diagram

Clone this wiki locally