-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add fields to store when an event was acknowledged and by whom #278
Conversation
…274) - add acknowledged_ts and acknowledged_by to events table - Dockerfile-dev: update FROM image
Nice of you to open a PR 🙏 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #278 +/- ##
==========================================
+ Coverage 95.12% 95.38% +0.26%
==========================================
Files 63 66 +3
Lines 1497 1582 +85
==========================================
+ Hits 1424 1509 +85
Misses 73 73
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Bruno, thanks a lot for the changes addressing #274 ! Looks good to me !
Thanks @fe51 ! There was a problem that caused the client tests to fail: I was recording the access_id instead of the user_id in events/acknowledge_by. This is fixed now. |
Thanks a lot @blenzi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I only have a doubt about adding the acknowledged_events list in the user table. If that's information needed by an external service, we can query the event table by filtering on the acknowledged_by column, don't you think?
@@ -28,9 +28,12 @@ class Event(Base): | |||
start_ts = Column(DateTime, default=func.now()) | |||
end_ts = Column(DateTime, default=None, nullable=True) | |||
is_acknowledged = Column(Boolean, default=False) | |||
acknowledged_by = Column(Integer, ForeignKey("users.id")) | |||
acknowledged_ts = Column(DateTime, default=None, nullable=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to follow the other named fields, perhaps a "acknowledged_at"?
@@ -23,6 +23,7 @@ class User(Base): | |||
|
|||
access: RelationshipProperty = relationship("Access", uselist=False, back_populates="user") | |||
device: RelationshipProperty = relationship("Device", uselist=False, back_populates="owner") | |||
acknowledged_events: RelationshipProperty = relationship("Event", back_populates="acknowledger") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmmh, that's a tricky column to maintain I think?
We could get that information by querying the event table with the user.id. Especially for French regions were everyone uses the same login, that field value could become huge otherwise
Closing as this was for the legacy data model, feel free to reopen if I missed something! |
To address #274 , this PR adds acknowledged_ts and acknowledged_by to events table