feat(monorepo): migrate to typescript monorepo
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Command;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Identity\ArticleId;
|
||||
use Basango\FeedManagement\Domain\Model\Identity\BookmarkId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class AddArticleToBookmark.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class AddArticleToBookmark
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public ArticleId $articleId,
|
||||
public BookmarkId $bookmarkId,
|
||||
) {
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Command;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Identity\ArticleId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class AddCommentToArticle.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class AddCommentToArticle
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public ArticleId $articleId,
|
||||
public string $content,
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Command;
|
||||
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class CreateBookmark.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class CreateBookmark
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public string $name,
|
||||
public ?string $description,
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Command;
|
||||
|
||||
use Basango\FeedManagement\Domain\Model\Identity\BookmarkId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class DeleteBookmark.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class DeleteBookmark
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public BookmarkId $bookmarkId
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Command;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Identity\SourceId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class FollowSource.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class FollowSource
|
||||
{
|
||||
public function __construct(
|
||||
public SourceId $sourceId,
|
||||
public UserId $userId
|
||||
) {
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Command;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Identity\ArticleId;
|
||||
use Basango\FeedManagement\Domain\Model\Identity\BookmarkId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class RemoveArticleFromBookmark.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class RemoveArticleFromBookmark
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public ArticleId $articleId,
|
||||
public BookmarkId $bookmarkId,
|
||||
) {
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Command;
|
||||
|
||||
use Basango\FeedManagement\Domain\Model\Identity\CommentId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class RemoveCommentFromArticle.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class RemoveCommentFromArticle
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public CommentId $commentId
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Command;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Identity\SourceId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class UnfollowSource.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class UnfollowSource
|
||||
{
|
||||
public function __construct(
|
||||
public SourceId $sourceId,
|
||||
public UserId $userId
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Command;
|
||||
|
||||
use Basango\FeedManagement\Domain\Model\Identity\BookmarkId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class UpdateBookmark.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class UpdateBookmark
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public BookmarkId $bookmarkId,
|
||||
public string $name,
|
||||
public ?string $description,
|
||||
public bool $isPublic = false,
|
||||
) {
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\CommandHandler;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Repository\ArticleRepository;
|
||||
use Basango\FeedManagement\Application\UseCase\Command\AddArticleToBookmark;
|
||||
use Basango\FeedManagement\Domain\Model\Repository\BookmarkRepository;
|
||||
use Basango\IdentityAndAccess\Domain\Exception\PermissionNotGranted;
|
||||
use Basango\SharedKernel\Application\Messaging\CommandHandler;
|
||||
|
||||
/**
|
||||
* Class AddArticleToBookmarkHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class AddArticleToBookmarkHandler implements CommandHandler
|
||||
{
|
||||
public function __construct(
|
||||
private BookmarkRepository $bookmarkRepository,
|
||||
private ArticleRepository $articleRepository
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(AddArticleToBookmark $command): void
|
||||
{
|
||||
$bookmark = $this->bookmarkRepository->getById($command->bookmarkId);
|
||||
if ($bookmark->user->id !== $command->userId) {
|
||||
throw PermissionNotGranted::withReason('feed_management.exceptions.cannot_add_article_to_bookmark');
|
||||
}
|
||||
|
||||
$article = $this->articleRepository->getById($command->articleId);
|
||||
|
||||
$bookmark->addArticle($article);
|
||||
$this->bookmarkRepository->add($bookmark);
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\CommandHandler;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Repository\ArticleRepository;
|
||||
use Basango\FeedManagement\Application\UseCase\Command\AddCommentToArticle;
|
||||
use Basango\FeedManagement\Domain\Model\Entity\Comment;
|
||||
use Basango\FeedManagement\Domain\Model\Repository\CommentRepository;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Repository\UserRepository;
|
||||
use Basango\SharedKernel\Application\Messaging\CommandHandler;
|
||||
|
||||
/**
|
||||
* Class AddCommentToArticleHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class AddCommentToArticleHandler implements CommandHandler
|
||||
{
|
||||
public function __construct(
|
||||
public UserRepository $userRepository,
|
||||
public ArticleRepository $articleRepository,
|
||||
public CommentRepository $commentRepository
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(AddCommentToArticle $comment): void
|
||||
{
|
||||
$user = $this->userRepository->getById($comment->userId);
|
||||
$article = $this->articleRepository->getById($comment->articleId);
|
||||
|
||||
$comment = Comment::create($user, $article, $comment->content);
|
||||
$this->commentRepository->add($comment);
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\CommandHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\UseCase\Command\CreateBookmark;
|
||||
use Basango\FeedManagement\Domain\Model\Entity\Bookmark;
|
||||
use Basango\FeedManagement\Domain\Model\Repository\BookmarkRepository;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Repository\UserRepository;
|
||||
use Basango\SharedKernel\Application\Messaging\CommandHandler;
|
||||
|
||||
/**
|
||||
* Class CreateBookHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class CreateBookHandler implements CommandHandler
|
||||
{
|
||||
public function __construct(
|
||||
private UserRepository $userRepository,
|
||||
private BookmarkRepository $bookmarkRepository
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(CreateBookmark $command): void
|
||||
{
|
||||
$user = $this->userRepository->getById($command->userId);
|
||||
$bookmark = Bookmark::create($user, $command->name, $command->description);
|
||||
|
||||
$this->bookmarkRepository->add($bookmark);
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\CommandHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\UseCase\Command\DeleteBookmark;
|
||||
use Basango\FeedManagement\Domain\Model\Repository\BookmarkRepository;
|
||||
use Basango\IdentityAndAccess\Domain\Exception\PermissionNotGranted;
|
||||
use Basango\SharedKernel\Application\Messaging\CommandHandler;
|
||||
|
||||
/**
|
||||
* Class DeleteBookmarkHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class DeleteBookmarkHandler implements CommandHandler
|
||||
{
|
||||
public function __construct(
|
||||
private BookmarkRepository $bookmarkRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(DeleteBookmark $command): void
|
||||
{
|
||||
$bookmark = $this->bookmarkRepository->getById($command->bookmarkId);
|
||||
if ($bookmark->user->id !== $command->userId) {
|
||||
throw PermissionNotGranted::withReason('feed_management.exceptions.cannot_delete_bookmark');
|
||||
}
|
||||
|
||||
$this->bookmarkRepository->remove($bookmark);
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\CommandHandler;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Repository\SourceRepository;
|
||||
use Basango\FeedManagement\Application\UseCase\Command\FollowSource;
|
||||
use Basango\FeedManagement\Domain\Exception\SourceAlreadyFollowed;
|
||||
use Basango\FeedManagement\Domain\Model\Entity\FollowedSource;
|
||||
use Basango\FeedManagement\Domain\Model\Repository\FollowedSourceRepository;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Repository\UserRepository;
|
||||
use Basango\SharedKernel\Application\Messaging\CommandHandler;
|
||||
|
||||
/**
|
||||
* Class FollowSourceHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class FollowSourceHandler implements CommandHandler
|
||||
{
|
||||
public function __construct(
|
||||
private UserRepository $userRepository,
|
||||
private SourceRepository $sourceRepository,
|
||||
private FollowedSourceRepository $followedSourceRepository
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(FollowSource $command): void
|
||||
{
|
||||
$followedSource = $this->followedSourceRepository->getByUserId(
|
||||
$command->userId,
|
||||
$command->sourceId
|
||||
);
|
||||
|
||||
if ($followedSource instanceof FollowedSource) {
|
||||
throw SourceAlreadyFollowed::with($command->userId, $command->sourceId);
|
||||
}
|
||||
|
||||
$user = $this->userRepository->getById($command->userId);
|
||||
$source = $this->sourceRepository->getById($command->sourceId);
|
||||
|
||||
$followedSource = new FollowedSource($source, $user);
|
||||
$this->followedSourceRepository->add($followedSource);
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\CommandHandler;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Repository\ArticleRepository;
|
||||
use Basango\FeedManagement\Application\UseCase\Command\RemoveArticleFromBookmark;
|
||||
use Basango\FeedManagement\Domain\Model\Repository\BookmarkRepository;
|
||||
use Basango\IdentityAndAccess\Domain\Exception\PermissionNotGranted;
|
||||
use Basango\SharedKernel\Application\Messaging\CommandHandler;
|
||||
|
||||
/**
|
||||
* Class RemoveArticleFromBookmark.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class RemoveArticleFromBookmarkHandler implements CommandHandler
|
||||
{
|
||||
public function __construct(
|
||||
private BookmarkRepository $bookmarkRepository,
|
||||
private ArticleRepository $articleRepository
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(RemoveArticleFromBookmark $command): void
|
||||
{
|
||||
$bookmark = $this->bookmarkRepository->getById($command->bookmarkId);
|
||||
if ($bookmark->user->id !== $command->userId) {
|
||||
throw PermissionNotGranted::withReason('feed_management.exceptions.cannot_remove_article_from_bookmark');
|
||||
}
|
||||
|
||||
$article = $this->articleRepository->getById($command->articleId);
|
||||
$bookmark->removeArticle($article);
|
||||
|
||||
$this->bookmarkRepository->add($bookmark);
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\CommandHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\UseCase\Command\RemoveCommentFromArticle;
|
||||
use Basango\FeedManagement\Domain\Model\Repository\CommentRepository;
|
||||
use Basango\IdentityAndAccess\Domain\Exception\PermissionNotGranted;
|
||||
use Basango\SharedKernel\Application\Messaging\CommandHandler;
|
||||
|
||||
/**
|
||||
* Class RemoveCommentFromArticleHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class RemoveCommentFromArticleHandler implements CommandHandler
|
||||
{
|
||||
public function __construct(
|
||||
private CommentRepository $commentRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(RemoveCommentFromArticle $command): void
|
||||
{
|
||||
$comment = $this->commentRepository->getById($command->commentId);
|
||||
if ($command->userId !== $comment->user->id) {
|
||||
throw PermissionNotGranted::withReason('feed_management.exceptions.cannot_delete_comment');
|
||||
}
|
||||
|
||||
$this->commentRepository->remove($comment);
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\CommandHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\UseCase\Command\UnfollowSource;
|
||||
use Basango\FeedManagement\Domain\Exception\FollowedSourceNotFound;
|
||||
use Basango\FeedManagement\Domain\Model\Entity\FollowedSource;
|
||||
use Basango\FeedManagement\Domain\Model\Repository\FollowedSourceRepository;
|
||||
use Basango\SharedKernel\Application\Messaging\CommandHandler;
|
||||
|
||||
/**
|
||||
* Class UnfollowSourceHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class UnfollowSourceHandler implements CommandHandler
|
||||
{
|
||||
public function __construct(
|
||||
private FollowedSourceRepository $followedSourceRepository
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(UnfollowSource $command): void
|
||||
{
|
||||
$followedSource = $this->followedSourceRepository->getByUserId(
|
||||
$command->userId,
|
||||
$command->sourceId
|
||||
);
|
||||
|
||||
if (! $followedSource instanceof FollowedSource) {
|
||||
throw FollowedSourceNotFound::with($command->userId, $command->sourceId);
|
||||
}
|
||||
|
||||
$this->followedSourceRepository->remove($followedSource);
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\CommandHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\UseCase\Command\UpdateBookmark;
|
||||
use Basango\FeedManagement\Domain\Model\Repository\BookmarkRepository;
|
||||
use Basango\IdentityAndAccess\Domain\Exception\PermissionNotGranted;
|
||||
use Basango\SharedKernel\Application\Messaging\CommandHandler;
|
||||
|
||||
/**
|
||||
* Class UpdateBookmarkHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class UpdateBookmarkHandler implements CommandHandler
|
||||
{
|
||||
public function __construct(
|
||||
private BookmarkRepository $bookmarkRepository
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(UpdateBookmark $command): void
|
||||
{
|
||||
$bookmark = $this->bookmarkRepository->getById($command->bookmarkId);
|
||||
if ($bookmark->user->id !== $command->userId) {
|
||||
throw PermissionNotGranted::withReason('feed_management.exceptions.cannot_update_bookmark');
|
||||
}
|
||||
|
||||
$bookmark = match ($command->isPublic) {
|
||||
true => $bookmark->markAsPublic(),
|
||||
false => $bookmark->markAsPrivate(),
|
||||
};
|
||||
$bookmark->updateInfos($command->name, $command->description);
|
||||
|
||||
$this->bookmarkRepository->add($bookmark);
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Query;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Identity\ArticleId;
|
||||
use Basango\SharedKernel\Domain\Model\Pagination\Page;
|
||||
|
||||
/**
|
||||
* Class GetArticleCommentListHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class GetArticleCommentList
|
||||
{
|
||||
public function __construct(
|
||||
public ArticleId $articleId,
|
||||
public Page $page = new Page(),
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Query;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Identity\ArticleId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class GetArticleDetails.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class GetArticleDetails
|
||||
{
|
||||
public function __construct(
|
||||
public ArticleId $id,
|
||||
public UserId $userId
|
||||
) {
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Query;
|
||||
|
||||
use Basango\FeedManagement\Domain\Model\Filters\ArticleFilters;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
use Basango\SharedKernel\Domain\Model\Pagination\Page;
|
||||
|
||||
/**
|
||||
* Class GetArticleOverviewList.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class GetArticleOverviewList
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public Page $page = new Page(),
|
||||
public ArticleFilters $filters = new ArticleFilters(),
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Query;
|
||||
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
use Basango\SharedKernel\Domain\Model\Pagination\Page;
|
||||
|
||||
/**
|
||||
* Class GetBookmarkList.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class GetBookmarkList
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public Page $page = new Page(),
|
||||
) {
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Query;
|
||||
|
||||
use Basango\FeedManagement\Domain\Model\Filters\ArticleFilters;
|
||||
use Basango\FeedManagement\Domain\Model\Identity\BookmarkId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
use Basango\SharedKernel\Domain\Model\Pagination\Page;
|
||||
|
||||
/**
|
||||
* Class GetBookmarkedArticleList.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class GetBookmarkedArticleList
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public BookmarkId $bookmarkId,
|
||||
public Page $page = new Page(),
|
||||
public ArticleFilters $filters = new ArticleFilters()
|
||||
) {
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Query;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Identity\SourceId;
|
||||
use Basango\FeedManagement\Domain\Model\Filters\ArticleFilters;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
use Basango\SharedKernel\Domain\Model\Pagination\Page;
|
||||
|
||||
/**
|
||||
* Class GetArticleOverviewList.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class GetSourceArticleOverviewList
|
||||
{
|
||||
public function __construct(
|
||||
public SourceId $sourceId,
|
||||
public UserId $userId,
|
||||
public Page $page = new Page(),
|
||||
public ArticleFilters $filters = new ArticleFilters(),
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Query;
|
||||
|
||||
use Basango\Aggregator\Domain\Model\Identity\SourceId;
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
|
||||
/**
|
||||
* Class GetSourceDetails.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class GetSourceDetails
|
||||
{
|
||||
public function __construct(
|
||||
public SourceId $sourceId,
|
||||
public UserId $userId,
|
||||
) {
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\Query;
|
||||
|
||||
use Basango\IdentityAndAccess\Domain\Model\Identity\UserId;
|
||||
use Basango\SharedKernel\Domain\Model\Pagination\Page;
|
||||
|
||||
/**
|
||||
* Class GetSourceOverviewList.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
final readonly class GetSourceOverviewList
|
||||
{
|
||||
public function __construct(
|
||||
public UserId $userId,
|
||||
public Page $page = new Page(),
|
||||
) {
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\QueryHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\ReadModel\CommentList;
|
||||
use Basango\FeedManagement\Application\UseCase\Query\GetArticleCommentList;
|
||||
use Basango\SharedKernel\Application\Messaging\QueryHandler;
|
||||
|
||||
/**
|
||||
* Class GetArticleCommentListHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
interface GetArticleCommentListHandler extends QueryHandler
|
||||
{
|
||||
public function __invoke(GetArticleCommentList $query): CommentList;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\QueryHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\ReadModel\ArticleDetails;
|
||||
use Basango\FeedManagement\Application\UseCase\Query\GetArticleDetails;
|
||||
use Basango\SharedKernel\Application\Messaging\QueryHandler;
|
||||
|
||||
/**
|
||||
* Class GetArticleDetailsDbalHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
interface GetArticleDetailsHandler extends QueryHandler
|
||||
{
|
||||
public function __invoke(GetArticleDetails $query): ArticleDetails;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\QueryHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\ReadModel\ArticleOverviewList;
|
||||
use Basango\FeedManagement\Application\UseCase\Query\GetArticleOverviewList;
|
||||
use Basango\SharedKernel\Application\Messaging\QueryHandler;
|
||||
|
||||
/**
|
||||
* Class GetArticleOverviewListHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
interface GetArticleOverviewListHandler extends QueryHandler
|
||||
{
|
||||
public function __invoke(GetArticleOverviewList $query): ArticleOverviewList;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\QueryHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\ReadModel\BookmarkList;
|
||||
use Basango\FeedManagement\Application\UseCase\Query\GetBookmarkList;
|
||||
use Basango\SharedKernel\Application\Messaging\QueryHandler;
|
||||
|
||||
/**
|
||||
* Interface GetBookmarkListHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
interface GetBookmarkListHandler extends QueryHandler
|
||||
{
|
||||
public function __invoke(GetBookmarkList $query): BookmarkList;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\QueryHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\ReadModel\ArticleOverviewList;
|
||||
use Basango\FeedManagement\Application\UseCase\Query\GetBookmarkedArticleList;
|
||||
use Basango\SharedKernel\Application\Messaging\QueryHandler;
|
||||
|
||||
/**
|
||||
* Interface GetBookmarkedArticleListHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
interface GetBookmarkedArticleListHandler extends QueryHandler
|
||||
{
|
||||
public function __invoke(GetBookmarkedArticleList $query): ArticleOverviewList;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\QueryHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\ReadModel\ArticleOverviewList;
|
||||
use Basango\FeedManagement\Application\UseCase\Query\GetSourceArticleOverviewList;
|
||||
use Basango\SharedKernel\Application\Messaging\QueryHandler;
|
||||
|
||||
/**
|
||||
* Class GetArticleOverviewListHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
interface GetSourceArticleOverviewListHandler extends QueryHandler
|
||||
{
|
||||
public function __invoke(GetSourceArticleOverviewList $query): ArticleOverviewList;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\QueryHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\ReadModel\SourceDetails;
|
||||
use Basango\FeedManagement\Application\UseCase\Query\GetSourceDetails;
|
||||
use Basango\SharedKernel\Application\Messaging\QueryHandler;
|
||||
|
||||
/**
|
||||
* Interface GetSourceDetailsHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
interface GetSourceDetailsHandler extends QueryHandler
|
||||
{
|
||||
public function __invoke(GetSourceDetails $query): SourceDetails;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Basango\FeedManagement\Application\UseCase\QueryHandler;
|
||||
|
||||
use Basango\FeedManagement\Application\ReadModel\SourceOverviewList;
|
||||
use Basango\FeedManagement\Application\UseCase\Query\GetSourceOverviewList;
|
||||
use Basango\SharedKernel\Application\Messaging\QueryHandler;
|
||||
|
||||
/**
|
||||
* Interface GetSourceOverviewListHandler.
|
||||
*
|
||||
* @author bernard-ng <bernard@devscast.tech>
|
||||
*/
|
||||
interface GetSourceOverviewListHandler extends QueryHandler
|
||||
{
|
||||
public function __invoke(GetSourceOverviewList $query): SourceOverviewList;
|
||||
}
|
||||
Reference in New Issue
Block a user