Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kravse/fulfilment-api
Just a fun project to see if I can build a quick fulfilment api in NodeJS.
https://github.com/kravse/fulfilment-api
Last synced: 14 days ago
JSON representation
Just a fun project to see if I can build a quick fulfilment api in NodeJS.
- Host: GitHub
- URL: https://github.com/kravse/fulfilment-api
- Owner: kravse
- Created: 2020-12-17T02:57:41.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-18T23:21:23.000Z (about 4 years ago)
- Last Synced: 2024-12-23T19:52:13.382Z (21 days ago)
- Language: TypeScript
- Size: 116 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fullfillment api
## Get Started:
1. Install packages with `npm install`
2. Start the local server with `npm start`## Orders / Restocks:
While the server is running, modify the `init()` function in `Main.ts`
### Initialize a catalogue:
```js
Inventory.init_catalogue(sampleInventory);
```
### Add a restock:
```js
Inventory.process_restock(restock);
```
### Process an order
```js
Orders.process_orders(order);
```## Known Issues
* This would do well with some testing.
* Lacks a robust response handler. Would like to see properly formatted responses with error codes etc.
* Endpoints assume that data will be properly formatted. This will obviously not always be the case.
* The `process_orders()` function in the orders service could use some refactoring to make it more readable and elegant.
* The TypeScript type declarations could use a bit of improvement. They're a bit lacking.
* It'd be great to have a revolving user input function that gets user inputs on the command line.