care
care copied to clipboard
Fixed: Added in_use field to track used bed
Updates
- [x] Fixes #936
- [x] Added
in_use
field to Bed model to track used bed - [x] Added migration function to update
in_use
field for previous bed models - [x] Updated serializer to update
in_use
field during bed update
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
2 Code Smells
No Coverage information
0.0% Duplication
Codecov Report
Merging #939 (88f3109) into master (9730efd) will decrease coverage by
1.43%
. The diff coverage is22.72%
.
@@ Coverage Diff @@
## master #939 +/- ##
==========================================
- Coverage 54.23% 52.80% -1.44%
==========================================
Files 181 181
Lines 8826 8855 +29
==========================================
- Hits 4787 4676 -111
- Misses 4039 4179 +140
Impacted Files | Coverage Δ | |
---|---|---|
care/facility/api/serializers/bed.py | 39.83% <6.25%> (-0.88%) |
:arrow_down: |
care/facility/models/bed.py | 86.66% <66.66%> (ø) |
|
...e/utils/serializer/phonenumber_ispossible_field.py | 50.00% <0.00%> (-43.75%) |
:arrow_down: |
config/serializers.py | 36.84% <0.00%> (-31.58%) |
:arrow_down: |
care/audit_log/middleware.py | 47.36% <0.00%> (-22.81%) |
:arrow_down: |
care/users/models.py | 73.94% <0.00%> (-16.20%) |
:arrow_down: |
care/facility/models/mixins/permissions/base.py | 45.00% <0.00%> (-15.00%) |
:arrow_down: |
care/users/api/viewsets/users.py | 43.50% <0.00%> (-12.34%) |
:arrow_down: |
care/facility/api/viewsets/facility.py | 58.10% <0.00%> (-12.17%) |
:arrow_down: |
care/users/api/serializers/user.py | 56.77% <0.00%> (-9.33%) |
:arrow_down: |
... and 10 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 9730efd...88f3109. Read the comment docs.
do we need an in_use
attribute ? end_date == None
serves the same purpose right?
@vigneshhari There is an issue coronasafe/care_fe#3216. To fix this issue, I have added in_use
field in Bed Model
@cp-Coder you can use the end_date is null to check if a bed is in use.
@vigneshhari end_date
is present in the ConsultationBed model. In the issue, the user should be able to see only those beds (in the list present in the switch bed form) which are not in use. If the in_use
field is not present, then I have to query every bed of that facility in the Bed model(for the list) and in the ConsultationBed model too (to check whether it is still in use or not). This will increase the no of queries to the database.