account-api.js 3.46 KB

module.exports.accountPayables = async (req, res) => {
    console.log('===== GET accountPayables =====')
    console.log('url', req.originalUrl);
    console.log('headers', req.headers);
    console.log('query', req.query);
    console.log('params', req.params);
    console.log('body', req.body);

    let response = {
        "link": {
            "prev": "ip:port/sgl/api/v1/accounting-management/accounting?transactionId=$transactionId&page=$page&limit=$limit&sortby=$sortby",
            "next": "ip:port/sgl/api/v1/accounting-management/accounting?transactionId=$transactionId&page=$page&limit=$limit&sortby=$sortby"
        },
        "meta": {
            "currentPage": 1,
            "totalPages": 1,
            "limit": 10
        },
        "total": 4,
        "results": [
            {
                "_id": "ia09igfyJD3",
                "vendorCode": "6100103130",
                "accountName": "บริษัท เคเอสไอ โซลูชั่น จำกัด",
                "partnerBank": "0001",
                "tradingPartner": "",
                "branch": "00000",
                "taxId": "0105556143098",
                "memberId": "BKAz9K097bT",
                "createdBy": "System",
                "createdDate": "2022-06-20T08:52:08.655Z",
                "updatedBy": "System",
                "updatedDate": "2022-06-20T08:52:08.655Z"
            }
            // ,
            // {
            //     "_id": "LkStgv7Pqjv",
            //     "vendorCode": "7100000010",
            //     "accountName": "บจ.แอดวานซ์ ไวร์เลส เน็ทเวอร์ค",
            //     "partnerBank": null,
            //     "tradingPartner": "1200",
            //     "branch": "00000",
            //     "memberId": "7tZlEVVBDiq",
            //     "createdBy": "System",
            //     "createdDate": "2021-06-22T09:51:37.907Z",
            //     "updatedBy": "System",
            //     "updatedDate": "2021-06-22T09:51:37.907Z",
            //     "taxId": "0105548115897"
            // },
            // {
            //     "_id": "u2fc0do5gaB",
            //     "vendorCode": "6300000003",
            //     "accountName": "บจ.เกมมี่",
            //     "partnerBank": "0601",
            //     "tradingPartner": "",
            //     "branch": "00001",
            //     "memberId": "suVHEKylHuq",
            //     "createdBy": "System",
            //     "createdDate": "2021-05-21T09:51:37.907Z",
            //     "updatedBy": "System",
            //     "updatedDate": "2021-05-21T09:51:37.907Z",
            //     "taxId": "1234567891113"
            // },
            // {
            //     "_id": "NEqCwA4l9Cv",
            //     "vendorCode": "7100000030",
            //     "accountName": "แอดวานซ์ ไวร์เลส เน็ทเวอร์ค",
            //     "partnerBank": "0001",
            //     "tradingPartner": "",
            //     "branch": "00000",
            //     "taxId": "0105548115897",
            //     "memberId": "VsIsSNY9peQ",
            //     "createdBy": "System",
            //     "createdDate": "2022-09-26T06:52:42.875Z",
            //     "updatedBy": "System",
            //     "updatedDate": "2022-09-26T06:52:42.875Z"
            // }
        ]
    }


    // let response = {
    //     "resultCode":"40109",
    //     "resultDescription":"Authentication failed. Invalid username or password"
    // }

    res.send(response)
}