Skip to content

feat(activity): model UserReaction + factory e relação no Timeline (#542) - #560

Merged
hefeus merged 6 commits into
feat/timeline-reactionfrom
feat/542-user-reaction-model
Sep 14, 2026
Merged

hefeus merged 6 commits into
feat/timeline-reactionfrom
feat/542-user-reaction-model

Conversation

@BrunaDomingues

Copy link
Copy Markdown
Contributor

Contexto

A timeline web precisa de acesso Eloquent à tabela activity_user_reactions, separado do agregado Reaction do Discord.

Este PR adiciona o model UserReaction, a factory e a relação userReactions() no Timeline, para as fatias seguintes (Action ReactWith, summary, UI) terem uma entidade persistível.

Alterações

  • Model UserReaction com HasUuids, #[Table('activity_user_reactions')], @property alinhado ao schema, cast reaction => TimelineReaction e relações user() / timeline()
  • Factory ReactionFactory (user_id, timeline_id, reaction aleatória do enum)
  • Relação userReactions(): HasMany em Timeline (único ponto tocado nesse arquivo)
  • Testes unitários: create via factory + 3 reações de usuários diferentes num post

Plano de Testes

  • Executar make check (ou composer check)
  • Executar php vendor/bin/pest --compact app-modules/activity/tests/Unit/Reaction/UserReactionTest.php
  • Confirmar que UserReaction::factory()->create() grava em activity_user_reactions
  • Confirmar que UserReaction::first()->reaction é um caso de TimelineReaction
  • Confirmar que $timeline->userReactions devolve as 3 linhas do post

Evidências

Sem impacto visual (só domínio / persistência).


Issues Relacionadas

Closes #542
Related to #539

@BrunaDomingues BrunaDomingues self-assigned this Sep 11, 2026
Comment thread app-modules/activity/database/factories/ReactionFactory.php Outdated
Comment thread app-modules/activity/tests/Unit/Reaction/UserReactionTest.php
Comment thread app-modules/activity/src/Reaction/Models/UserReaction.php
Comment thread app-modules/activity/tests/Unit/Reaction/UserReactionTest.php
GabrielFVDev
GabrielFVDev previously approved these changes Sep 14, 2026

@GabrielFVDev GabrielFVDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

hefeus
hefeus previously approved these changes Sep 14, 2026

@hefeus hefeus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@BrunaDomingues
BrunaDomingues dismissed stale reviews from hefeus and GabrielFVDev via 792e3a3 September 14, 2026 02:12
@hefeus
hefeus merged commit c8d210e into feat/timeline-reaction Sep 14, 2026
8 checks passed
@hefeus
hefeus deleted the feat/542-user-reaction-model branch September 14, 2026 10:36
@stherzada stherzada linked an issue Sep 16, 2026 that may be closed by this pull request
7 tasks
@stherzada stherzada added this to the Reactions Timeline milestone Sep 16, 2026
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.

feat(activity): S3 — model UserReaction + factory + relação no Timeline

4 participants