Example 'category' microservice for an e-commerce website.
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.
- ASP .NET Core 3.1
- Entity Framework Core
- Npgsql (EF Core extension)
- Postgres 12
In order to proceed, you need to deploy the Item Microservice first.
- Run The DB migration scripts
cd ./Database
- Clone the repo
git clone [email protected]:Jasigler/RadioMarket.ItemService.git
- Build the solution
cd RadioMarket.CategoryService\Radiomarket.CategoryService && dotnet build
- Run the solution
dotnet run
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.
This is an ongoing project. See the open issues for a list of proposed features (and known issues).
@that_sigler - [email protected]
Project Link: https://github.com/jasigler/repo_name