Add barcode scanner integration, identifier lookup, and enhanced field mapping for label creation
This commit is contained in:
@@ -68,6 +68,18 @@ function normalizeUpsertResponse(payload) {
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeIdentifierLookupResponse(payload) {
|
||||
return {
|
||||
status: payload?.status || null,
|
||||
source: payload?.source || null,
|
||||
cacheHit: Boolean(payload?.cache_hit),
|
||||
identifierCode: payload?.identifier_code || null,
|
||||
identifierType: payload?.identifier_type || null,
|
||||
item: payload?.item || null,
|
||||
payloadFetchedAt: payload?.payload_fetched_at || null,
|
||||
};
|
||||
}
|
||||
|
||||
export async function previewItemUpsert(store, body) {
|
||||
const payload = await apiRequest(store, `${getPath('items')}/upsert`, {
|
||||
method: 'POST',
|
||||
@@ -88,6 +100,17 @@ export async function applyItemUpsert(store, body) {
|
||||
return normalizeUpsertResponse(payload);
|
||||
}
|
||||
|
||||
export async function lookupItemByIdentifier(store, identifierCode) {
|
||||
const payload = await apiRequest(store, `${getPath('items')}/lookup`, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
identifier_code: String(identifierCode || '').trim(),
|
||||
},
|
||||
});
|
||||
|
||||
return normalizeIdentifierLookupResponse(payload);
|
||||
}
|
||||
|
||||
export async function updateStockItem(store, uuidB64, body) {
|
||||
const payload = await apiRequest(store, `${getPath('items')}/${uuidB64}/stock`, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user