Skip to content

Latest commit

 

History

History
154 lines (112 loc) · 5.25 KB

api-doc.md

File metadata and controls

154 lines (112 loc) · 5.25 KB

Product Service

Create a Product

POST /product
Parameters - Parameter
Name Type Description
name string required

name of the product

price number required

price of the product

userId number required

id of the user creating the product

ShortDesc string optional

short description of the product

Get List of Products

GET /products

Get a Product

GET /product/:productId

Update a Product

PUT /product/:productId
Parameters - Parameter
Name Type Description
name string optional

name of the product

price number optional

price of the product

ShortDesc string optional

short description of the product

Delete a Product

DELETE /product/:productId

Order Service

Create an Order

POST /order
Parameters - Parameter
Name Type Description
User number required

user to whom the order belongs to

Product Array<number> required

List of the product ids in the order

Address string required

users address where the order should be shipped

Get List of Orders

GET /order

Get an Order

GET /order/:orderId

Update an order

PATCH /order/:orderId/address
PATCH /order/:orderId/product
PATCH /order/:orderId/status
Parameters - Parameter
Name Type Description
Address string required

users address where the order should be shipped

Product Array<number> required

List of the product ids in the order

Status enum required

ORDER_PLACED ORDER_ON_ROUTE ORDER_DELIVERED

Delete an Order

DELETE /order/:orderId

Order Service Event Consumers

Consume Product.Created event from product service

POST /consume/product/created
Parameters - Parameter
Name Type Description
Id string required

id of the product

Name string required

name of the product

UserId number required

id of the user creating the product

Price number required

price of the product

ShortDesc string optional

short description of the product

CreatedAt datetime optional

product created date

UpdatedAt datetime optional

product updated date

Consume Product.Updated event from product service

POST /consume/product/updated
Parameters - Parameter
Name Type Description
Id string required

id of the product

Name string required

name of the product

UserId number required

id of the user creating the product

Price number required

price of the product

ShortDesc string optional

short description of the product

CreatedAt datetime optional

product created date

UpdatedAt datetime optional

product updated date

Consume Product.Deleted event from product service

POST /consume/product/deleted
Parameters - Parameter
Name Type Description
Id string required

id of the product

Name string required

name of the product

UserId number required

id of the user creating the product

Price number required

price of the product

ShortDesc string optional

short description of the product

CreatedAt datetime optional

product created date

UpdatedAt datetime optional

product updated date