Skip to content

LF-5285: Prevent deletion of animals/batches with associated sales or expenses#4193

Open
SayakaOno wants to merge 4 commits into
integrationfrom
LF-5285/Prevent_deletion_of_animals/batches_with_associated_sales_or_expenses
Open

LF-5285: Prevent deletion of animals/batches with associated sales or expenses#4193
SayakaOno wants to merge 4 commits into
integrationfrom
LF-5285/Prevent_deletion_of_animals/batches_with_associated_sales_or_expenses

Conversation

@SayakaOno

Copy link
Copy Markdown
Collaborator

Description

Frontend:

  • Update useAnimalOrBatchRemoval to avoid deleting animals/batches with finance records

Backend:

  • Add methods to farmExpenseModel and saleModel
  • Update checkDeleteAnimalOrBatch middleware to prevent deletion of animals/batches with finance records
  • Add tests

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

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 ordered translation keys alphabetically (optional: run pnpm i18n to help with this)
  • I have added the GNU General Public License to all new files

@SayakaOno SayakaOno self-assigned this Jun 11, 2026
@SayakaOno SayakaOno requested review from a team as code owners June 11, 2026 12:59
@SayakaOno SayakaOno added the enhancement New feature or request label Jun 11, 2026
@SayakaOno SayakaOno requested review from kathyavini and removed request for a team June 11, 2026 12:59
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