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

TreatmentPrescription bulk delete endpoint + tests (PLAN-1504) #1670

Merged
merged 4 commits into from
Aug 16, 2024

Conversation

lastminutediorama
Copy link
Contributor

@lastminutediorama lastminutediorama commented Aug 12, 2024

Per discussion, we changed this to accept stand_ids instead of ids, since that's preferable for FE needs.

@lastminutediorama lastminutediorama changed the title proposed endpoint and tests TreatmentPrescription bulk delete endpoint + tests Aug 12, 2024
@lastminutediorama lastminutediorama changed the title TreatmentPrescription bulk delete endpoint + tests TreatmentPrescription bulk delete endpoint + tests (PLAN-1504) Aug 13, 2024
@lastminutediorama lastminutediorama marked this pull request as ready for review August 14, 2024 21:59
@@ -138,6 +138,12 @@ class Meta:
)


class TreatmentPrescriptionBatchDeleteSerializer(serializers.Serializer):
stand_ids = serializers.ListField(
Copy link
Contributor

Choose a reason for hiding this comment

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

Much nicer!

Comment on lines +188 to +190
delete_result = TreatmentPrescription.objects.filter(
stand_id__in=stand_ids, treatment_plan_id=tx_plan_pk
).delete()
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a product question to do to Jordan: in other endpoints we record an actstream about deletions. Should we log this interaction as well?

If the answer is yes, then the actstrem format is a bit different, but it should be possible to log it with a method on our service module.

Copy link
Contributor

@george-silva george-silva left a comment

Choose a reason for hiding this comment

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

LGTM! Just a question that can be addressed in a separate PR!

@lastminutediorama lastminutediorama merged commit 5437242 into main Aug 16, 2024
6 checks passed
@lastminutediorama lastminutediorama deleted the bulk-delete-txrx-objects branch August 16, 2024 22:08
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.

2 participants