Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Add List Available Document Types service
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih committed Jul 13, 2021
1 parent 5598e05 commit fefc729
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@storefront-api/platform-abstract": "1.0.0-rc.3",
"@storefront-api/platform-magento1": "1.0.0-rc.3",
"@storefront-api/platform-magento2": "1.0.0-rc.3",
"@adempiere/grpc-api": "1.6.0",
"@adempiere/grpc-api": "1.6.1",
"@adempiere/grpc-web-store-api": "1.4.1",
"ajv": "^6.4.0",
"ajv-keywords": "^3.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,46 @@ module.exports = ({ config, db }) => {
}
});

/**
* GET List Available Document Types
*
* req.query.token - user token
* req.query.page_size - custom page size for batch
* req.query.page_token - specific page token
* req.query.pos_uuid - POS UUID reference
* Details:
*/
api.get('/available-document-types', (req, res) => {
if (req.query) {
service.listAvailableDocumentTypes({
token: req.query.token,
language: req.query.language,
posUuid: req.query.pos_uuid,
// Page Data
pageSize: req.query.page_size,
pageToken: req.query.page_token
}, function (err, response) {
if (response) {
res.json({
code: 200,
result: {
record_count: response.getRecordCount(),
next_page_token: response.getNextPageToken(),
records: response.getDocumentTypesList().map(documentType => {
return convertListValue(documentType)
})
}
})
} else if (err) {
res.json({
code: 500,
result: err.details
})
}
})
}
});

/**
* GET List Available Tender Types
*
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
striptags "^3.0.1"
word-wrap "^1.2.1"

"@adempiere/[email protected].0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@adempiere/grpc-api/-/grpc-api-1.6.0.tgz#98742d5e71856868fb909f1a67ebba6febb04789"
integrity sha512-v/Eq7hP+fhZlurVBegHcg1kIpnZOaoHhBvHthUsDnqtVTgqL3AiZbbEOpK0z7wFoy8joggFD6u3Ayp/Dy7VWyg==
"@adempiere/[email protected].1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@adempiere/grpc-api/-/grpc-api-1.6.1.tgz#e4abf7e0ec72b0496437f5251995cb391f501e28"
integrity sha512-zot/s77r7188GkZnJeI0tu1EwMyoBFYUFzF961EhD2GSuxWsPy/r4YQnkLtpg27/TeL7nR0RxPi1enc6rW81Ig==
dependencies:
"@grpc/grpc-js" "^1.2.12"
google-protobuf "^3.15.6"
Expand Down

0 comments on commit fefc729

Please sign in to comment.