feat: add native server-side copy() for attachment duplication#405
Open
cschuerings wants to merge 2 commits intocap-js:mainfrom
Open
feat: add native server-side copy() for attachment duplication#405cschuerings wants to merge 2 commits intocap-js:mainfrom
cschuerings wants to merge 2 commits intocap-js:mainfrom
Conversation
Introduce a copy() method on AttachmentsService that duplicates an attachment record and its binary content across active and draft tables. Includes storage-level implementations for AWS S3, Azure Blob Storage, and GCP, with safeguards against targetKeys override, entity injection, and infected/failed source attachments.
Add a bound copyIncident action on ProcessorService.Incidents that creates a new draft with all attachments cloned via AttachmentsSrv.copy(). The button is shown only in display mode on the Object Page header.
Contributor
|
Hi @cschuerings, BR, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
copy()method toAttachmentsServicefor server-side attachment duplication across active and draft tablescopyIncidentbound action in the incident test FE UI showing the parent-entity copy use caseCloses #279
Details
The new
copy()API accepts source and target attachment entities with their keys:Supports active-to-active, active-to-draft, and draft-to-draft copies. When targeting a draft table, DraftAdministrativeData_DraftUUID must be provided in targetKeys.
As noted in #279, the primary use case is duplicating attachments when copying a parent entity. The test app demonstrates this with a copyIncident action that creates a new draft incident and clones all its attachments in one operation.