Skip to content

Conversation

petermasking
Copy link
Member

Fixes #373
Fixes #370

Changes proposed in this pull request:

  • Event broker integration (Pub/Sub based)
  • Memory event broker implementation (wraps Node's EventEmitter)
  • Domain publications (post created / removed, relation established, rating toggled)
  • Domain subscriptions (notifications and metrics)
  • Split metrics into separate modules (creator and post)
  • Merged reaction concept into post
  • Incremented body limit for services behind the proxy

@MaskingTechnology/comify

@petermasking petermasking linked an issue Feb 7, 2025 that may be closed by this pull request
@basmasking basmasking changed the title 373 event support feat: event support Feb 7, 2025
{
const query = { creatorId: { EQUALS: creatorId } };

const data = database.findRecord(RECORD_TYPE, query) as Promise<DataModel>;
Copy link
Member

Choose a reason for hiding this comment

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

We should await the promise to be able to check the data itself

{
const query = { postId: { EQUALS: postId } };

const data = database.findRecord(RECORD_TYPE, query) as Promise<DataModel>;
Copy link
Member

Choose a reason for hiding this comment

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

We have to await the promise to be able to check the value of data

type AggregatedData = Omit<DataModel, 'email' | 'portraitId'> &
{
readonly portrait?: ImageData;
metrics: metricsData;
Copy link
Member

Choose a reason for hiding this comment

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

readonly


import { Types } from '../definitions';

import getPost from '^/domain/post/getById';
Copy link
Member

Choose a reason for hiding this comment

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

This import should be first

{
constructor()
{
super('Creator metrics not found');
Copy link
Member

Choose a reason for hiding this comment

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

Post metrics?

import type { AggregatedData as AggregatedReactionData } from '^/domain/reaction/aggregate';
import createComicReaction from '^/domain/reaction/createWithComic';
import getReaction from '^/domain/reaction/getByIdAggregated';
import createComicReaction from '^/domain/post/createWithComic';
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be createComicPost?

import type { AggregatedData as AggregatedReactionData } from '^/domain/reaction/aggregate';
import createCommentReaction from '^/domain/reaction/createWithComment';
import getReaction from '^/domain/reaction/getByIdAggregated';
import createCommentReaction from '^/domain/post/createWithComment';
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be createCommentPost?

import { useNavigate } from 'react-router-dom';

import { Types } from '^/domain/notification';
import type { AggregatedData as NotificationView } from '^/domain/notification/aggregate/types';
Copy link
Member

Choose a reason for hiding this comment

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

AggregatedNotificationData

{
const navigate = useNavigate();

return useCallback((notification: NotificationView) =>
Copy link
Member

Choose a reason for hiding this comment

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

AggregatedNotificationData

import { beforeEach, describe, expect, it } from 'vitest';

import getAllAggregated from '^/domain/post/getAllAggregated';
import getAllAggregated from '^/domain/post/getRecommendedAggregated';
Copy link
Member

Choose a reason for hiding this comment

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

getRecommendedAggregated

Copy link

sonarqubecloud bot commented Feb 7, 2025

@basmasking basmasking merged commit 4daaa9d into main Feb 7, 2025
6 checks passed
@basmasking basmasking deleted the 373-event-support branch February 7, 2025 21:54
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.

Event support Merge post and reaction concepts

2 participants