Skip to content

Jasigler/RadioMarket.CategoryService

Repository files navigation

RadioMarket Item Service API

Example 'category' microservice for an e-commerce website.

Table of Contents

About The Project

This is a category microservice for an e-commerce/auction website. This service performs basic CRUD operations for 'auction item' categories. This was separated from the items microservice in order to isolate it from the client as deactivating a category will require the execution of a DB trigger to migrate all associated items to a new category.

A category consists of the following:

  int category_id,
  string name, 
  int? parent_id,
  bool is_active

A category is either a parent or a child/sub-category as denoted by the value of it's parent_id field. A null value is set for all parent categories, and it's category_id will be set as the parent_id of any sub-categories.

The is_active boolean is used as a filter when returning categories. In order to preserve data integrity for future reporting/auditing, etc, categories can simply be deactivated to preserve the item-category relationship.

There are two triggers that execute audit functions when a category is updated, created, or deactivaated. These functions write to an audit table that include the time, action, and user.

Built With

  • ASP .NET Core 3.1
  • Entity Framework Core
  • Npgsql (EF Core extension)
  • Postgres 12

Getting Started

In order to proceed, you need to deploy the Item Microservice first.

Installation

  1. Run The DB migration scripts
cd ./Database
  1. Clone the repo
git clone [email protected]:Jasigler/RadioMarket.ItemService.git
  1. Build the solution
cd RadioMarket.CategoryService\Radiomarket.CategoryService && dotnet build
  1. Run the solution
dotnet run

Usage

Examples of requests and their responses are shown in Postman. Note that the CategoryPath variable is set to: 'https://localhost:1760'.

** Sample data was generated with Datanamic. These generated items might not reflect the intended business domain.

Get all active categories:

Get all active categories

Create a new Category:

Create new

Roadmap

This is an ongoing project. See the open issues for a list of proposed features (and known issues).

Contact

@that_sigler - [email protected]

Project Link: https://github.com/jasigler/repo_name

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published