Skip to content
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

Send asset downtime status along with asset details #1794

Merged
merged 7 commits into from
Feb 10, 2024

Conversation

Pranshu1902
Copy link
Contributor

@Pranshu1902 Pranshu1902 commented Dec 30, 2023

Proposed Changes

Modify the AssetAvailabilityViewSet query set to send the asset uptime status of all assets related to the user
image

Associated Issue

Partially Fixes #6819

Merge Checklist

  • Tests added/fixed
  • Update docs in /docs
  • Linting Complete
  • Any other necessary step

Only PR's with test cases included and passing lint and test pipelines will be reviewed

@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins

Copy link

codecov bot commented Dec 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (48e5468) 61.36% compared to head (d071661) 61.63%.
Report is 52 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1794      +/-   ##
==========================================
+ Coverage   61.36%   61.63%   +0.27%     
==========================================
  Files         211      212       +1     
  Lines       11587    11666      +79     
  Branches     1659     1655       -4     
==========================================
+ Hits         7110     7190      +80     
+ Misses       4205     4180      -25     
- Partials      272      296      +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

Changes required as per coronasafe/care_fe#6952 (review)

@Pranshu1902 Pranshu1902 changed the title listAssetAvailability queryset to send all related assets record status Send asset downtime status along with asset details Jan 7, 2024
@Pranshu1902
Copy link
Contributor Author

@sainak could you review these changes

care/facility/api/viewsets/asset.py Outdated Show resolved Hide resolved
care/facility/api/viewsets/asset.py Outdated Show resolved Hide resolved
@sainak
Copy link
Member

sainak commented Jan 18, 2024

add test cases

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

This would mean that the "AssetSerializer" can now only be used by "AssetViewset" since the field is annotated in the get_queryset.

If we were to use the "AssetSerializer" elsewhere, wouldn't this cause issues since we would not/need not be annotating it there.

@sainak is this correct?

@nihal467
Copy link
Member

LGTM

@Pranshu1902
Copy link
Contributor Author

@vigneshhari could you review this PR

@vigneshhari
Copy link
Member

It might be better to cache this data in the main record to make the query simpler.

@vigneshhari vigneshhari merged commit 4136005 into coronasafe:master Feb 10, 2024
5 checks passed
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.

Show "Asset Down" in asset list if asset's last uptime status is down
5 participants