Problem/Motivation
As a developer, I want a shared AssetMediaImportService in the parent acquia_dam module, so that media entity creation logic is reusable by both acquiadam_asset_import (bulk import) and acquia_dam_webhooks (real-time import) without cross-submodule coupling.
Acceptance Criteria
New shared service AssetMediaImportService (parent acquia_dam module):
- Service ID:
acquia_dam.asset_media_import prepareImportItem(array $asset_data, array $bundles = []): ?array— checksreleased_and_not_expired, checks not already imported (DB query onmedia__acquia_dam_asset_id), resolves bundle viaMediaTypeResolver, returns formatted item['target_bundle', 'file_name', 'asset_uuid', 'version_id']orNULLisAlreadyImported(string $asset_id): bool— DB check onmedia__acquia_dam_asset_idcreateMediaEntity(array $item, int $uid = 0): MediaInterface— create + save new media entity
acquiadam_asset_import refactor (minimal):
AssetQueueServicedelegatesfilterAndFormatAsset()+filterAssetsToImport()toAssetMediaImportService::prepareImportItem()AssetImporterdelegates create+save toAssetMediaImportService::createMediaEntity()- No behaviour change — existing bulk import flow is identical, tests still pass
Issue fork acquia_dam-3614774
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
rajeshreeputraRequesting review.
Comment #5
rajeshreeputraMR merged!