Skip to content

rianbar/SpringBoot_Challenge02_TEAM_D

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-COMMERCE PROJECT ☕

Hi everyone, i would like to present a project that was done by my internship group, this project consists of a ecommerce based on a microservice architecture. Well, we have three microservice connect by feign and they all have great importance in the operation of the application.

MS-ORDERS 🚲

Endpoints:

CREATE_ORDER: localhost:8000/orders
GET_ORDER_BY_ID: localhost:8000/orders/{id}
CANCEL_ORDER: localhost:8000/orders/{id}/cancel
UPDATE_ORDER: localhost:8000/orders/{id}
GET_ALL_ORDERS: localhost:8000/orders

Request payload to create order:

{
    "products": [
        {
            "productId": 6,
            "quantity": 2
        },
        {
            "productId": 3,
            "quantity": 1
        }
    ],
    "address": {
        "street": "Av. do Alemão",
        "number": 2,
        "postalCode": "65919-2701"
    },
    "paymentMethod": "PIX"
}

Note

product IDs in products list must exists in database and the postalCode can be real beacause it uses geradordecep API to find the real postal code and bring all the informations.
PaymentMethod field can only be CREDIT_CARD, BANK_TRANSFER, CRYPTOCURRENCY, GIFT_CARD, PIX or OTHER.

Resquest payload to cancel order:

{
    "cancelReason": "message"
}

Important

If the order that you want to cancel has status field as SENT or the creation date exceeds 90 days, you cannot cancel that order. The payload of the update endpoint is the same as the creation one, but if the order you want to update has a status of SENT or CANCELED, you can update it.

MS-PRODUCTS 👜

Endpoints:

CREATE_PRODUCT: localhost:8080/products
GET_PRODUCT_BY_ID: localhost:8080/products/{id}
DELETE_PRODUCT: localhost:8080/products/{id}
UPDATE_PRODUCT: localhost:8080/products/{id}
GET_ALL_PRODUCTS: localhost:8080/products

Request payload to insert product:

{
    "name": "shadow t-shirt2",
    "description": "very well tshit",
    "value": 15
}

Note

The description must be more than 10 characteres.
No field can be empty or null.
Update payload is the same as create product but you have to add an id.

MS-FEEDBACKS 🔔

Endpoints:

CREATE_FEEDBACK: localhost:8100/feedbacks
GET_FEEDBACK_BY_ID: localhost:8100/feedbacks/{id}
DELETE_FEEDBACK: localhost:8100/feedbacks/{id}
UPDATE_FEEDBACK: localhost:8100/feedbacks/{id}
GET_ALL_FEEDBACKS: localhost:8100/feedbacks

Request payload to create a feedback:

{
    "scale": "SATISFIED",
    "comment": "very good product",
    "orderId": 80
}

Note

The field orderId must represent a real id in order database.
Update payload is the same as create product but you have to add an id.
The rest of endpoint don't require any type of payload.

Warning

If you choose to run the project manually, i recommend running the order microservice first to avoid problems.

Tools used in this app 🔧:

MySQL Spring Java Apache Maven Docker

About

Week VIII - CompassUOL Challenge - own fork

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%