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

LF-4527: Handle animal deletion and abandon related tasks #3546

Draft
wants to merge 22 commits into
base: integration
Choose a base branch
from

Conversation

SayakaOno
Copy link
Collaborator

@SayakaOno SayakaOno commented Nov 22, 2024

Description

  • Add methods to animal/batch models:
    • Retrieve animals/batches with associated tasks.
    • Unrelate incomplete tasks from animals/batches.
  • Add a helper function:
    • Unrelate task-animal/batch relationships.
    • Abandon incomplete tasks that don't have animals or batches.
  • Update animal/batch controllers:
    • Manage task and relationship handling.
  • Update checkDeleteAnimalOrBatch middleware:
    • Require a date for deletion.
    • Prevent deletion of animals/batches with abandoned or completed tasks.
  • Update apiSlice:
    • Add date parameter to the delete animals/batches API requests.
  • Update useAnimalOrBatchRemoval hook
    • Include the date parameter to the delete animals/batches API calls.
  • Move reusable functions:
    • Extract reusable functions from animal/batch test files into the utils file.
  • Write tests
    • npm run test animalAndAnimalBatchCommon

Jira link: https://lite-farm.atlassian.net/browse/LF-4527

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have added "MISSING" for all new language tags to languages I don't speak
  • I have added the GNU General Public License to all new files

@SayakaOno SayakaOno added enhancement New feature or request Blocked labels Nov 22, 2024
@SayakaOno SayakaOno self-assigned this Nov 22, 2024
@SayakaOno SayakaOno changed the base branch from integration to LF-4531/Set_up_new_task_abandonment_reason_for_tasks_with_removed_animals November 22, 2024 21:07
* fail the request if animals or batches have completed or abandoned tasks
* add abandonTaskRequest to taskUtils
…arams

* update API calls in useAnimalOrBatchRemoval hook
@SayakaOno SayakaOno force-pushed the LF-4527/Handle_animal_deletion_and_abandon_related_tasks branch from 411ee32 to 2adf971 Compare November 26, 2024 01:43
@SayakaOno SayakaOno changed the base branch from LF-4531/Set_up_new_task_abandonment_reason_for_tasks_with_removed_animals to integration November 26, 2024 01:44
@SayakaOno SayakaOno changed the title [WIP] LF-4527: Handle animal deletion and abandon related tasks LF-4527: Handle animal deletion and abandon related tasks Nov 26, 2024
@SayakaOno SayakaOno removed the Blocked label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant