Skip to content

Repository files navigation

Created by: Alexandre Fortes Tondello

SGRN

This API application is a proposal for the implementation of a job that validates and runs Rules for a Business Rules Management System.

How it works

The SGRN API is built using the Nest.js framework, which is a powerful and scalable Node.js framework. It uses a relational database (SQLite) to store its data. The API follows RESTful principles and offers an endpoint to execute Business Rules every time a new Order is placed.

Endpoints

The API offers the following endpoints:

API Endpoints:

  1. GET /:orderId - Runs Business Rules for all Products related to the Order's Id
Parameter Type Description Example
orderId number (Required) ID of the Order that was placed 1

How to use it

To run the SGRN API locally, follow these steps:

  1. Install Node.js (Version 18 is recommended)
  2. Clone this repository to your local machine
  3. Navigate to the project's directory: cd sgrn-test
  4. Install package dependencies: npm install

Running the Server

  1. Start the API server:
npm run start:dev

The API server will now be running at http://localhost:3000.

You can use tools like Postman or curl to test the API endpoint. But since the only endpoint is a GET endpoint, you can algo test it in you browser. Open any web browser and go to the following address: http://localhost:3000/1

Other Information

Automated Tests

Unit tests and Integration tests are written for all major functions and application flows. SQLite is also being used in the tests, making it possible to validade database operations instead of mocking them.

To run automated tests:

npm run test

Thank you

Thank you for using SGRN API! Happy coding! 🚀

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages