When updating an item via PUT /api/items/{partNumber}, any change to
metadata fields (part_number, item_type, description, sourcing_type,
long_description) now creates a new revision for audit trail.
Previously, revisions were only created when the 'properties' JSONB
field was explicitly included in the request body. Metadata-only changes
were invisible in revision history.
New behavior:
- Detect which metadata fields actually changed vs current values
- If metadata changed without properties, carry forward properties from
the latest revision and auto-generate a comment (e.g. 'updated description')
- If properties changed, use the provided properties (existing behavior)
- If both changed, create a single revision capturing both
- If nothing actually changed (identical values), skip revision creation
- Publish revision.created SSE event and trigger auto-jobs
Also adds GetLatestRevision() to ItemRepository for efficiently fetching
the current revision's properties without loading all revisions.
Closes#173