Skip to content

feat: publish media file type lifecycle events to sponsor services#492

Open
romanetar wants to merge 1 commit intomainfrom
feature/publish-media-file-type-domain-events
Open

feat: publish media file type lifecycle events to sponsor services#492
romanetar wants to merge 1 commit intomainfrom
feature/publish-media-file-type-domain-events

Conversation

@romanetar
Copy link
Copy Markdown
Collaborator

Signed-off-by: romanetar <roman_ag@hotmail.com>
{
private int $id;
private string $name;
private string $description;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romanetar
@romanetar Nullable fields passed to non-nullable DTO constructor ( runtime TypeError )
SummitMediaFileType::getDescription() returns ?string and getAllowedExtensions() returns ?string, but SummitMediaFileTypeCreatedEventDTO::__construct declares both as string.

return new self(
$summit_media_file_type->getId(),
$summit_media_file_type->getName(),
$summit_media_file_type->getDescription(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return SummitMediaFileTypeFactory::populate($type, $payload);
$media_file_type = SummitMediaFileTypeFactory::populate($type, $payload);

PublishSponsorServiceDomainEventsJob::dispatch(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romanetar @romanetar Update event dispatched inside transaction ( fires even on rollback) move out side ( same pattern as add )


$this->repository->delete($type);

PublishSponsorServiceDomainEventsJob::dispatch(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

@smarcet smarcet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romanetar please review

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.

2 participants