Skip to content

feat: add external id mode - #1627

Draft
p-garence wants to merge 13 commits into
sysadminsmedia:mainfrom
p-garence:add-external-id-mode
Draft

feat: add external id mode#1627
p-garence wants to merge 13 commits into
sysadminsmedia:mainfrom
p-garence:add-external-id-mode

Conversation

@p-garence

@p-garence p-garence commented Jul 23, 2026

Copy link
Copy Markdown

Resolves #1404

Description

This PR introduces the External ID feature, allowing users to link physical items to pre-existing third-party QR codes or asset tags without needing to use Homebox generated labels.

This feature is completely hidden by default and must be explicitly enabled in the settings (external_ids_enabled).

settings

Feature Workflow:

  1. The user toggles "Enable External IDs" in their collection settings. If disabled, the UI remains completely unchanged.
  2. The user can create items with external ids.
    • A new "External ID" text field appears on the Create Entity modal.
    • A new "Scan external id" button is added to the header. Clicking the button opens the standard scanner dialog UI. Scanning automatically populates the External ID field.
create
  1. The External ID is displayed in the Details card on the Item page (with a quick-copy button).
display
  1. When a user scans a QR code, the app checks if an entity holds that External ID. If a match is found, it automatically redirects the user to that entity's page. If a match is not found, it proceeds to the usual checks.

Changes Made

Backend

  • Database: Added external_ids_enabled field to the schema and generated the corresponding Goose migrations. It's attached to the Group object.
    • Database: Added external_id field to the schema and generated the corresponding Goose migrations. It's attached to the Entity object.
  • Repository: Implemented GetOneByExternalID to retrieve items within the user's group context.
  • API Route: Added GET /api/v1/entities/external/{external_id}
  • Swagger: Updated swag annotations for the new endpoint.

Frontend

  • API Client: Added getByExternalId to the TypeScript API client.
  • Group: Added a setting called external_id_enabled.
  • Create Modal: Added conditional rendering for the External ID field and QR scan trigger button.
  • Item View: Updated DetailsSection to display the externalId if the setting is enabled.
  • Scanner: Added a mode "external_id" which go to CreateEntity modal with the scanned code as externalId params.
  • Scanner: Added logic to check for external_id if setting is enabled.

Testing and linting

Linting was returning errors on main, the changes keep the count to the same number. (did not find a way to resolve)

The tests were returning errors on main, the changes keep the count to the same number. (did not find a way to resolve)
I wanted to have some feedback on the feature before implementing the finale tests.

Is this feature in the spirit of the project ?

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c67efdb-f605-432d-96ee-c699974af282

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't Attach Exisitng Barcode to New Item

1 participant