Giter VIP home page Giter VIP logo

order-api's Introduction

Your assignment is to create and fetch sale orders

Add sale order api should have these parameter to add order:

customerId, orderNo, companyId, orderDate, shipmentDate, customerNote, total, taxes, grandTotal, list_of_items(productId, quantity, unitPrice, tax, amount), status(default pending), paymentStatus, packedStatus, shipStatus, deliveryStatus, fromQuotation

Response expected status:0 for failed & status: 1 for success

After creating add-sale-order API then create getSaleOrders API

Order detail with list on items in order.

Response expected [list of order containing list of items]

Make these two APIs till evening. Technologies should be NodeJs & MySQL Database. You're free to use any library or framework.

You need to submit your code and schema of your database & we are expecting you to submit this assignment till evening.

ADD ORDER :

ENDPONT

http://localhost:5000/api/v1/order/add

*METHOD * : POST

BODY

{
    "customerId":"1",
    "companyId":"1",
    "orderDate":"12-12-2020",
    "orderNumber":"345678",
    "shipmentDate":"12-12-2020",
    "customerNote":"This is customer note",
    "total":"12",
    "taxes":"12",
    "grandTotal":"12",
    "paymentStatus":true,
    "packedStatus":true,
    "shipStatus":false,
    "deliveryStatus":false,
    "fromQuotation":"I don't know what is this?",
    "items":[
        {
        "productId":"11",
        "quantity":1,
        "unitPrice":100,
        "tax":10,
        "amount":110
    },
    {   
        "productId":"1",
        "quantity":1,
        "unitPrice":100,
        "tax":10,
        "amount":110
    }
    ]
}

FETCH ORDER :

ENDPONT

http://localhost:5000/api/v1/orders

*METHOD * : GET

RESPONSE

{
    "status": 1,
    "message": "Orders Found",
    "data": [
        {
            "id": 2,
            "orderNumber": 345678,
            "orderDate": "2020-12-11T18:30:00.000Z",
            "shipmentDate": "2020-12-11T18:30:00.000Z",
            "customerNote": "This is customer note",
            "total": "12",
            "taxes": "12",
            "grandTotal": "12",
            "paymentStatus": true,
            "packedStatus": true,
            "shipStatus": false,
            "deliveryStatus": false,
            "fromQuotation": "I don't know what is this?",
            "createdAt": "2022-12-22T10:08:17.000Z",
            "updatedAt": "2022-12-22T10:08:17.000Z",
            "customerId": 1,
            "companyId": 1,
            "OrderdProducts": [
                {
                    "id": 1,
                    "quantity": 1,
                    "unitPrice": 100,
                    "tax": 10,
                    "amount": 110,
                    "createdAt": "2022-12-22T10:08:17.000Z",
                    "updatedAt": "2022-12-22T10:08:17.000Z",
                    "orderId": 2
                },
                {
                    "id": 2,
                    "quantity": 1,
                    "unitPrice": 100,
                    "tax": 10,
                    "amount": 110,
                    "createdAt": "2022-12-22T10:08:17.000Z",
                    "updatedAt": "2022-12-22T10:08:17.000Z",
                    "orderId": 2
                }
            ]
        }
    ]
}

order-api's People

Contributors

mufazmi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.