Overview
Assets should have scannable QR codes and barcodes for physical tagging. Scanning a QR code should instantly open the asset detail page. This issue generates QR/barcode images at asset creation and provides a lookup endpoint so mobile scanners can resolve the asset from a raw barcode value.
Context
qrcode@1.5.4 is already installed (used by 2FA in BE-13) — the same library can generate asset QR codes
- Barcodes can use
bwip-js or jsbarcode — evaluate and install the lighter option
- The QR code payload should encode the asset's detail page URL:
${FRONTEND_URL}/assets/{assetId}
- QR/barcode images should be stored in S3 (using
FileService from BE-06), not as base64 blobs in the DB
Acceptance Criteria
Overview
Assets should have scannable QR codes and barcodes for physical tagging. Scanning a QR code should instantly open the asset detail page. This issue generates QR/barcode images at asset creation and provides a lookup endpoint so mobile scanners can resolve the asset from a raw barcode value.
Context
qrcode@1.5.4is already installed (used by 2FA in BE-13) — the same library can generate asset QR codesbwip-jsorjsbarcode— evaluate and install the lighter option${FRONTEND_URL}/assets/{assetId}FileServicefrom BE-06), not as base64 blobs in the DBAcceptance Criteria
package.jsonPOST /assets(BE-20): auto-generate a QR code PNG and a Code128 barcode PNG, upload both to S3 underqrcodes/{assetId}/, store the S3 keys inAsset.qrCodeandAsset.barcodeGET /assets/:id/qrcode— returns a pre-signed S3 URL for the QR code image (valid 1 hour)GET /assets/:id/barcode— returns a pre-signed S3 URL for the barcode image (valid 1 hour)GET /assets/scan?code=— looks up an asset by itsassetIdstring or barcode value; returns the full asset object. Used by mobile scanner to resolve a physical scanPOST /assets/:id/regenerate-codes(ADMIN only) — regenerates both QR and barcode if the asset ID changes or codes are lost