-
Notifications
You must be signed in to change notification settings - Fork 297
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 service request history for asset #1277
feat: Add service request history for asset #1277
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## master #1277 +/- ##
==========================================
+ Coverage 56.29% 56.36% +0.07%
==========================================
Files 195 195
Lines 9582 9628 +46
Branches 1609 1616 +7
==========================================
+ Hits 5394 5427 +33
- Misses 4133 4146 +13
Partials 55 55
☔ 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.
run this branch through precommit
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, squash the migrations after abdm is merged
Squash all migrations to a single one. |
Failing tests. |
@rithviknishad add your review. |
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.
rebase and squash the migrations btw
Co-authored-by: Aakash Singh <mail@singhaakash.dev>
Co-authored-by: Aakash Singh <mail@singhaakash.dev>
Co-authored-by: Aakash Singh <mail@singhaakash.dev>
@Ashesh3 migrations needs to updated |
Required for: ohcnetwork/care_fe#5363
This pull request adds a new
AssetService
model to the project, which will allow us to store all records of service requests for each asset. This pull request also introduces anAssetService
serializer in thecare/facility/api/serializers/asset.py
file. TheAssetService
serializer is used to retrieve the last service of an Asset. In theAssetSerializer
serializer,last_service
is added as a read-only field, andlast_serviced_on
andnote
are added as write-only fields. Thelast_service
field retrieves the last service of the Asset using theAssetService
serializer.This pull request also includes changes to the
create
andupdate
methods of theAssetSerializer
serializer to save thelast_service
data when an Asset is created or updated. TheAssetServiceFilter
filter is also added to thecare/facility/api/viewsets/asset.py
file to filter Assets by external id.Migration has been created to move existing service request to a new AssetService object linked to that asset.
@coronasafe/code-reviewers