-
Notifications
You must be signed in to change notification settings - Fork 291
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
Added AssetPublicQRViewSet
to handle QR code based asset retrieval
#1625
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master coronasafe/care_fe#1625 +/- ##
==========================================
+ Coverage 59.08% 59.19% +0.10%
==========================================
Files 205 205
Lines 11145 11175 +30
Branches 1587 1591 +4
==========================================
+ Hits 6585 6615 +30
Misses 4360 4360
Partials 200 200
☔ View full report in Codecov by Sentry. |
@Ashesh3 add tests for the retrieve method |
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.
needs test
Added |
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.
LGTM
You also need to create a signal to delete the cache when an asset updates, need tests for that edge as well. |
@vigneshhari added, could you review? |
This PR introduces a new viewset,
AssetPublicQRViewSet
, which allows the retrieval of assets using their QR code identifiers. The viewset checks if the provided identifier is a UUID or the primary key of the asset. If the identifier is not found in the cache, the asset is retrieved from the database, serialized, and stored in the cache for future requests. This update also includes the registration of the new viewset in the API router under the public endpoints.Required for: ohcnetwork/10bedicu#82
@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins