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 — checks released_and_not_expired, checks not already imported (DB query on media__acquia_dam_asset_id), resolves bundle via MediaTypeResolver, returns formatted item ['target_bundle', 'file_name', 'asset_uuid', 'version_id'] or NULL
  • isAlreadyImported(string $asset_id): bool — DB check on media__acquia_dam_asset_id
  • createMediaEntity(array $item, int $uid = 0): MediaInterface — create + save new media entity

acquiadam_asset_import refactor (minimal):

  • AssetQueueService delegates filterAndFormatAsset() + filterAssetsToImport() to AssetMediaImportService::prepareImportItem()
  • AssetImporter delegates create+save to AssetMediaImportService::createMediaEntity()
  • No behaviour change — existing bulk import flow is identical, tests still pass

Issue fork acquia_dam-3614774

Command icon 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

rajeshreeputra created an issue. See original summary.

rajeshreeputra’s picture

Assigned: rajeshreeputra » Unassigned
Status: Needs work » Needs review

Requesting review.

  • rajeshreeputra committed 791fee9b on 1.1.x
    Resolve #3614774 "Create asset media import service and refactor bulk...
rajeshreeputra’s picture

Status: Needs review » Fixed

MR merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • rajeshreeputra committed 791fee9b on 1.1.x-webhook
    Resolve #3614774 "Create asset media import service and refactor bulk...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.