Skip to content

Add NotificationHistory table, with GraphQL, save shop and transfer notifications#5

Merged
zacck-zz merged 19 commits into
masterfrom
feature/notification_history
Oct 9, 2019
Merged

Add NotificationHistory table, with GraphQL, save shop and transfer notifications#5
zacck-zz merged 19 commits into
masterfrom
feature/notification_history

Conversation

@lucca65
Copy link
Copy Markdown
Member

@lucca65 lucca65 commented Oct 2, 2019

This PR aims to implemente the backend part for the notification history screen, seen here:

https://projects.invisionapp.com/d/main#/console/17335338/367779185/preview

@lucca65 lucca65 requested a review from zacck-zz October 2, 2019 01:28
Copy link
Copy Markdown
Contributor

@zacck-zz zacck-zz left a comment

Choose a reason for hiding this comment

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

Hey I have a few questions regarding some changes @lucca65

Comment thread lib/bespiral/notifications/notifications.ex Outdated
Comment thread lib/bespiral/db_listener.ex
@zacck-zz
Copy link
Copy Markdown
Contributor

zacck-zz commented Oct 3, 2019

@lucca65 can I add a field that returns the number of unread notifications and a mutation for marking notifications as read to this PR ?

Comment thread priv/repo/migrations/20191001194938_add_notification_history.exs
Comment thread lib/bespiral_web/resolvers/notifications.ex
defmodule BeSpiral.NotificationHistoryTest do
use BeSpiral.DataCase

describe "notification_history" do
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.

These tests are valid though, Ill add them too

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.

Hey @lucca65 are these fields added yet? I can't seem to see their implementations

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@lucca65 I mean the resolvers, I can find one for all of a users notifications but I am not seeing one for the single notification ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no, we only have them in a list!

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.

Aaaaah I understand now

@zacck-zz
Copy link
Copy Markdown
Contributor

zacck-zz commented Oct 9, 2019

@lucca65 merging this as I feel it's done for now

@zacck-zz zacck-zz force-pushed the feature/notification_history branch from 8f6d837 to 86395f6 Compare October 9, 2019 17:44
@zacck-zz zacck-zz merged commit f6206fb into master Oct 9, 2019
@zacck-zz zacck-zz deleted the feature/notification_history branch October 9, 2019 17:45
lucca65 added a commit that referenced this pull request May 17, 2026
…otifications (#5)

* Add NotificationHistory table, with GraphQL, save shop and transfer notifications

* Remove empty spaces in line endings

* bump version

* Use utc_datetime instead of naive_datetime for notification history timestamps

* Make notification graphql query a non_null list

* Adjust pattern matching

* Add union type for notification

* Make sale_history's amount non_null

* Add NotificationHistory factory

* Test that we can count unread notifications

* Implement schema resolvers and types to count unread notifications

* Implement context function to collect unread notification count

* Test that notification history can be marked as read

* Implement schema types and functions to allow marking a notification as read

* Implement fetching and flagging a notification as read

* Remove unnecessary default parameter

* Move tranfer and sale history collector to context to utilize business logic

* remove empty test file

* Clean up merge
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.

3 participants