u
This commit is contained in:
@@ -261,6 +261,15 @@ export function register(app, basePath = '') {
|
|||||||
const onlyUnpaid = req.query.onlyUnpaid === 'true';
|
const onlyUnpaid = req.query.onlyUnpaid === 'true';
|
||||||
const onlyUndelivered = req.query.onlyUndelivered === 'true';
|
const onlyUndelivered = req.query.onlyUndelivered === 'true';
|
||||||
|
|
||||||
|
let entityId = undefined;
|
||||||
|
if (req.query.entityId !== undefined && req.query.entityId !== '') {
|
||||||
|
const parsedEntity = parseInt(req.query.entityId, 10);
|
||||||
|
if (!Number.isInteger(parsedEntity) || parsedEntity <= 0) {
|
||||||
|
return res.status(400).json({ error: 'entityId must be a positive integer' });
|
||||||
|
}
|
||||||
|
entityId = parsedEntity;
|
||||||
|
}
|
||||||
|
|
||||||
let seekMonths = undefined;
|
let seekMonths = undefined;
|
||||||
if (req.query.seekMonths !== undefined && req.query.seekMonths !== '') {
|
if (req.query.seekMonths !== undefined && req.query.seekMonths !== '') {
|
||||||
const parsedSeek = parseInt(req.query.seekMonths, 10);
|
const parsedSeek = parseInt(req.query.seekMonths, 10);
|
||||||
@@ -277,6 +286,7 @@ export function register(app, basePath = '') {
|
|||||||
search,
|
search,
|
||||||
onlyUnpaid: onlyUnpaid ? true : undefined,
|
onlyUnpaid: onlyUnpaid ? true : undefined,
|
||||||
onlyUndelivered: onlyUndelivered ? true : undefined,
|
onlyUndelivered: onlyUndelivered ? true : undefined,
|
||||||
|
entityId,
|
||||||
seekMonths,
|
seekMonths,
|
||||||
});
|
});
|
||||||
res.status(200).json(result);
|
res.status(200).json(result);
|
||||||
|
|||||||
@@ -245,6 +245,15 @@ export function register(app, basePath = '') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let entityId = undefined;
|
||||||
|
if (req.query.entityId !== undefined && req.query.entityId !== '') {
|
||||||
|
const parsedEntity = parseInt(req.query.entityId, 10);
|
||||||
|
if (!Number.isInteger(parsedEntity) || parsedEntity <= 0) {
|
||||||
|
return res.status(400).json({ error: 'entityId must be a positive integer' });
|
||||||
|
}
|
||||||
|
entityId = parsedEntity;
|
||||||
|
}
|
||||||
|
|
||||||
const search = typeof req.query.search === 'string' && req.query.search.trim() !== ''
|
const search = typeof req.query.search === 'string' && req.query.search.trim() !== ''
|
||||||
? req.query.search.trim()
|
? req.query.search.trim()
|
||||||
: undefined;
|
: undefined;
|
||||||
@@ -263,6 +272,7 @@ export function register(app, basePath = '') {
|
|||||||
offset,
|
offset,
|
||||||
limit,
|
limit,
|
||||||
search,
|
search,
|
||||||
|
entityId,
|
||||||
seekMonths,
|
seekMonths,
|
||||||
});
|
});
|
||||||
res.status(200).json(result);
|
res.status(200).json(result);
|
||||||
|
|||||||
@@ -265,7 +265,8 @@ export function register(app, basePath = '') {
|
|||||||
* summary: List shipments
|
* summary: List shipments
|
||||||
* description: |
|
* description: |
|
||||||
* Company-wide paginated list of shipment manifests (`manifest` rows with `type = 'shipment'`)
|
* Company-wide paginated list of shipment manifests (`manifest` rows with `type = 'shipment'`)
|
||||||
* with delivery state, package tracking info, and order references.
|
* with delivery state,
|
||||||
|
entityId, package tracking info, and order references.
|
||||||
* security:
|
* security:
|
||||||
* - cookieAuth: []
|
* - cookieAuth: []
|
||||||
* parameters:
|
* parameters:
|
||||||
|
|||||||
Reference in New Issue
Block a user